BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
public virtual ActionResult Save(T theObject)
{
var existingObject = Repo.GetByMultipleValues(primaryKeys(theObject));
if (existingObject == null)
// It must be an insert operation
{
Repo.Save(theObject);
}
else
// It must be an update operation
// Update the existing entity with the new values
{
AutoMapper.Mapper.Map(theObject, existingObject);
Repo.Save(existingObject);
}
return GetAllItems().GridActions<T>();
}
Hi Jeremy Branham,
Thanks for using Syncfusion products.
We suggest you to return partialview for the BeginEdit and BeginAddNew request type in the server mode(DialogTemplate). Please refer the below code snippets.
[HomeController.cs]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(PagingParams args, int? OrderID)
{
RequestType currentRequest = (RequestType)Convert.ToInt32(args.RequestType);
if (currentRequest == RequestType.BeginEdit)
{
EditableOrder ord = (EditableOrder)OrderRepository.Select(OrderID);
return PartialView("OrderEditorTemplate", ord);
}
else if (currentRequest == RequestType.BeginAddNew )
{
return PartialView("OrderEditorTemplate", new EditableOrder());
}
else
{
IEnumerable data = OrderRepository.GetAllRecords();
return data.GridActions<EditableOrder>();
}
}
For your convenience, we have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/DialogTemplate666937353.zip
Please let us know if you need any further assistance.
Regards,
Hariharan J.V.
Hi Jeremy,
Thank You for using Syncfusion Product.
We regret for the inconvenience caused. We are unable to
reproduce the issue in our end. The previous sample which we had provided you
is running without any error in Save Action and we have created a video
demonstration of it. So could you please try to reproduce the issue in our
sample and send us back or send your sample so that we can provide you a better
solution?
Please find the attached video below.
Please let us know if you need further assistance.
Regards,
Alan Sangeeth S