Exemplo n.º 1
0
        private bool DoEdit(string _review, int _id)
        {
            Model.manager manager = GetAdminInfo();

            bool result = true;

            Model.job_order model = new Model.job_order();
            BLL.job_order   bll   = new BLL.job_order();

            model.job_order_id          = _id;
            model.job_order_name        = txtJobOrderName.Text.Trim();
            model.job_order_type        = ddlJobOrderType.SelectedIndex;
            model.job_order_discripe    = txtJobOrderDescript.Text.Trim();
            model.contract_id           = txtContractId.Text.Trim();
            model.salesman_id           = txtSalesman.Text.Trim();
            model.job_order_begintime   = DateTime.Parse(txtBeginDate.Text.Trim());
            model.job_order_endtime     = DateTime.Parse(txtEndDate.Text.Trim());
            model.technical_respon_id   = txtTechnicalResId.Text.Trim();
            model.job_order_reviewer_id = txtReviewerId.Text.Trim();
            model.job_order_status      = _review;
            model.job_order_create_time = DateTime.Now;
            model.job_order_creator_id  = manager.user_name;
            model.job_order_advice      = txtReviewAdvice.Text.Trim();

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool DoEdit(int _id)
        {
            Model.manager manager = GetAdminInfo();

            bool result = true;

            Model.job_order model = new Model.job_order();
            BLL.job_order   bll   = new BLL.job_order();

            model.job_order_id          = _id;
            model.job_order_name        = txtJobOrderName.Text.Trim();
            model.job_order_type        = ddlJobOrderType.SelectedIndex;
            model.job_order_discripe    = txtJobOrderDescript.Text.Trim();
            model.contract_id           = txtContractId.Text.Trim();
            model.salesman_id           = hidSalesman.Value.Trim();
            model.job_order_begintime   = DateTime.Parse(txtBeginDate.Text.Trim());
            model.job_order_endtime     = DateTime.Parse(txtEndDate.Text.Trim());
            model.technical_respon_id   = hidTechnicalResId.Value.Trim();
            model.job_order_reviewer_id = hidReviewerId.Value.Trim();
            model.job_order_status      = "未审核";
            //model.job_order_create_time = DateTime.Now;
            model.job_order_creator_id = manager.user_name;
            //model.job_order_relevant = hidRelevant.Value.Trim();

            model.customer_id      = int.Parse(hidCustomer.Value.Trim());
            model.job_order_advice = "";

            string strRelevant = hidRelevant.Value.Trim();

            if (!string.IsNullOrEmpty(strRelevant))
            {
                try
                {
                    string[] relevantArr = strRelevant.Split(';');
                    List <DTcms.Model.job_order_relevant> ls = new List <Model.job_order_relevant>();
                    for (int i = 0; i < relevantArr.Length; i++)
                    {
                        ls.Add(new DTcms.Model.job_order_relevant {
                            relevant_id = relevantArr[i]
                        });
                    }
                    model.job_order_relevant = ls;
                }
                catch
                {
                    result = false;
                }
            }

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }