private void BindUserTypeValues()
 {
     try
     {
         UserTypeMaster objUserTypeMaster = UserTypeController.GetUserTypeByID(UserTypeID);
         txtUserType.Text = objUserTypeMaster.TypeName;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void UpdateUserType()
 {
     try
     {
         UserTypeMaster objUserTypeMaster = UserTypeController.GetUserTypeByID(UserTypeID);
         objUserTypeMaster.TypeName = txtUserType.Text;
         new UserTypeController().UpdateUserType(objUserTypeMaster);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void InsertUserType()
 {
     try
     {
         UserTypeMaster objUserTypes = new UserTypeMaster();
         objUserTypes.TypeName = txtUserType.Text;
         objUserTypes          = new UserTypeController().InsertUserType(objUserTypes);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public UserTypeMaster UpdateUserType(UserTypeMaster objUserType)
        {
            try
            {
                objUserType.updateDate = DateTime.Now;
                using (var context = new FitnessCenterEntities())
                {
                    context.UserTypeMasters.Attach(context.UserTypeMasters.Single(varL => varL.ID == objUserType.ID));
                    context.UserTypeMasters.ApplyCurrentValues(objUserType);

                    context.SaveChanges();
                    return(objUserType);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public UserTypeMaster InsertUserType(UserTypeMaster ObjUserType)
        {
            try
            {
                ObjUserType.insertDate = DateTime.Now;
                ObjUserType.isActive   = true;
                ObjUserType.isDeleted  = false;

                using (var context = new FitnessCenterEntities())
                {
                    context.UserTypeMasters.AddObject(ObjUserType);
                    context.SaveChanges();
                    return(ObjUserType);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 protected void Page_Unload(object sender, EventArgs e)
 {
     objCommonClass    = null;
     objUserTypeMaster = null;
 }
Beispiel #7
0
 public int Add_UserTypeMaster(UserTypeMaster _user)
 {
     SqlParameter[] param = { new SqlParameter("@UserType", _user.UserType) };
     return(_da.Execute("Insert_UserTypeMaster", param));
 }
Beispiel #8
0
 public int Edit_UserTypeMaster(UserTypeMaster _user)
 {
     SqlParameter[] param = { new SqlParameter("@UserTypeId", _user.UserTypeId),
                              new SqlParameter("@UserType",   _user.UserType) };
     return(_da.Execute("Update_UserTypeMaster", param));
 }