public JsonResult IsEnabledActivity(bool id) { try { ENT.IsEnabledApiCall model2 = new ENT.IsEnabledApiCall(); BAL.IsEnabledApiCall objBAL = new BAL.IsEnabledApiCall(); if (id == true || id == false) { model2.Isenabled = id; model2.ipaddress = new GenralGetIp().GetIPAddress(Request); model2.userid = Guid.Parse(User.Identity.GetUserId()); model2.enabletext = (id == true ? "ON" : "OFF"); if (objBAL.Insert(model2)) { GlobalVarible.AddMessage("Record Save 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.IsEnabledApiCall objEntity) { bool blnResult = false; try { //Create Fields List in dictionary Dictionary <string, bool> dctFields = new Dictionary <string, bool>(); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.isenableid), true); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.enabletext), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.Isenabled), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.ipaddress), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.SystemDateTime), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.CreatedBy), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.CreatedDateTime), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.UpdatedBy), false); dctFields.Add(COM.HelperMethod.PropertyName <ENT.IsEnabledApiCall>(x => x.UpdatedDateTime), false); objEntity.FieldCollection = dctFields; if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity)) { blnResult = true; } } catch (Exception) { throw; } return(blnResult); }
public JsonResult GetIsEnabled() { GlobalVarible.Clear(); ENT.IsEnabledApiCall model = new ENT.IsEnabledApiCall(); using (BAL.IsEnabledApiCall obj = new BAL.IsEnabledApiCall()) { model = (ENT.IsEnabledApiCall)obj.GetIsEnabled(Guid.Parse(User.Identity.GetUserId())); } return(Json(model, JsonRequestBehavior.AllowGet)); }
public object GetByPrimaryKey(ENT.IsEnabledApiCall 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 ENT.IsEnabledApiCall GetIsEnabled(Guid id) { ENT.IsEnabledApiCall lstEntity = new ENT.IsEnabledApiCall(); lstEntity = clsDAL.GetIsEnable(id); return(lstEntity); }