예제 #1
0
        /// <summary>
        /// 获取子订单费用
        /// </summary>
        /// <param name="sonId"></param>
        /// <returns></returns>
        public decimal GetSonOrderMoney(int sonId)
        {
            BLL.SonOrder       bllSonorder   = new BLL.SonOrder();
            BLL.Paper          bllPaper      = new BLL.Paper();
            BLL.OrdeTechnology bllTechnology = new BLL.OrdeTechnology();


            decimal money = 0;

            Model.SonOrder modelOrder = bllSonorder.GetModel(sonId);

            Model.Paper modelPaper = bllPaper.GetModel(int.Parse(modelOrder.PaperId.ToString()));

            DataSet ds = bllTechnology.GetList("SonOrderId=" + sonId);


            foreach (DataRow item in ds.Tables[0].Rows)
            {
                money += decimal.Parse(item["Price"].ToString());
            }

            money += modelOrder.DifferencePrice;
            money += modelPaper.Price;
            return(money);
        }
예제 #2
0
        void BindDetail(int sonid)
        {
            Model.SonOrder model = bllSonOrder.GetModel(sonid);

            DataSet ds = bllPublicversion.GetList("StateInfo=1 and Num>0 and CustomerId=" + model.CustomerID);

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                ddlPublicversion.Items.Add(new ListItem(item["NameInfo"].ToString(), item["Id"].ToString()));
            }

            txtDifferencePrice.Text  = model.DifferencePrice.ToString("0.00");
            txtDifferenceReason.Text = model.DifferenceReason;
            txtExplain.Text          = model.Explain;
            txtFileName.Text         = model.Remark;
            txtNum.Text = model.Num.ToString("0.0");
            ddlCustomer.SelectedValue      = model.CustomerID.ToString();
            ddlPaper.SelectedValue         = model.PaperId.ToString();
            ddlPublicversion.SelectedValue = model.PublicVersionId.ToString();
            ddlType.SelectedValue          = model.TypeId.ToString();


            for (int i = 0; i < repTechnology.Items.Count; i++)
            {
                Repeater repSubTechnology = repTechnology.Items[i].FindControl("repSubTechnology") as Repeater;

                for (int j = 0; j < repSubTechnology.Items.Count; j++)
                {
                    HiddenField hidsubId = repSubTechnology.Items[j].FindControl("hidsubId") as HiddenField;

                    if (bllOrderTechnology.GetRecordCount("TechnologyId=" + hidsubId.Value + " and SonOrderId=" + sonid) > 0)
                    {
                        CheckBox ckTechnology = repSubTechnology.Items[j].FindControl("ckTechnology") as CheckBox;

                        ckTechnology.Checked = true;
                    }
                }
            }
        }
예제 #3
0
        /// <summary>
        /// 添加客户订单
        /// </summary>
        /// <param name="fathrtId"></param>
        /// <returns></returns>
        int AddSonOrder(int fathrtId)
        {
            Model.SonOrder model = new Model.SonOrder();
            model.AddTime          = DateTime.Now;
            model.DifferencePrice  = decimal.Parse(txtDifferencePrice.Text);
            model.DifferenceReason = txtDifferenceReason.Text;
            model.Explain          = txtExplain.Text;
            model.FatherOrderId    = fathrtId;
            model.Num        = decimal.Parse(txtNum.Text);
            model.NumId      = SetSonNumID(fathrtId);
            model.PaperId    = int.Parse(ddlPaper.SelectedValue);
            model.CustomerID = int.Parse(ddlCustomer.SelectedValue);
            if (!string.IsNullOrEmpty(ddlPublicversion.SelectedValue))
            {
                model.PublicVersionId = int.Parse(ddlPublicversion.SelectedValue);
            }
            model.StateInfo = 10022;
            model.TypeId    = int.Parse(ddlType.SelectedValue);
            model.WorkersId = int.Parse(Session["AdminId"].ToString());


            return(bllSonOrder.Add(model));
        }
예제 #4
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            int  fathrtId = int.Parse(Request.Params["fid"]);
            bool isEdit   = false;

            Model.SonOrder model = new Model.SonOrder();

            if (int.TryParse(Request.Params["sid"], out sid))
            {
                isEdit = true;
                model  = bllSonOrder.GetModel(sid);
            }
            else
            {
                model.NumId = SetSonNumID(fathrtId);
            }
            model.AddTime          = DateTime.Now;
            model.DifferencePrice  = decimal.Parse(txtDifferencePrice.Text);
            model.DifferenceReason = txtDifferenceReason.Text;
            model.Explain          = txtExplain.Text;
            model.FatherOrderId    = fathrtId;
            model.Num        = decimal.Parse(txtNum.Text);
            model.PaperId    = int.Parse(ddlPaper.SelectedValue);
            model.CustomerID = int.Parse(ddlCustomer.SelectedValue);
            if (!string.IsNullOrEmpty(Request.Form["ddlPublicversion"]))
            {
                model.PublicVersionId = int.Parse(Request.Form["ddlPublicversion"]);
            }
            model.StateInfo = 10022;
            model.TypeId    = int.Parse(ddlType.SelectedValue);
            model.WorkersId = int.Parse(Session["AdminId"].ToString());
            model.Remark    = txtFileName.Text;

            if (isEdit)
            {
                if (bllSonOrder.Update(model))
                {
                    DataSet ds = bllOrderTechnology.GetList("SonOrderId=" + sid);

                    foreach (DataRow item in ds.Tables[0].Rows)
                    {
                        bllOrderTechnology.Delete(int.Parse(item["Id"].ToString()));
                    }

                    AddTechnology(sid);

                    JsMessage("客户订单信息修改成功", 2000, "true", "sonindex.aspx" + Request.Url.Query);
                }
                else
                {
                    JsMessage("客户订单信息修改失败", 2000, "false");
                }
            }
            else
            {
                sid = bllSonOrder.Add(model);

                if (sid > 0)
                {
                    AddTechnology(sid);

                    JsMessage("客户订单信息添加成功", 2000, "true", "sonindex.aspx" + Request.Url.Query);
                }
                else
                {
                    JsMessage("客户订单信息添加失败", 2000, "false");
                }
            }
        }