// this function for just referance for partial update field user have to create seperate function learn from this function. public bool UpdatePartial(ENT.Complain objEntity) { bool blnResult = false; try { //Create Fields List in dictionary Dictionary <string, bool> dctFields = new Dictionary <string, bool>(); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.complainid), true); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.rechargeid), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.complaintype), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.detail), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.complainstatus), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.adminremarks), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.SystemDateTime), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.CreatedBy), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.CreatedDateTime), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.UpdatedBy), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.Complain>(x => x.UpdatedDateTime), false); objEntity.FieldCollection = dctFields; if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity)) { blnResult = true; } } catch (Exception) { throw; } return(blnResult); }
public JsonResult UpdateComplain(ENT.Complain model) { try { using (BAL.Complain objBAL = new BAL.Complain()) { objBAL.Entity.UpdatedBy = _LoginUserId; objBAL.Entity.UpdatedDateTime = DateTime.Now; objBAL.Entity.complainid = model.complainid; objBAL.Entity.complainstatus = (int)COM.MyEnumration.TICKETSTATUS.RESOLVED; objBAL.Entity.adminremarks = model.adminremarks; if (objBAL.UpdateStatus(objBAL.Entity)) { GlobalVarible.AddMessage("Complain updated successfully."); } else { GlobalVarible.AddError("Unable to update complain.Please try again."); } } } catch (Exception ex) { ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model)); GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public JsonResult SaveComplain(ENT.Complain model) { try { using (BAL.Complain objBAL = new BAL.Complain()) { model.CreatedDateTime = DateTime.Now; model.CreatedBy = _LoginUserId; model.complainstatus = (int)COM.MyEnumration.TICKETSTATUS.CREATED; model.adminremarks = string.Empty; if (objBAL.Insert(model)) { GlobalVarible.AddMessage("Complain registered successfully."); } else { GlobalVarible.AddError("Unable to register complain.Please contact your administrator."); } } } catch (Exception ex) { ERRORREPORTING.Report(ex, _REQUESTURL, _LoginUserId, _ERRORKEY, new JavaScriptSerializer().Serialize(model)); GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
public object GetByPrimaryKey(ENT.Complain Entity) { object objResult = null; try { DAL.CRUDOperation tt = new DAL.CRUDOperation(); objResult = tt.GetEntityByPrimartKey(Entity); } catch (Exception) { throw; } return(objResult); }