/// <summary> /// 绑定合作快递详细信息 /// </summary> /// <param name="id"></param> void BindDetail(int id) { model = bll.GetModel(id); txtCompanyName.Text = model.CompanyName; txtNameInfo.Text = model.NameInfo; txtPhone.Text = model.ContactTel; txtPrice.Text = ((decimal)model.Price).ToString("0.00"); txtSortNum.Text = model.SortNum.ToString(); ckState.Checked = model.StateInfo == 1 ? true : false; }
/// <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); }
/// <summary> /// 获取配送信息 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public string[] GetDisDistribution(int orderId) { BLL.OrdeDistribution bll = new BLL.OrdeDistribution(); BLL.Workers bllWorkers = new BLL.Workers(); BLL.Distribution bllDistribution = new BLL.Distribution(); string[] strDis = new string[4]; DataSet ds = bll.GetList("OrderId=" + orderId); if (ds.Tables[0].Rows.Count > 0) { strDis[0] = GetCategoryName(int.Parse(ds.Tables[0].Rows[0]["TypeId"].ToString())); if (ds.Tables[0].Rows[0]["TypeId"].ToString() == "10018")//公司配送 { if (ds.Tables[0].Rows[0]["WorkersId"].ToString() == "") { strDis[1] = "--"; } else { strDis[1] = bllWorkers.GetModel(int.Parse(ds.Tables[0].Rows[0]["WorkersId"].ToString())).NameInfo; } } else if (ds.Tables[0].Rows[0]["TypeId"].ToString() == "10019")//快递配送 { if (ds.Tables[0].Rows[0]["DistributionId"].ToString() == "") { strDis[1] = "--"; } else { strDis[1] = bllDistribution.GetModel(int.Parse(ds.Tables[0].Rows[0]["DistributionId"].ToString())).CompanyName; } } else { strDis[1] = "--"; } strDis[2] = ds.Tables[0].Rows[0]["DistributionNum"].ToString() == "" ? "--" : ds.Tables[0].Rows[0]["DistributionNum"].ToString(); strDis[3] = ds.Tables[0].Rows[0]["PriceType"].ToString() == "1" ? "非到付" : "到付"; } else { strDis[0] = "--"; //配送类型 strDis[1] = "--"; //配送人 strDis[2] = "--"; //快递单号 strDis[3] = "--"; //快递费用 } return(strDis); }
/// <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); } }