Exemple #1
0
        public ActionResult AddOrderClient(WebOrderClient webOrderClient)
        {
            OrderClientBLL OrderClientBLL = new OrderClientBLL();

            webOrderClient.CreateUserID = this.GetCurrentUserID();
            CResult <bool> cResult = OrderClientBLL.InsertOrderClient(webOrderClient);

            return(JsonContentHelper.GetJsonContent(cResult));
        }
Exemple #2
0
 public ActionResult Delete(string id)
 {
     try
     {
         var result = new OrderClientBLL().DeleteOrderClient(id);
         return(JsonContentHelper.GetJsonContent(result));
     }
     catch
     {
         return(View());
     }
 }
Exemple #3
0
        public ActionResult UpdateOrderClient(string OrderClientID, string returnUrl)
        {
            OrderClientBLL OrderClientBLL = new OrderClientBLL();
            var            result         = OrderClientBLL.GetOrderClientInfoByID(OrderClientID);
            WebOrderClient webOrderClient = null;

            if (result.Code == 0)
            {
                webOrderClient = result.Data;
            }
            ViewBag.ReturnUrl = returnUrl;
            return(View(webOrderClient));
        }
Exemple #4
0
        //
        // GET: /OrderClientManager/

        public ActionResult Index(string searchInfo, int pageIndex = 1, int pageSize = 10, string orderBy = "", bool ascending = false)
        {
            var userList   = new List <WebOrderClient>();
            int totalCount = 0;
            var cResult    = new OrderClientBLL().GetOrderClientList(out totalCount, searchInfo, pageIndex, pageSize, orderBy, ascending);

            if (cResult.Code == 0)
            {
                userList = cResult.Data;
            }
            var pageList = new PagedList <WebOrderClient>(userList, pageIndex, pageSize, totalCount);

            ViewBag.SearchInfo = searchInfo;
            ViewBag.PageSize   = pageSize;
            return(View(pageList));
        }
        public ActionResult UpdateLogo(HttpPostedFileBase fileData)
        {
            var cResult = new OrderClientBLL().UpdateCompayLogo(fileData, this.GetCurrentOrderClientID());

            if (cResult.Code == 0 && cResult.Data)
            {
                var companyInfo = OrderClientBLL.GetCompanyInfo(this.GetCurrentOrderClientID());

                if (companyInfo.Code == 0)
                {
                    Response.Cookies.Add(new HttpCookie("LogoFileUrl", Url.Content(string.Format("~/{0}", companyInfo.Data.LogoFile))));
                }
            }

            return(JsonContentHelper.GetJsonContent(cResult));
        }
        public ActionResult UpdateAboutUs(WebOrderClient webOrderClient)
        {
            webOrderClient.ID = this.GetCurrentOrderClientID();

            var cResult = new OrderClientBLL().UpdateCompanyInfo(webOrderClient);

            if (cResult.Code == 0 && cResult.Data)
            {
                var companyInfo = OrderClientBLL.GetCompanyInfo(this.GetCurrentOrderClientID());

                if (companyInfo.Code == 0)
                {
                    Response.Cookies.Add(new HttpCookie("CompanyName", companyInfo.Data.CompanyName));
                }
            }

            return(JsonContentHelper.GetJsonContent(cResult));
        }
Exemple #7
0
        public ActionResult LogOn(string LoginName, string Pwd)
        {
            //new DatabaseInitHelper().InitDB();
            var errorInfo = "用戶名或密码错误";

            if (ModelState.IsValid)
            {
                var userBLL = new UserBLL();
                var result  = userBLL.VerifyPassword(LoginName, Pwd);
                if (result.Code == 0)
                {
                    Response.Cookies.Add(new HttpCookie("CurrentProjectIDStr", result.Data.ProjectID));
                    Response.Cookies.Add(new HttpCookie("CurrentUserName", result.Data.UserName));
                    Response.Cookies.Add(new HttpCookie("CurrentUserID", result.Data.ID));
                    var roleInt = (int)(result.Data.Role);
                    Response.Cookies.Add(new HttpCookie("CurrentRole", roleInt.ToString()));
                    Response.Cookies.Add(new HttpCookie("OrderClientID", result.Data.OrderClientID));
                    //
                    if (result.Data.Role != 0)
                    {
                        FormsAuthentication.SetAuthCookie(LoginName, false);

                        errorInfo = result.Msg;

                        if (result.Data.Role == RoleType.超级管理员)
                        {
                            Response.Cookies.Add(new HttpCookie("LogoHomeUrl", Url.Action("Index", "OrderClientManager")));

                            Response.Cookies.Add(new HttpCookie("LogoFileUrl", ""));
                            Response.Cookies.Add(new HttpCookie("CompanyName", "运维管理系统"));

                            return(RedirectToAction("Index", "OrderClientManager", new { _timepick = DateTime.Now.ToString("yyyyMMddhhmmssff") }));
                        }
                        else
                        {
                            var companyInfo = OrderClientBLL.GetCompanyInfo(result.Data.OrderClientID);

                            if (companyInfo.Code == 0)
                            {
                                Response.Cookies.Add(new HttpCookie("LogoFileUrl", Url.Content(string.Format("~/{0}", companyInfo.Data.LogoFile))));
                                Response.Cookies.Add(new HttpCookie("CompanyName", companyInfo.Data.CompanyName));
                            }

                            if (result.Data.Role == RoleType.客户管理员)
                            {
                                Response.Cookies.Add(new HttpCookie("LogoHomeUrl", Url.Action("Index", "ProjectManager")));

                                return(RedirectToAction("Index", "ProjectManager", new { _timepick = DateTime.Now.ToString("yyyyMMddhhmmssff") }));
                            }
                            else
                            {
                                Response.Cookies.Add(new HttpCookie("LogoHomeUrl", Url.Action("Index", "Device")));

                                return(RedirectToAction("Index", "Device", new { _timepick = DateTime.Now.ToString("yyyyMMddhhmmssff") }));
                            }
                        }
                    }
                }
            }

            ModelState.AddModelError("", errorInfo);
            return(View());
        }
        public ActionResult GetCompanyInfoJson()
        {
            var result = OrderClientBLL.GetCompanyInfo(this.GetCurrentOrderClientID());

            return(JsonContentHelper.GetJsonContent(result));
        }
        //
        // GET: /AboutUs/

        public ActionResult Index()
        {
            var result = OrderClientBLL.GetCompanyInfo(this.GetCurrentOrderClientID());

            return(View(result.Data));
        }