public JsonResult UpdateStatus(string id) { GlobalVarible.Clear(); try { if (id != null) { Model = new Web.Framework.Entity.OperatorSetup(); Model.operatorid = new Guid(id); Model = (ENT.OperatorSetup)objBAL.GetByPrimaryKey(Model); if (Model.Status == COM.MyEnumration.MyStatus.Active) { if (!objBAL.UpdateStatus(Model.operatorid, COM.MyEnumration.MyStatus.DeActive)) { throw new Exception("Internal Server Error in status update."); } } if (Model.Status == COM.MyEnumration.MyStatus.DeActive) { if (!objBAL.UpdateStatus(Model.operatorid, COM.MyEnumration.MyStatus.Active)) { throw new Exception("Internal Server Error in status update."); } } GlobalVarible.AddMessage("Status Update Successfully."); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult EditRecord(string id) { if (id != null) { Model = new Web.Framework.Entity.OperatorSetup(); Model.UpdatedDateTime = DateTime.Now; Model.operatorid = new Guid(id); Model = (ENT.OperatorSetup)objBAL.GetByPrimaryKey(Model); } return(Json(new { Model = Model }, JsonRequestBehavior.AllowGet)); }
private List <string> ValidationEntry(object obj) { strvalidationResult.Clear(); Entity = (ENT.OperatorSetup)obj; if (string.IsNullOrWhiteSpace(Entity.operatorname)) { strvalidationResult.Add("Operator Name Required!"); } if (string.IsNullOrWhiteSpace(Entity.operatorcode.ToString())) { strvalidationResult.Add("Operator Code Required!"); } if (Entity.serviceid.ToString() == "00000000-0000-0000-0000-000000000000") { strvalidationResult.Add("Please Select Service."); } if (Entity.countryid.ToString() == "00000000-0000-0000-0000-000000000000") { strvalidationResult.Add("Please Select Country."); } if (string.IsNullOrWhiteSpace(Entity.Onlinevalidation.ToString())) { strvalidationResult.Add("Online Validation Required!"); } if (string.IsNullOrWhiteSpace(Entity.Paymentvalidation.ToString())) { strvalidationResult.Add("Payment Validation Required!"); } if (string.IsNullOrWhiteSpace(Entity.auth_name.ToString())) { strvalidationResult.Add("Parameters Name Required!"); } if (string.IsNullOrWhiteSpace(Entity.auth_regex.ToString())) { strvalidationResult.Add("Parameters Regex Required!"); } if (string.IsNullOrWhiteSpace(Entity.auth_msg.ToString())) { strvalidationResult.Add("Parameters Message Required!"); } if (string.IsNullOrWhiteSpace(Entity.auth_datatype.ToString())) { strvalidationResult.Add("Parameters DataType Required!"); } return(strvalidationResult); }
public object GetByPrimaryKey(ENT.OperatorSetup Entity) { object objResult = null; try { DAL.CRUDOperation tt = new DAL.CRUDOperation(); objResult = tt.GetEntityByPrimartKey(Entity); } catch (Exception) { throw; } return(objResult); }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { // TODO: dispose managed state (managed objects). } objDAL = null; clsDAL = null; Entity = null; lstEntity = null; // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }
public JsonResult SaveEntry(ENT.OperatorSetup model, string operatorid, string Billerlogoimg) { try { if (!string.IsNullOrWhiteSpace(Billerlogoimg)) { model.Billerlogo = SaveGenralImages(Billerlogoimg); } List <Guid> dctDuplication = new List <Guid>(); if (model.EntryMode == COM.Enumration.EntryMode.ADD) { model.Status = COM.MyEnumration.MyStatus.Active; List <ENT.OperatorSetup> lstResult = new BAL.OperatorSetup().CheckDuplicateCombination(dctDuplication, model.operatorname, model.operatorcode); if (lstResult.Count > 0) { throw new Exception("OperatorName Or OperatorCode Already Exists."); } if (objBAL.Insert(model)) { GlobalVarible.AddMessage("Record Save Successfully"); } } else { model.UpdatedDateTime = DateTime.Now; model.UpdatedBy = Guid.Parse(User.Identity.GetUserId()); model.operatorid = new Guid(operatorid.Replace("/", "")); if (objBAL.UpdatePartial(model)) { GlobalVarible.AddMessage("Record Update Successfully"); } } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
// this function for just referance for partial update field user have to create seperate function learn from this function. public bool UpdatePartial(ENT.OperatorSetup objEntity) { bool blnResult = false; try { //Create Fields List in dictionary Dictionary <string, bool> dctFields = new Dictionary <string, bool>(); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.operatorid), true); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.operatorname), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.Onlinevalidation), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.Paymentvalidation), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_name), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_msg), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_datatype), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_regex), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.reqtype_normal), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.reqtype_special), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.Billerlogo), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.operatorcode), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_name2), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_msg2), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_datatype2), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorSetup>(x => x.auth_regex2), false); objEntity.FieldCollection = dctFields; if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity)) { blnResult = true; } } catch (Exception) { throw; } return(blnResult); }