示例#1
0
 public FormFeedbackViewModel ValidateBrandTypeProductNo(string brand, string type, string productNo)
 {
     string loginUserInfo        = HttpContext.Session.GetString("loginUser");
     long   loginUserId          = long.Parse(loginUserInfo.Split(",")[0]);
     int    nowNode              = int.Parse(HttpContext.Session.GetString("nowNode"));
     FormFeedbackViewModel model = replacePhoneManage.ValidateBrandTypeProductNo(loginUserId, nowNode, Step.replacePhone, brand, type, productNo);            return(model);
 }
        public FormFeedbackViewModel SubmitMsg(string userInfo, int nowNode, string productNo, string brand, string type, DateTime startDate, DateTime abandonDate)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, Step.replacePhoneSubmit])
            {
                model.IsVisitLegal = true;
                if (!string.IsNullOrEmpty(productNo) && !string.IsNullOrEmpty(brand) && !string.IsNullOrEmpty(type) && startDate != null)
                {
                    model.IsParameterNotEmpty = true;
                    if (brandTypeProductNoDao.ValidateBrandTypeProductNo(brand, type, productNo) && Validation.IsDateNotBeforeToday(startDate) && Validation.IsTwoDaysEquals(startDate, abandonDate))
                    {
                        model.IsParameterLegal = true;
                        long     userId        = long.Parse(userInfo.Split(",")[0]);
                        string   loginUsername = userInfo.Split(",")[1];
                        int      phoneLife     = typeYearDao.GetYearByType(type);
                        DateTime endDate       = GetPhoneEndDate(startDate, phoneLife);
                        Phone    phone         = new Phone(loginUsername, userId, brand, type, productNo, startDate, endDate);
                        SetTempNewPhoneByUserId(userId, phone);
                        SetTempOldPhoneAbandonDateByUserId(userId, abandonDate);
                        model.IsSuccess = true;
                    }
                }
            }
            return(model);
        }
        public FormFeedbackViewModel SetAbanddonToUsingById(long id, DateTime startDate)
        {
            string loginUserInfo        = HttpContext.Session.GetString("loginUser");
            long   loginUserId          = long.Parse(loginUserInfo.Split(",")[0]);
            int    nowNode              = int.Parse(HttpContext.Session.GetString("nowNode"));
            FormFeedbackViewModel model = choosePageManage.SetAbanddonToUsingById(loginUserId, nowNode, id, startDate);

            return(model);
        }
        public FormFeedbackViewModel SetIsSubmit()
        {
            int nowNode   = int.Parse(HttpContext.Session.GetString("nowNode"));
            int visitNode = Step.deletePhoneCheck;
            FormFeedbackViewModel model = Step.SetIsSubmit(nowNode, visitNode);

            if (model.IsSuccess)
            {
                HttpContext.Session.SetString("isSubmit", Step.isSubmitTrue.ToString());
            }
            return(model);
        }
        public FormFeedbackViewModel SubmitMsg()
        {
            string loginUserInfo        = HttpContext.Session.GetString("loginUser");
            long   loginUserId          = long.Parse(loginUserInfo.Split(",")[0]);
            int    nowNode              = int.Parse(HttpContext.Session.GetString("nowNode"));
            FormFeedbackViewModel model = deletePhoneCheckManage.SubmitMsg(loginUserId, nowNode);

            if (model.IsSuccess)
            {
                HttpContext.Session.SetString("isSubmit", Step.isSubmitTrue.ToString());
            }
            return(model);
        }
示例#6
0
        public FormFeedbackViewModel SubmitMsg(string productNo, string brand, string type, DateTime startDate, DateTime abandonDate)
        {
            string loginUserInfo        = HttpContext.Session.GetString("loginUser");
            long   loginUserId          = long.Parse(loginUserInfo.Split(",")[0]);
            int    nowNode              = int.Parse(HttpContext.Session.GetString("nowNode"));
            FormFeedbackViewModel model = replacePhoneManage.SubmitMsg(loginUserInfo, nowNode, productNo, brand, type, startDate, abandonDate);

            if (model.IsSuccess)
            {
                HttpContext.Session.SetString("isSubmit", Step.isSubmitTrue.ToString());
            }
            return(model);
        }
        public FormFeedbackViewModel SetTempOldPhoneById(long id)
        {
            string loginUserInfo        = HttpContext.Session.GetString("loginUser");
            long   loginUserId          = long.Parse(loginUserInfo.Split(",")[0]);
            int    nowNode              = int.Parse(HttpContext.Session.GetString("nowNode"));
            FormFeedbackViewModel model = choosePageManage.SetTempOldPhoneById(loginUserId, nowNode, id);

            if (model.IsSuccess)
            {
                HttpContext.Session.SetString("isSubmit", Step.isSubmitTrue.ToString());
            }
            return(model);
        }
示例#8
0
        public static FormFeedbackViewModel SetIsSubmit(int nowNode, int visitNode)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (stepTable[nowNode, visitNode])
            {
                model.IsVisitLegal        = true;
                model.IsParameterNotEmpty = true;
                model.IsParameterLegal    = true;
                model.IsSuccess           = true;
            }
            return(model);
        }
        public FormFeedbackViewModel SubmitMsg(long userId, int nowNode)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel();

            if (Step.stepTable[nowNode, Step.deletePhoneCheckSubmit])
            {
                model.IsVisitLegal        = true;
                model.IsParameterNotEmpty = true;
                if (TempPhone.IsTempNewPhoneNotEmpty(userId))
                {
                    model.IsParameterLegal = true;
                    SetTempNewPhoneToDBByUserId(userId);
                    model.IsSuccess = true;
                }
            }
            return(model);
        }
        public FormFeedbackViewModel SubmitMsg(long userId, int nowNode)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, Step.replacePhoneCheckSubmit])
            {
                model.IsVisitLegal        = true;
                model.IsParameterNotEmpty = true;
                if (TempPhone.IsTempNewPhoneNotEmpty(userId) && TempPhone.IsTempOldPhoneNotEmpty(userId))
                {
                    model.IsParameterLegal = true;
                    phoneDao.SetTempNewPhoneToDBByUserId(userId);
                    phoneDao.SetTemoOldPhoneAbandonToDBByUserId(userId);
                    model.IsSuccess = true;
                }
            }
            return(model);
        }
示例#11
0
        public FormFeedbackViewModel SetTempOldPhoneById(long userId, int nowNode, long id)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, Step.choosePageSubmit])
            {
                model.IsVisitLegal = true;
                if (phoneDao.ValidateIdInReplace(id, userId))
                {
                    model.IsParameterNotEmpty = true;
                    model.IsParameterLegal    = true;
                    Phone phone = phoneDao.GetPhoneById(id);
                    TempPhone.SetTempOldPhoneByUserId(userId, phone);
                    model.IsSuccess = true;
                }
            }
            return(model);
        }
        public FormFeedbackViewModel ValidateBrandTypeProductNo(long userId, int nowNode, int visitNode, string brand, string type, string productNo)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, visitNode])
            {
                model.IsVisitLegal = true;
                if (!string.IsNullOrEmpty(brand) && !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(productNo))
                {
                    model.IsParameterNotEmpty = true;
                    model.IsParameterLegal    = true;
                    brand           = brand.Trim();
                    type            = type.Trim();
                    productNo       = productNo.Trim();
                    model.IsSuccess = brandTypeProductNoDao.ValidateBrandTypeProductNo(brand, type, productNo);
                }
            }
            return(model);
        }
示例#13
0
        public FormFeedbackViewModel SetAbanddonToUsingById(long userId, int nowNode, long id, DateTime startDate)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, Step.choosePageSubmit])
            {
                model.IsVisitLegal = true;
                if (phoneDao.ValidateIdInAbandonOrDelete(id, userId) && Validation.IsDateLegal(startDate))
                {
                    model.IsParameterNotEmpty = true;
                    model.IsParameterLegal    = true;
                    Phone phone = phoneDao.GetPhoneById(id);
                    phone = UpdatePhoneState(phone, startDate, 1);
                    phoneDao.UpdatePhoneStateInDB(phone);
                    model.IsSuccess = true;
                }
            }
            return(null);
        }
示例#14
0
        public FormFeedbackViewModel SubmitMsg(long userId, int nowNode, string deleteReason, DateTime deleteDate, int state)
        {
            FormFeedbackViewModel model = new FormFeedbackViewModel()
            {
                IsLogin = true
            };

            if (Step.stepTable[nowNode, Step.deletePhoneSubmit])
            {
                model.IsVisitLegal = true;
                if (!string.IsNullOrEmpty(deleteReason) && (state == 1 || state == 2))
                {
                    model.IsParameterNotEmpty = true;
                    if (Validation.IsDateNotBeforeToday(deleteDate))
                    {
                        model.IsParameterLegal = true;
                        deleteReason           = deleteReason.Trim();
                        SetTempNewPhoneDeleteByUserId(userId, deleteReason, deleteDate, state);
                        model.IsSuccess = true;
                    }
                }
            }
            return(model);
        }