Ejemplo n.º 1
0
        public ActionResult UpdateUserStatus(string[] EmpCode, string UserStatus)
        {
            try
            {
                UserStatus = (UserStatus == ConstantValues.AllValue) ? null : UserStatus;
                string empCodeXML             = ConvertToXml_Store(EmpCode, "EmpCode");
                UpdateUserStatusResult result = MasterService.UpdateUserStatus(empCodeXML, UserStatus, UserDetail.UserID);

                return(Content(JsonConvert.SerializeObject(GetMsgFromUpdateUserStatusActionResult(result)), ConstantValues.JSON_CONTENT_TYPE));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public UpdateUserStatusResult GetMsgFromUpdateUserStatusActionResult(UpdateUserStatusResult result)
        {
            try
            {
                if (result.ErrorCode == "0")
                {
                    result.ErrorMessage = MessageListResource.I0001;
                }
                else if (result.ErrorCode == "1")
                {
                    result.ErrorMessage = String.Format(MessageListResource.E0007, result.ErrorMessage);
                }
                else if (result.ErrorCode == "9")
                {
                    result.ErrorMessage = String.Format(MessageListResource.E0003, "update", result.ErrorMessage);
                }

                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }