/// <summary> /// 获取公司订单总金额 /// </summary> /// <param name="fathrtId"></param> /// <returns></returns> public decimal GetFathrtMoney(int fathrtId) { decimal money = 0; BLL.OrdeDistribution bllDistrbution = new BLL.OrdeDistribution(); BLL.SonOrder bllSonOrder = new BLL.SonOrder(); DataSet dsDistubution = bllDistrbution.GetList("OrderId=" + fathrtId); DataSet dsSonOrder = bllSonOrder.GetList("FatherOrderId=" + fathrtId); if (dsSonOrder.Tables[0].Rows.Count > 0) { foreach (DataRow item in dsSonOrder.Tables[0].Rows) { money += GetSonOrderMoney(int.Parse(item["Id"].ToString())); } if (dsDistubution.Tables[0].Rows.Count > 0) { money += decimal.Parse(dsDistubution.Tables[0].Rows[0]["Price"].ToString()); } } return(money); }
/// <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); }