public ActionResult AddCustomer(Pastel.Evolution.Customer obj) { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; EvolutionSDK objEvol = EvolutionSDKInstance(SessLogObj); string strxml = null; var dbresult = objEvol.customerList("cIDNumber = '" + obj.IDNumber + "'"); if (dbresult == null) { obj = objEvol.addCustomer(obj); strxml = (obj != null && obj.Code != "") ? "<SYSMSGS><ID>1</ID><ERRORMSGS>Succefully Added</ERRORMSGS><TYPE>S</TYPE><TITLE>Customer</TITLE><EXTRA>" + obj.Code + "</EXTRA></SYSMSGS>" : "<SYSMSGS><ID>-1</ID><ERRORMSGS>Error In Adding Record</ERRORMSGS><TYPE>E</TYPE><TITLE>Customer</TITLE><EXTRA>" + obj.Code + "</EXTRA></SYSMSGS>"; } else { strxml = "<SYSMSGS><ID>-1</ID><ERRORMSGS>Customer With This National Id Already Exist !</ERRORMSGS><TYPE>W</TYPE><TITLE>Warning !</TITLE></SYSMSGS>"; } objRes = objRes.ReadBIErrors(strxml); return(Json(objRes, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }
public ActionResult EditCustomer(string code) { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; EvolutionSDK objEvol = EvolutionSDKInstance(SessLogObj); Pastel.Evolution.Customer objcust = objEvol.getCustomer(code); return(PartialView(objcust)); } catch (Exception ex) { throw ex; } }
public ActionResult EditCustomer(Pastel.Evolution.Customer obj) { try { SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"]; EvolutionSDK objEvol = EvolutionSDKInstance(SessLogObj); obj = objEvol.editCustomer(obj); string strxml = (obj != null && obj.Code != "") ? "<SYSMSGS><ID>1</ID><ERRORMSGS>Succefully Added</ERRORMSGS><TYPE>S</TYPE><TITLE>Pet</TITLE></SYSMSGS>" : "<SYSMSGS><ID>-1</ID><ERRORMSGS>Error In Ading Record</ERRORMSGS><TYPE>E</TYPE><TITLE>Pet</TITLE></SYSMSGS>"; Result rseXml = objRes.ReadBIErrors(strxml); return(Json(rseXml, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { throw ex; } }