コード例 #1
0
ファイル: edit.aspx.cs プロジェクト: yilin1991/LeadinOA
        /// <summary>
        /// 添加订单配送信息
        /// </summary>
        /// <param name="fathrtid">公司订单编号</param>
        void AddDistribution(int fathrtid)
        {
            Model.OrdeDistribution model = new Model.OrdeDistribution();
            model.OrderId   = fathrtid;
            model.PriceType = int.Parse(ddlPriceType.SelectedValue);
            model.TypeId    = int.Parse(ddlDelivery.SelectedValue);
            model.WorkersId = int.Parse(Session["AdminId"].ToString());
            model.Price     = 0;
            switch (ddlType.SelectedValue)
            {
            case "10018":    //公司配送
                if (!string.IsNullOrEmpty(ddlDeliverystaff.SelectedValue))
                {
                    model.WorkersId = int.Parse(ddlDeliverystaff.SelectedValue);
                }
                break;

            case "10019":    //快递信息
                if (!string.IsNullOrEmpty(ddlDeliverystaff.SelectedValue))
                {
                    model.DistributionId = int.Parse(ddlDeliverystaff.SelectedValue);
                    Model.Distribution modelDis = bllDistribution.GetModel(int.Parse(ddlDeliverystaff.SelectedValue));
                    model.Price = modelDis.Price;
                }
                break;
            }


            bllOrderDistribution.Add(model);
        }
コード例 #2
0
ファイル: editfathrt.aspx.cs プロジェクト: yilin1991/LeadinOA
        /// <summary>
        /// 添加订单配送信息
        /// </summary>
        /// <param name="fathrtid">公司订单编号</param>
        void AddDistribution(int fathrtid)
        {
            bool isEdit = false;

            Model.OrdeDistribution model = new Model.OrdeDistribution();
            DataSet ds = bllOrderDistribution.GetList("OrderId=" + fathrtid);

            if (ds.Tables[0].Rows.Count > 0)
            {
                isEdit = true;
                model  = bllOrderDistribution.GetModel(int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()));
            }
            model.OrderId         = fathrtid;
            model.PriceType       = int.Parse(ddlPriceType.SelectedValue);
            model.TypeId          = int.Parse(ddlDelivery.SelectedValue);
            model.DistributionNum = txtDeliveryNum.Text;
            model.Price           = 0;
            switch (ddlDelivery.SelectedValue)
            {
            case "10018":    //公司配送
                if (!string.IsNullOrEmpty(Request.Form["ddlDeliverystaff"]))
                {
                    model.WorkersId = int.Parse(Request.Form["ddlDeliverystaff"]);
                }
                break;

            case "10019":    //快递信息
                if (!string.IsNullOrEmpty(Request.Form["ddlDeliverystaff"]))
                {
                    model.DistributionId = int.Parse(Request.Form["ddlDeliverystaff"]);
                    Model.Distribution modelDis = bllDistribution.GetModel(int.Parse(Request.Form["ddlDeliverystaff"]));
                    if (ddlPriceType.SelectedValue == "0")
                    {
                        model.Price = modelDis.Price;
                    }
                }
                break;
            }

            if (isEdit)
            {
                bllOrderDistribution.Update(model);
            }
            else
            {
                bllOrderDistribution.Add(model);
            }
        }