Esempio n. 1
0
        // this function for just referance for partial update field user have to create seperate function learn from this function.
        public bool UpdatePartial(ENT.OperatorMapping objEntity)
        {
            bool blnResult = false;

            try
            {
                //Create Fields List in dictionary
                Dictionary <string, bool> dctFields = new Dictionary <string, bool>();
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorMapping>(x => x.operatormapid), true);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorMapping>(x => x.operatornomal), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorMapping>(x => x.operatorspecial), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorMapping>(x => x.UpdatedBy), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.OperatorMapping>(x => x.UpdatedDateTime), false);
                objEntity.FieldCollection = dctFields;
                if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity))
                {
                    blnResult = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(blnResult);
        }
Esempio n. 2
0
 public JsonResult EditRecord(string id)
 {
     if (id != null)
     {
         Model = new Web.Framework.Entity.OperatorMapping();
         Model.UpdatedDateTime = DateTime.Now;
         Model.operatormapid   = new Guid(id);
         Model = (ENT.OperatorMapping)objBAL.GetByPrimaryKey(Model);
     }
     return(Json(new { Model = Model }, JsonRequestBehavior.AllowGet));
 }
Esempio n. 3
0
 private List <string> ValidationEntry(object obj)
 {
     strvalidationResult.Clear();
     Entity = (ENT.OperatorMapping)obj;
     if (Entity.operatorid.ToString() == "00000000-0000-0000-0000-000000000000")
     {
         strvalidationResult.Add("Please Select Operator.");
     }
     if (Entity.apiid.ToString() == "00000000-0000-0000-0000-000000000000")
     {
         strvalidationResult.Add("Please Select Apis.");
     }
     return(strvalidationResult);
 }
Esempio n. 4
0
        public object GetByPrimaryKey(ENT.OperatorMapping Entity)
        {
            object objResult = null;

            try
            {
                DAL.CRUDOperation tt = new DAL.CRUDOperation();
                objResult = tt.GetEntityByPrimartKey(Entity);
            }
            catch (Exception)
            {
                throw;
            }
            return(objResult);
        }
Esempio n. 5
0
        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;
            }
        }
Esempio n. 6
0
 public JsonResult DeleteEntry(string id)
 {
     GlobalVarible.Clear();
     if (id != null)
     {
         Model = new Web.Framework.Entity.OperatorMapping();
         Model.operatormapid = new Guid(id);
         if (objBAL.Delete(Model))
         {
             GlobalVarible.AddMessage("Record Delete Successfully.");
         }
         else
         {
             GlobalVarible.AddError("Internal Server Error Please Try Again");
         }
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
Esempio n. 7
0
 public JsonResult SaveEntry(ENT.OperatorMapping model, string operatormapid)
 {
     try
     {
         List <Guid> dctDuplication = new List <Guid>();
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
             model.operatormapid   = new Guid(operatormapid.Replace("/", ""));
             if (string.IsNullOrEmpty(model.operatornomal))
             {
                 model.operatornomal = string.Empty;
             }
             if (string.IsNullOrEmpty(model.operatorspecial))
             {
                 model.operatorspecial = string.Empty;
             }
             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));
 }