Beispiel #1
0
        /// <summary>
        /// 编辑项目信息(Projects_Edit页面)
        /// </summary>
        public ActionResult Edit_Projects()
        {
            ProjectsFactory projectsfactory = new ProjectsFactory();
            //获取项目编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IProjectsB projectsb = projectsfactory.GetDataByID(id);
            ProjectsM  projectsm = (projectsb == null ? null : projectsb.Infomation_projects);
            //编辑项目信息
            string projectsname   = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string projectsbelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();

            projectsm.PRName   = projectsname;
            projectsm.PRBelong = projectsbelong;
            projectsfactory.Infomation_projects = projectsm;
            ViewBag.ProjectsInfo = projectsm;
            bool isSuccess = projectsfactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Projects/Projects"));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Beispiel #2
0
        /// <summary>
        /// 添加合同信息(Contract_Add页面)
        /// </summary>
        public ActionResult Add_Contract()
        {
            string          prid            = ViewMethods.GetForm(Request, "PRID");
            ContractFactory contractfactory = new ContractFactory();
            //添加业主信息
            ContractM contractm    = new ContractM();
            string    contractname = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string    ctbelong     = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            string    ctno         = ViewMethods.GetForm(Request, "ctno", CommonEnums.ValueEnum.vlPost).ToString();
            decimal   ctmoney      = ViewMethods.GetForm(Request, "money", CommonEnums.ValueEnum.vlPost).ConvertToDecimal();
            string    contractdate = ViewMethods.GetForm(Request, "time_contract", CommonEnums.ValueEnum.vlPost).ToString();

            bool isExist = contractfactory.IsExist_contractname(contractname);

            if (isExist)
            {
                return(ViewMethods.AlertBack("合同已存在,请重新确认", "-1"));
            }
            contractm.CTName   = contractname;
            contractm.CTBelong = ctbelong;
            contractm.CTNo     = ctno;
            contractm.CTMoney  = ctmoney;
            contractm.CTDate   = contractdate.ConvertToDateTime();
            contractm.CTPrid   = prid.ConvertToInt32();
            contractfactory.Infomation_contract = contractm;
            contractfactory.Save();
            return(ViewMethods.AlertBack("添加合同成功!", "../../Contract/Contract?PRID=" + prid));
        }
Beispiel #3
0
        /// <summary>
        /// 编辑工程量信息(Quantity_Edit页面)
        /// </summary>
        public ActionResult Edit_Quantity()
        {
            QuantityFactory quantityfactory = new QuantityFactory();
            //获取工程量编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IQuantityB quantityb = quantityfactory.GetDataByID(id);
            QuantityM  quantitym = (quantityb == null ? null : quantityb.Infomation_Quantity);
            //编辑工程量信息
            string quantityname   = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string quantitybelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();

            //quantitym.SFName = quantityname;
            //quantitym.SFBelong = quantitybelong;
            quantityfactory.Infomation_quantity = quantitym;
            ViewBag.QuantityInfo = quantitym;
            bool isSuccess = quantityfactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Quantity/Quantity"));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Beispiel #4
0
        /// <summary>
        /// 编辑业主信息(Contract_Edit页面)
        /// </summary>
        public ActionResult Edit_Contract()
        {
            ContractFactory contractfactory = new ContractFactory();
            //获取业主编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IContractB contractb = contractfactory.GetDataByID(id);
            ContractM  contractm = (contractb == null ? null : contractb.Infomation_contract);
            //编辑业主信息
            string contractname   = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string contractbelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();

            contractm.CTName   = contractname;
            contractm.CTBelong = contractbelong;
            contractfactory.Infomation_contract = contractm;
            ViewBag.ContractInfo = contractm;
            bool isSuccess = contractfactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Contract/Contract"));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Beispiel #5
0
        /// <summary>
        /// 编辑收付款信息(Finance_Edit页面)
        /// </summary>
        public ActionResult Edit_Finance()
        {
            FinanceFactory financefactory = new FinanceFactory();
            //获取收付款编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IFinanceB financeb = financefactory.GetDataByID(id);
            FinanceM  financem = (financeb == null ? null : financeb.Infomation_finance);
            //编辑收付款信息
            string financename   = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string financebelong = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();

            //financem.SFName = financename;
            //financem.SFBelong = financebelong;
            financefactory.Infomation_finance = financem;
            ViewBag.FinanceInfo = financem;
            bool isSuccess = financefactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Finance/Finance"));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Beispiel #6
0
        /// <summary>
        /// 编辑客户信息(Clients_Edit页面)
        /// </summary>
        public ActionResult Edit_Clients()
        {
            ClientsFactory clientsfactory = new ClientsFactory();
            //获取客户编号(id)信息
            string id = ViewMethods.GetForm(Request, "ID", CommonEnums.ValueEnum.vlGet).ToString();

            IClientsB clientsb = clientsfactory.GetDataByID(id);
            ClientsM  clientsm = (clientsb == null ? null : clientsb.Infomation_clients);
            //编辑客户信息
            string clientsname    = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string clientsbelong  = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            string clientsperson  = ViewMethods.GetForm(Request, "person", CommonEnums.ValueEnum.vlPost).ToString();
            string clientstel     = ViewMethods.GetForm(Request, "tel", CommonEnums.ValueEnum.vlPost).ToString();
            string clientsaddress = ViewMethods.GetForm(Request, "address", CommonEnums.ValueEnum.vlPost).ToString();
            string clientscode    = ViewMethods.GetForm(Request, "code", CommonEnums.ValueEnum.vlPost).ToString();
            string clientsbank    = ViewMethods.GetForm(Request, "bank", CommonEnums.ValueEnum.vlPost).ToString();
            string clientsaccount = ViewMethods.GetForm(Request, "account", CommonEnums.ValueEnum.vlPost).ToString();
            bool   isExist        = clientsfactory.IsExist_clientsname(clientsname, id);

            if (isExist)
            {
                return(ViewMethods.AlertBack("客户已存在,请重新确认", "-1"));
            }
            if (clientsname == "")
            {
                return(ViewMethods.AlertBack("名称不能为空", "-1"));
            }
            clientsm.CLNAME    = clientsname;
            clientsm.CLBELONG  = clientsbelong.ConvertToInt32();
            clientsm.CLPERSON  = clientsperson;
            clientsm.CLTEL     = clientstel;
            clientsm.CLADDRESS = clientsaddress;
            clientsm.CLCODE    = clientscode;
            clientsm.CLBANK    = clientsbank;
            clientsm.CLACCOUNT = clientsaccount;
            clientsfactory.Infomation_clients = clientsm;
            ViewBag.ClientsInfo = clientsm;
            bool isSuccess = clientsfactory.Update();

            if (isSuccess)
            {
                return(ViewMethods.AlertBack("修改成功", "../../Clients/Clients?BELONG=" + clientsbelong));
            }
            else
            {
                return(ViewMethods.AlertBack("修改失败", "-1"));
            }
        }
Beispiel #7
0
        /// <summary>
        /// 添加项目信息(Projects_Add页面)
        /// </summary>
        public ActionResult Add_Projects()
        {
            ProjectsFactory projectsfactory = new ProjectsFactory();
            //添加业主信息
            ProjectsM projectsm    = new ProjectsM();
            string    projectsname = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string    prbelong     = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            bool      isExist      = projectsfactory.IsExist_projectsname(projectsname);

            if (isExist)
            {
                return(ViewMethods.AlertBack("项目已存在,请重新确认", "-1"));
            }
            projectsm.PRName   = projectsname;
            projectsm.PRBelong = prbelong;
            projectsfactory.Infomation_projects = projectsm;
            projectsfactory.Save();
            return(ViewMethods.AlertBack("添加项目成功!", "../../Projects/Projects"));
        }
Beispiel #8
0
        /// <summary>
        /// 添加收付款信息(Finance_Add页面)
        /// </summary>
        public ActionResult Add_Finance()
        {
            FinanceFactory financefactory = new FinanceFactory();
            //添加业主信息
            FinanceM financem    = new FinanceM();
            string   financename = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string   prbelong    = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            bool     isExist     = financefactory.IsExist_financename(financename);

            if (isExist)
            {
                return(ViewMethods.AlertBack("收付款已存在,请重新确认", "-1"));
            }
            //financem.SFName = financename;
            //financem.SFBelong = prbelong;
            financefactory.Infomation_finance = financem;
            financefactory.Save();
            return(ViewMethods.AlertBack("添加收付款成功!", "../../Finance/Finance"));
        }
Beispiel #9
0
        /// <summary>
        /// 添加工程量信息(Quantity_Add页面)
        /// </summary>
        public ActionResult Add_Quantity()
        {
            QuantityFactory quantityfactory = new QuantityFactory();
            //添加业主信息
            QuantityM quantitym   = new QuantityM();
            string    content     = ViewMethods.GetForm(Request, "content", CommonEnums.ValueEnum.vlPost).ToString();
            string    measurement = ViewMethods.GetForm(Request, "measurement", CommonEnums.ValueEnum.vlPost).ToString();
            decimal   quantity    = ViewMethods.GetForm(Request, "quantity", CommonEnums.ValueEnum.vlPost).ConvertToDecimal();
            decimal   price       = ViewMethods.GetForm(Request, "price", CommonEnums.ValueEnum.vlPost).ConvertToDecimal();
            decimal   money       = ViewMethods.GetForm(Request, "money", CommonEnums.ValueEnum.vlPost).ConvertToDecimal();

            quantitym.QTCONTENT                 = content;
            quantitym.QTMEASUREMENT             = measurement;
            quantitym.QTQUANTITY                = quantity;
            quantitym.QTPRICE                   = price;
            quantitym.QTMONEY                   = money;
            quantityfactory.Infomation_quantity = quantitym;
            quantityfactory.Save();
            return(ViewMethods.AlertBack("添加工程量成功!", "../../Quantity/Quantity"));
        }
Beispiel #10
0
        /// <summary>
        /// 添加客户信息(Clients_Add页面)
        /// </summary>
        public ActionResult Add_Clients()
        {
            string         id             = "";
            ClientsFactory clientsfactory = new ClientsFactory();
            //添加客户信息
            ClientsM clientsm       = new ClientsM();
            string   clientsname    = ViewMethods.GetForm(Request, "name", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientsbelong  = ViewMethods.GetForm(Request, "belong", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientsperson  = ViewMethods.GetForm(Request, "person", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientstel     = ViewMethods.GetForm(Request, "tel", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientsaddress = ViewMethods.GetForm(Request, "address", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientscode    = ViewMethods.GetForm(Request, "code", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientsbank    = ViewMethods.GetForm(Request, "bank", CommonEnums.ValueEnum.vlPost).ToString();
            string   clientsaccount = ViewMethods.GetForm(Request, "account", CommonEnums.ValueEnum.vlPost).ToString();
            bool     isExist        = clientsfactory.IsExist_clientsname(clientsname, id);

            if (isExist)
            {
                return(ViewMethods.AlertBack("客户已存在,请重新确认", "-1"));
            }
            if (clientsname == "")
            {
                return(ViewMethods.AlertBack("名称不能为空", "-1"));
            }
            clientsm.CLNAME    = clientsname;
            clientsm.CLBELONG  = clientsbelong.ConvertToInt32();
            clientsm.CLPERSON  = clientsperson;
            clientsm.CLTEL     = clientstel;
            clientsm.CLADDRESS = clientsaddress;
            clientsm.CLCODE    = clientscode;
            clientsm.CLBANK    = clientsbank;
            clientsm.CLACCOUNT = clientsaccount;

            clientsfactory.Infomation_clients = clientsm;
            clientsfactory.Save();
            return(ViewMethods.AlertBack("添加客户成功!", "../../Clients/Clients?BELONG=" + clientsbelong));
        }