/// <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); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; JsonData jd = new JsonData(); StringBuilder strDelivery = new StringBuilder(); string did = context.Request["did"].ToString(); if (string.Equals(did, "10018"))//公司配送 { strDelivery.Append("<option value=''>请选择配送人员</option>"); BLL.Workers bll = new BLL.Workers(); DataSet ds = bll.GetList("StateInfo=1 and TypeId=10027"); foreach (DataRow item in ds.Tables[0].Rows) { strDelivery.Append("<option value='" + item["Id"].ToString() + "'>" + item["NameInfo"].ToString() + "</option>"); } } if (string.Equals(did, "10019"))//快递配送 { strDelivery.Append("<option value=''>请选择快递公司</option>"); BLL.Distribution bll = new BLL.Distribution(); DataSet ds = bll.GetList("StateInfo=1"); foreach (DataRow item in ds.Tables[0].Rows) { strDelivery.Append("<option value='" + item["Id"].ToString() + "'>" + item["CompanyName"].ToString() + "</option>"); } } jd["Id"] = 1; jd["strDelivery"] = strDelivery.ToString(); context.Response.Write(jd.ToJson()); }
/// <summary> /// 绑定配送人信息 /// </summary> void BindDeliverystaff(int typeId) { switch (typeId) { case 10018: //公司配送 BLL.Workers bllWorker = new BLL.Workers(); DataSet ds = bllWorker.GetList("StateInfo=1 and TypeId=10027"); foreach (DataRow item in ds.Tables[0].Rows) { ddlDeliverystaff.Items.Add(new ListItem(item["NameInfo"].ToString(), item["Id"].ToString())); } break; case 10019: //快递配送 BLL.Distribution bllDistribution = new BLL.Distribution(); DataSet dsDistribution = bllDistribution.GetList("StateInfo=1"); foreach (DataRow item in dsDistribution.Tables[0].Rows) { ddlDeliverystaff.Items.Add(new ListItem(item["CompanyName"].ToString(), item["Id"].ToString())); } break; } }