Exemplo n.º 1
0
        public JsonResult SaveProject(string guid = "")
        {
            string   projectCode           = Request["projectCode"].ToString();
            string   projectName           = Request["projectName"].ToString();
            string   customerGuid          = Request["customerGuid"].ToString();
            string   contactGuid           = Request["contactGuid"].ToString();
            DateTime createDate            = Convert.ToDateTime(Request["createDate"]);
            DateTime estimatedDeliveryDate = Convert.ToDateTime(Request["estimatedDeliveryDate"]);
            string   personInCharge        = Request["personInCharge"].ToString();

            if (string.IsNullOrWhiteSpace(guid))
            {
                User currentUser = (User)Session["currentUser"];
                _projectFactory.AddProject(projectCode, projectName, customerGuid, contactGuid, createDate, estimatedDeliveryDate, personInCharge, "", currentUser.GUID);
            }
            else
            {
                var project = _projectFactory.GetProject(guid);
                project.ProjectCode           = projectCode;
                project.ProjectName           = projectName;
                project.CustomerGuid          = customerGuid;
                project.ContactGuid           = contactGuid;
                project.CreateDate            = createDate;
                project.EstimatedDeliveryDate = estimatedDeliveryDate;
                project.PersonInCharge        = personInCharge;
                _projectFactory.SaveProject(project);
            }
            return(Json(new { result = 1 }));
        }
Exemplo n.º 2
0
        public JsonResult SaveProject()
        {
            string   projectCode           = Request["projectCode"].ToString();
            string   projectName           = Request["projectName"].ToString();
            string   customerGuid          = Request["customerGuid"].ToString();
            string   contactGuid           = Request["contactGuid"].ToString();
            DateTime createDate            = Convert.ToDateTime(Request["createDate"]);
            DateTime estimatedDeliveryDate = Convert.ToDateTime(Request["estimatedDeliveryDate"]);
            string   personInCharge        = Request["personInCharge"].ToString();

            User currentUser = (User)Session["currentUser"];

            _projectFactory.AddProject(projectCode, projectName, customerGuid, contactGuid, createDate, estimatedDeliveryDate, personInCharge, "", currentUser.GUID);
            return(Json(new { result = 1 }));
        }