Пример #1
0
        public IHttpActionResult GetUserAccountingInfo(string userName)
        {
            UserBusinessOperation businessOperation = new UserBusinessOperation();
            UserAccountingDTO     itemOut           = null;
            BaseOutput            dbitem            = businessOperation.GetUserAccountingInfo(userName, out itemOut);

            if (dbitem.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, dbitem));
            }
        }
Пример #2
0
        public ActionResult DeleteException(int Id)
        {
            var result = new BaseOutput();

            result.data = LogService.DeleteExceptionLog(Id);
            if (result.data > 1)
            {
                SetResponse(s => s.Success, result);
            }
            else
            {
                SetResponse(s => s.DeleteFailed, result);
            }
            return(JsonNet(result));
        }
Пример #3
0
        public IHttpActionResult GetLastAppConsumeModelByUserName(string userName)
        {
            BusinessOperation businessOperation = new BusinessOperation();
            AppConsumeModel   itemOut           = null;
            BaseOutput        baseOutput        = businessOperation.GetLastAppConsumeModelByUserName(userName, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #4
0
        public IHttpActionResult UpdateProposalUserGroupList(ProposalUserGroupModel item)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            ProposalUserGroupModel    itemOut           = null;
            BaseOutput baseOutput = businessOperation.UpdateProposalUserGroupList(item, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #5
0
        public IHttpActionResult GetAppConsumeModelWithDetails()
        {
            BusinessOperation      businessOperation = new BusinessOperation();
            List <AppConsumeModel> itemsOut          = null;
            BaseOutput             baseOutput        = businessOperation.GetAppConsumeModels(out itemsOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemsOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #6
0
        public IHttpActionResult GetProposalWithDetailsByID(Int64 id)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            Proposal   itemOut = null;
            BaseOutput dbitem  = businessOperation.GetProposalByID(id, out itemOut);

            if (dbitem.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, dbitem));
            }
        }
Пример #7
0
        public IHttpActionResult GetProposalUserStates()
        {
            ProposalBusinessOperation    businessOperation = new ProposalBusinessOperation();
            List <tbl_ProposalUserState> itemsOut          = null;
            BaseOutput baseOutput = businessOperation.GetProposalUserStates(out itemsOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemsOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #8
0
        public IHttpActionResult DeleteProposalUserState(Int64 id)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            tbl_ProposalUserState     itemOut           = null;
            BaseOutput baseOutput = businessOperation.DeleteProposalUserState(id, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #9
0
        public IHttpActionResult GetProposalWithDetailAndStatesByProviderID(Int64 providerid)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            List <Proposal>           itemsOut          = null;
            BaseOutput dbitem = businessOperation.GetProposalsWithStateByProviderID(providerid, out itemsOut);

            if (dbitem.ResultCode == 1)
            {
                return(Ok(itemsOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, dbitem));
            }
        }
Пример #10
0
        public IHttpActionResult GetProposalWithDetailsByIsPublic(string username)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            List <Proposal>           itemsOut          = null;
            BaseOutput dbitem = businessOperation.GetProposalWithDetailsByIsPublic(username, out itemsOut);

            if (dbitem.ResultCode == 1)
            {
                return(Ok(itemsOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, dbitem));
            }
        }
Пример #11
0
        public IHttpActionResult GetAppConsumeModelWithDetailByID(Int64 id)
        {
            BusinessOperation businessOperation = new BusinessOperation();
            AppConsumeModel   itemOut           = null;
            BaseOutput        baseOutput        = businessOperation.GetAppConsumeModelByID(id, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #12
0
        public IHttpActionResult GenarateOTPUseNumber(string phoneNumber)
        {
            OTPOperation businessOperation = new OTPOperation();
            string       itemOut           = string.Empty;
            BaseOutput   baseOutput        = businessOperation.GenarateOTPByNumber(phoneNumber, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #13
0
        public IHttpActionResult VerifyOTPUseNumber(string phoneNumber, string otptext)
        {
            OTPOperation businessOperation = new OTPOperation();
            bool         itemOut           = false;
            BaseOutput   baseOutput        = businessOperation.VerifyOTPByNumber(phoneNumber, otptext, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
        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));
            }
        }
Пример #15
0
        public IHttpActionResult GetProviderByUserName(string username)
        {
            ProviderBusinessOperation businessOperation = new ProviderBusinessOperation();
            Provider   itemOut    = null;
            BaseOutput baseOutput = businessOperation.GetProviderByUserName(username, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #16
0
        public IHttpActionResult DeleteCustomer(Int64 id)
        {
            CRUDOperation operation  = new CRUDOperation();
            tbl_Customer  itemOut    = null;
            BaseOutput    baseOutput = businessOperation.DeleteCustomer(id, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #17
0
        public IHttpActionResult GetProviderWithUser(Int64 providerID)
        {
            ProviderBusinessOperation businessOperation = new ProviderBusinessOperation();
            Provider   itemOut    = null;
            BaseOutput baseOutput = businessOperation.GetProviderByID(providerID, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #18
0
        public decimal GetMontlyAverage(Int64 userId, Int64 sourceEV, Int64 mobileEV, int year, int lastMontCount, int firstMountCount, int startMont, int endMonth)
        {
            decimal _monthlyAverage = 0;

            if (userId == 0 || sourceEV == 0 || mobileEV == 0)
            {
                return(_monthlyAverage);
            }

            NetConsumeBOperation businessOperation = new NetConsumeBOperation();

            BaseOutput dbitem = businessOperation.GetMontlyAverage(userId, sourceEV, mobileEV, year, lastMontCount, firstMountCount, startMont, endMonth, out _monthlyAverage);

            return(_monthlyAverage);
        }
Пример #19
0
        public IHttpActionResult AddProposalFavorite(tbl_ProposalFavorite item)
        {
            ProposalBusinessOperation businessOperation = new ProposalBusinessOperation();
            tbl_ProposalFavorite      itemOut           = null;
            BaseOutput baseOutput = businessOperation.AddProposalFavorite(item, out itemOut);

            if (baseOutput.ResultCode == 1)
            {
                return(Ok(itemOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, baseOutput));
            }
        }
Пример #20
0
        public IHttpActionResult GetProposalUserStatesByUserStateType(Int64 userStateType)
        {
            ProposalBusinessOperation    businessOperation = new ProposalBusinessOperation();
            List <tbl_ProposalUserState> itemsOut          = null;
            BaseOutput dbitem = businessOperation.GetProposalUserStatesByUserStateType(userStateType, out itemsOut);

            if (dbitem.ResultCode == 1)
            {
                return(Ok(itemsOut));
            }
            else
            {
                return(Content(HttpStatusCode.BadRequest, dbitem));
            }
        }
Пример #21
0
        public BaseOutput GetSMSModels(out List <SMSModel> sMSModels)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            sMSModels = null;
            try
            {
                List <tbl_SMSModel> tbl_SMSModels = cRUDOperation.GetSMSModels();
                sMSModels = new List <SMSModel>();

                if (tbl_SMSModels.Count > 0)
                {
                    foreach (var tbl_SMSModel in tbl_SMSModels)
                    {
                        SMSModel sMSModel = new SMSModel()
                        {
                            ID = tbl_SMSModel.ID,
                            TotalMessageCount = tbl_SMSModel.TotalMessageCount,
                            ShortMessageCount = tbl_SMSModel.ShortMessageCount,

                            OutMessageCount = tbl_SMSModel.OutMessageCount,
                            InMessageCount  = tbl_SMSModel.InMessageCount,

                            OutMessageForeignCount = tbl_SMSModel.OutMessageForeignCount,
                            InMessageForeigCount   = tbl_SMSModel.InMessageForeigCount,

                            OutMessageRoamingCount = tbl_SMSModel.OutMessageRoamingCount,
                            InMessageRoamingCount  = tbl_SMSModel.InMessageRoamingCount,

                            BeginDate = tbl_SMSModel.BeginDate,
                            EndDate   = tbl_SMSModel.EndDate,
                        };

                        List <tbl_SMSDetail> tbl_SMSDetails = cRUDOperation.GetSMSDetailsByModelID(sMSModel.ID);


                        sMSModel.SMSDetails = tbl_SMSDetails;
                        sMSModels.Add(sMSModel);
                    }
                }
                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));
            }
        }
Пример #22
0
        public BaseOutput ChangePasswordByUserName(UserInfo item, Int64 LoginUserID, out tbl_User itemOut)
        {
            CRUDOperation cRUDOperation = new CRUDOperation();
            BaseOutput    baseOutput;

            try
            {
                if (item.Newpassword != item.ConfirmPassword)
                {
                    itemOut = null;
                    return(baseOutput = new BaseOutput(true, CustomError.PasswordAndConfirmPasswordCode, CustomError.PasswordAndConfirmPasswordDesc, ""));
                }


                tbl_User user = cRUDOperation.GetUserByUserName(item.UserName);
                if (user == null)
                {
                    itemOut = null;
                    return(baseOutput = new BaseOutput(true, CustomError.UserNameNotFoundCode, CustomError.UserNameNotFoundDesc, ""));
                }
                string   encryptedPassword = UserUtil.MD5HashedPassword(item.Password);
                tbl_User validUser         = cRUDOperation.ValidLogin(item.UserName, encryptedPassword);
                if (validUser != null)
                {
                    string   encryptedNewPassword = UserUtil.MD5HashedPassword(item.Newpassword);
                    tbl_User _User = cRUDOperation.ChangePassword(validUser.ID, LoginUserID, encryptedNewPassword);
                    if (_User != null)
                    {
                        itemOut = _User;
                        return(baseOutput = new BaseOutput(true, BOResultTypes.Success.GetHashCode(), BOBaseOutputResponse.SuccessResponse, ""));
                    }
                    else
                    {
                        itemOut = null;
                        return(baseOutput = new BaseOutput(true, BOResultTypes.Danger.GetHashCode(), BOBaseOutputResponse.DangerResponse, ""));
                    }
                }
                else
                {
                    itemOut = null;
                    return(baseOutput = new BaseOutput(true, CustomError.PasswordIncorrectCode, CustomError.PasswordIncorrectDesc, ""));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #23
0
        public BaseOutput ChangePassword(Int64 id, string newpassword, out tbl_User itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                tbl_User user = operation.ChangePassword(id, id, newpassword);
                itemOut = user;
                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));
            }
        }
Пример #24
0
        public BaseOutput AddUser(tbl_User item, out tbl_User itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                tbl_User user = operation.AddUser(item);
                itemOut = user;
                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));
            }
        }
Пример #25
0
        public BaseOutput DeleteUserGroup(Int64 id, out tbl_UserGroup itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                tbl_UserGroup userGroup = operation.DeleteUserGroup(id, 0);
                itemOut = userGroup;
                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));
            }
        }
Пример #26
0
        public BaseOutput GetUserGroups(out List <tbl_UserGroup> itemsOut)
        {
            BaseOutput baseOutput;

            itemsOut = null;
            try
            {
                var userGroups = operation.GetUserGroups();
                itemsOut = userGroups;
                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));
            }
        }
Пример #27
0
        public BaseOutput GetUserByUserName(string username, out tbl_User itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                var user = operation.GetUserByUserName(username);
                itemOut = user;
                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));
            }
        }
Пример #28
0
        public BaseOutput UpdateGroup(tbl_Group item, out tbl_Group itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                tbl_Group group = operation.UpdateGroup(item);
                itemOut = group;
                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));
            }
        }
Пример #29
0
        public BaseOutput ChangeUserActivateStatus(Int64 id, int activateStatus, out tbl_User itemOut)
        {
            BaseOutput baseOutput;

            itemOut = null;
            try
            {
                tbl_User user = operation.ActivateUser(id, id, activateStatus);
                itemOut = user;
                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));
            }
        }
Пример #30
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 void Add(BaseOutput output)
        {
            if (_outputs.Any(e => e.Id == output.Id))
                throw new Exception("Already specified output: " + output.Id);

            // use protected member directly to avoid component status check on Outputs
            _outputs.Add(output);
        }