public DataSet GetModelListByid(string p)
        {
            var ds = dal.GetModelListByid(p);
            if (ds != null && ds.Tables.Count > 0)
            {
                var stList = new ShipTypeBase().GetModelList(" st_IsDel = 0 ");
                ds.Tables[0].Columns.Add("st_Name", Type.GetType("System.String"));
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    var shipt = new BLL.ShipTypeBase().GetModelList(" st_ID='" +row["st_Id"].ToString()+ "' and st_IsDel=0 ");
                    if (shipt.Count > 0)
                    {
                        var st = stList.Where(m => m.st_ID == shipt[0].st_ID).FirstOrDefault();

                    if (st != null)
                    {
                        row["st_Name"] = st.st_Name;
                    }
                    }
                }
            }
            return ds;
        }
        public ActionResult successOrder()
        {
            //获取订单ID或者编号
            int id = 0;// Convert.ToInt32(RequestBase.GetString("id"));
            if (!string.IsNullOrWhiteSpace(RequestBase.GetString("id")))
            {
                id = Convert.ToInt32(RequestBase.GetString("id"));
            }
            else
            {
                return View();
            }

            BLL.OrderBase order = new BLL.OrderBase();
            var model = order.GetModel(id);
            var shipType = new BLL.ShipTypeBase().GetModel(model.st_ID.Value);
            ViewData["shipTypeName"] = shipType.st_Name;
            ViewData["OrderCode"] = model.o_Code;
            ViewData["OrderPrice"] = model.o_Pric;
            return View();
        }
        public ActionResult CarriageEdit()
        {
            this.ViewData["texOtype"] = RequestBase.GetString("otype");
            ViewData["IsHasFunRole"] = _roleManager.IsHasFunRole(EmployeeBase.e_ID, "001002001"); //是否拥有管理的权限

            string pids = RequestBase.GetString("dli_id");//1/43
            ViewData["hfPId"] = pids;
            BLL.ShipTypeBase pstbll = new BLL.ShipTypeBase();
            List<Model.ShipTypeBase> stmodel = pstbll.GetModelList(" st_IsDel = 0 and st_StatusCode=0 ");
            List<SelectListItem> shipType = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "chose" } };
            for (int i = 0; i < stmodel.Count; i++)
            {
                shipType.Add(new SelectListItem
                {
                    Value = stmodel[i].st_ID.ToString(),
                    Text = stmodel[i].st_Name
                });
            }
            ViewData["shipType"] = new SelectList(shipType, "Value", "Text");

            Model.CarriageTempleteBase pctmodel = pctbll.GetModel(int.Parse(pids.Split('|')[0]));
            int? units = pctmodel.ct_ValuationType;
            List<SelectListItem> measurementUnits = new List<SelectListItem> { new SelectListItem { Text = "请选择", Value = "0" }, new SelectListItem { Text = "件", Value = "1" }, new SelectListItem { Text = "千克", Value = "2" }, new SelectListItem { Text = "立方米", Value = "3" } };
            ViewData["measurementUnits"] = new SelectList(measurementUnits, "Value", "Text",units.ToString());
            ViewData["measurementUnits2"] = new SelectList(measurementUnits, "Value", "Text",units.ToString());
            if (RequestBase.GetString("otype") == "modify")//编辑
            {
                string ids = RequestBase.GetString("dli_id");//模板ID|运费ID
                string id = ids.Split('|')[1];//运费ID
                string ctid = ids.Split('|')[0];//模板ID
                int ptid = int.Parse(id);
                cmodel = pcbll.GetModel(ptid);
                ViewData["shipType"] = new SelectList(shipType, "Value", "Text", cmodel.St_ID);
                ViewData["measurementUnits"] = new SelectList(measurementUnits, "Value", "Text", cmodel.car_measurementUnits.ToString());
                ViewData["hfPId"] = ids;
                string regname = "";
                if (!string.IsNullOrEmpty(RequestBase.GetString("list")))
                {
                    string regID = RequestBase.GetString("list");
                    if (regID.Length > 0)
                    {
                        regID = regID.Substring(0, regID.Length - 1);
                        var reg = regbll.GetModelList(" reg_ID in(" + regID + ")");
                        foreach (var item in reg)
                        {
                            regname += item.reg_Name + ",";
                        }
                        if (regname.Length > 0)
                            regname = regname.Substring(0, regname.Length - 1);
                        reg_list = regID;
                    }
                    ViewData["reglist"] = RequestBase.GetString("list").Substring(0, RequestBase.GetString("list").Length-1);
                    ViewData["regName"] = regname;
                }
                else
                {
                    ViewData["reglist"] = cmodel.car_area;
                    if (cmodel.car_area != "all" && cmodel.car_area != null)
                    {
                        var reg = regbll.GetModelList(" reg_ID in(" + cmodel.car_area + ")");
                        foreach (var item in reg)
                        {
                            regname += item.reg_Name + ",";
                        }
                        if (regname.Length > 0)
                            regname = regname.Substring(0, regname.Length - 1);
                    }
                    else
                    {
                        regname = "全国";
                    }
                    ViewData["regName"] = regname;
                }
                ViewData["shipType"] = new SelectList(shipType, "Value", "Text", cmodel.St_ID);
                return View(cmodel);
            }
            else//添加
            {
                if (!string.IsNullOrEmpty(RequestBase.GetString("list")))
                {
                    string regID = RequestBase.GetString("list");
                        string regname = "";
                    if (regID.Length > 0)
                    {
                        regID = regID.Substring(0, regID.Length - 1);
                        var reg = regbll.GetModelList(" reg_ID in(" + regID + ")");
                        foreach (var item in reg)
                        {
                            regname += item.reg_Name+",";
                        }
                        if(regname.Length>0)
                        regname = regname.Substring(0, regname.Length - 1);
                    }
                    ViewData["reglist"] = RequestBase.GetString("list");
                    ViewData["regName"] = regname;
                }
                else
                {
                    ViewData["reglist"] = "";
                    ViewData["regName"] = "";
                }
                return View();
            }
        }
 /// <summary>
 /// 加载配送方式
 /// </summary>
 public object GetShipType()
 {
     BLL.ShipTypeBase shipType = new BLL.ShipTypeBase();
     var list = shipType.GetModelList(" st_StatusCode = 0 and st_IsDel = 0");
     ViewData["ShipTypeList"] = list;
     return ViewData["ShipTypeList"];
 }