public IHttpActionResult GetLastUserPhoneInforamtionByUserName(string userName)
        {
            BusinessOperation        businessOperation = new BusinessOperation();
            tbl_UserPhoneInforamtion itemOut           = null;
            BaseOutput baseOutput = businessOperation.GetLastUserPhoneInformationByUserName(userName, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Exemplo n.º 2
0
        public BaseOutput GetUserPhoneInformationByID(Int64 id, out tbl_UserPhoneInforamtion userPhoneInforamtion)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            userPhoneInforamtion = null;
            try
            {
                userPhoneInforamtion = cRUDOperation.GetUserPhoneInformationById(id);
                return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
            }
            catch (Exception ex)
            {
                return(baseOutput = new BaseOutput(false, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ex.Message));
            }
        }
        public IHttpActionResult AddUserPhoneInforamtion(tbl_UserPhoneInforamtion item)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            BusinessOperation businessOperation = new BusinessOperation();

            BaseOutput baseOutput = businessOperation.AddUserPhoneInformation(item);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok());
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Exemplo n.º 4
0
        public BaseOutput GetLastUserPhoneInformationByUserName(string userName, out tbl_UserPhoneInforamtion userPhoneInforamtion)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            userPhoneInforamtion = null;
            try
            {
                if (!string.IsNullOrEmpty(userName))
                {
                    userPhoneInforamtion = cRUDOperation.GetLastUserPhoneInformationByUserName(userName);
                    return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
                }
                else
                {
                    return(baseOutput = new BaseOutput(true, CustomError.EmptyUserNameErrorCode, CustomError.EmptyUserNameErrorDesc, ""));
                }
            }
            catch (Exception ex)
            {
                return(baseOutput = new BaseOutput(false, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ex.Message));
            }
        }
Exemplo n.º 5
0
        public BaseOutput DeleteUserPhoneInformation(Int64 id)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            try
            {
                tbl_UserPhoneInforamtion _UserPhoneInforamtion = cRUDOperation.DeleteUserPhoneInformation(id, 0);

                if (_UserPhoneInforamtion != null)
                {
                    return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
                }
                else
                {
                    return(baseOutput = new BaseOutput(true, CustomError.NotExistRecordErrorCode, CustomError.NotExistRecordErrorDesc, ""));
                }
            }
            catch (Exception ex)
            {
                return(baseOutput = new BaseOutput(false, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ex.Message));
            }
        }
Exemplo n.º 6
0
        public BaseOutput AddUserPhoneInformation(tbl_UserPhoneInforamtion item)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;


            try
            {
                bool flag = cRUDOperation.ControlUserPhoneInformation(item);
                if (!flag)
                {
                    tbl_UserPhoneInforamtion _UserPhoneInforamtion = cRUDOperation.AddUserPhoneInformation(item);
                    return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
                }
                else
                {
                    return(baseOutput = new BaseOutput(true, CustomError.ExistRecordErrorCode, CustomError.ExistRecordErrorDesc, ""));
                }
            }
            catch (Exception ex)
            {
                return(baseOutput = new BaseOutput(false, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ex.Message));
            }
        }