Beispiel #1
0
        public JsonResult Login(string name, string pwd)
        {
            string     txt   = CommonMethod.PasswordMD5("123456");
            ResultInfo info  = new ResultInfo();
            var        model = AccountDBOperate.LoginByMobileOrEmail(name);

            if (model == null)
            {
                info.Message = "该用户未注册"; return(Json(info));
            }
            //var txt = CommonMethod.PasswordMD5("123456");
            if (model.Password != CommonMethod.PasswordMD5(pwd))
            {
                info.Message = "密码错误";
                return(Json(info));
            }
            info.IsSuccess = true;
            //model.AccountId
            if (model.Role == 1)
            {
                var model1 = CustomerCompanyDBOperate.GetCompanyByMember(model.AccountId);
                model.AccountName = model1.Name;
            }
            CookieOperate.AccountCookie = model;
            return(Json(info));
        }
Beispiel #2
0
        public JsonResult GetCompanyInfo()
        {
            var info    = new ResultInfo <CustomerCompany>();
            var account = CookieOperate.AccountCookie;
            var data    = CustomerCompanyDBOperate.GetCompanyByMember(account.AccountId);

            info.IsSuccess = true;
            info.Data      = data;
            return(Json(info));
        }
Beispiel #3
0
        public ActionResult Center()
        {
            var account = CookieOperate.AccountCookie;

            if (account.Role == 1)
            {
                var model = CustomerCompanyDBOperate.GetCompanyByMember(account.AccountId);
                ViewBag.Company = model;
            }
            //ViewBag.Account = ;

            return(View());
        }
Beispiel #4
0
        public JsonResult SaveCompanyInfo(CustomerCompany model)
        {
            var info    = new ResultInfo();
            var account = CookieOperate.AccountCookie;
            var data    = CustomerCompanyDBOperate.GetCompanyByMember(account.AccountId);

            if (model.Name != "")
            {
                data.Name = model.Name;
            }
            if (model.Tax != "")
            {
                data.Tax = model.Tax;
            }
            if (model.BankName != "")
            {
                data.BankName = model.BankName;
            }
            if (model.BankNo != "")
            {
                data.BankNo = model.BankNo;
            }
            if (model.License != "")
            {
                data.License = model.License;
            }
            if (model.ContactName != "")
            {
                data.ContactName = model.ContactName;
            }
            if (model.ContactMobile != "")
            {
                data.ContactMobile = model.ContactMobile;
            }
            if (model.Address != "")
            {
                data.Address = model.Address;
            }
            account.AccountName         = model.Name;
            info.IsSuccess              = CustomerCompanyDBOperate.ModifyCustomerCompany(data);
            CookieOperate.AccountCookie = account;
            if (info.IsSuccess)
            {
                info.Message = "修改成功";
            }
            else
            {
                info.Message = "修改失败";
            }
            return(Json(info));
        }