public JsonResult SaveEntry(ENT.DMTSlabCommi model, string dmtslabid)
 {
     try
     {
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
             model.dmtslabid       = new Guid(dmtslabid.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));
 }
Пример #2
0
        private List <string> ValidationEntry(object obj)
        {
            strvalidationResult.Clear();
            Entity = (ENT.DMTSlabCommi)obj;
            if (string.IsNullOrWhiteSpace(Entity.dmtslabname))
            {
                strvalidationResult.Add("Slab Name Required!");
            }

            return(strvalidationResult);
        }
Пример #3
0
        public object GetByPrimaryKey(ENT.DMTSlabCommi Entity)
        {
            object objResult = null;

            try
            {
                DAL.CRUDOperation tt = new DAL.CRUDOperation();
                objResult = tt.GetEntityByPrimartKey(Entity);
            }
            catch (Exception)
            {
                throw;
            }
            return(objResult);
        }
Пример #4
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;
            }
        }
Пример #5
0
        // this function for just referance for partial update field user have to create seperate function learn from this function.
        public bool UpdatePartial(ENT.DMTSlabCommi objEntity)
        {
            bool blnResult = false;

            try
            {
                //Create Fields List in dictionary
                Dictionary <string, bool> dctFields = new Dictionary <string, bool>();
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.DMTSlabCommi>(x => x.dmtslabid), true);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.DMTSlabCommi>(x => x.dmtslabname), false);

                objEntity.FieldCollection = dctFields;
                if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity))
                {
                    blnResult = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(blnResult);
        }