コード例 #1
0
        public static JsonResults AddEditItemToDB(ItemMaster ItemMaster, int itemMasterID)
        {
            JsonResults returnObj = new JsonResults();
            LoginUser   currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.AddEditItemMaster(currentUser.CompanyID, currentUser.UserId, currentUser.UserBranchID, itemMasterID, ref ItemMaster))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = customerObj.GetLastErrorCode();
                    returnObj.ErrorMessage = customerObj.GetLastError();
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }