Ejemplo n.º 1
0
        /// <summary>
        /// 从IDataReader创建StoreShipFeeInfo
        /// </summary>
        public static StoreShipFeeInfo BuildStoreShipFeeFromReader(IDataReader reader)
        {
            StoreShipFeeInfo storeShipFeeInfo = new StoreShipFeeInfo();

            storeShipFeeInfo.RecordId = TypeHelper.ObjectToInt(reader["recordid"]);
            storeShipFeeInfo.StoreSTid = TypeHelper.ObjectToInt(reader["storestid"]);
            storeShipFeeInfo.RegionId = TypeHelper.ObjectToInt(reader["regionid"]);
            storeShipFeeInfo.StartValue = TypeHelper.ObjectToInt(reader["startvalue"]);
            storeShipFeeInfo.StartFee = TypeHelper.ObjectToInt(reader["startfee"]);
            storeShipFeeInfo.AddValue = TypeHelper.ObjectToInt(reader["addvalue"]);
            storeShipFeeInfo.AddFee = TypeHelper.ObjectToInt(reader["addfee"]);

            return storeShipFeeInfo;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新店铺配送费用
 /// </summary>
 /// <param name="storeShipFeeInfo">店铺配送费用信息</param>
 public static void UpdateStoreShipFee(StoreShipFeeInfo storeShipFeeInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateStoreShipFee(storeShipFeeInfo);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新店铺配送费用
 /// </summary>
 /// <param name="storeShipFeeInfo">店铺配送费用信息</param>
 public static void UpdateStoreShipFee(StoreShipFeeInfo storeShipFeeInfo)
 {
     BrnMall.Data.Stores.UpdateStoreShipFee(storeShipFeeInfo);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 更新店铺配送费用
 /// </summary>
 /// <param name="storeShipFeeInfo">店铺配送费用信息</param>
 public void UpdateStoreShipFee(StoreShipFeeInfo storeShipFeeInfo)
 {
     DbParameter[] parms = {
                                 GenerateInParam("@storestid", SqlDbType.Int,4, storeShipFeeInfo.StoreSTid),
                                 GenerateInParam("@regionid", SqlDbType.Int,4, storeShipFeeInfo.RegionId),
                                 GenerateInParam("@startvalue", SqlDbType.Int,4, storeShipFeeInfo.StartValue),
                                 GenerateInParam("@startfee", SqlDbType.Int,4, storeShipFeeInfo.StartFee),
                                 GenerateInParam("@addvalue", SqlDbType.Int,4, storeShipFeeInfo.AddValue),
                                 GenerateInParam("@addfee", SqlDbType.Int,4, storeShipFeeInfo.AddFee),
                                 GenerateInParam("@recordid", SqlDbType.Int,4, storeShipFeeInfo.RecordId)
                             };
     string commandText = string.Format("UPDATE [{0}storeshipfees] SET [storestid]=@storestid,[regionid]=@regionid,[startvalue]=@startvalue,[startfee]=@startfee,[addvalue]=@addvalue,[addfee]=@addfee WHERE [recordid]=@recordid",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 创建店铺配送费用
 /// </summary>
 /// <param name="storeShipFeeInfo">店铺配送费用信息</param>
 public void CreateStoreShipFee(StoreShipFeeInfo storeShipFeeInfo)
 {
     DbParameter[] parms = {
                                 GenerateInParam("@storestid", SqlDbType.Int,4, storeShipFeeInfo.StoreSTid),
                                 GenerateInParam("@regionid", SqlDbType.Int,4, storeShipFeeInfo.RegionId),
                                 GenerateInParam("@startvalue", SqlDbType.Int,4, storeShipFeeInfo.StartValue),
                                 GenerateInParam("@startfee", SqlDbType.Int,4, storeShipFeeInfo.StartFee),
                                 GenerateInParam("@addvalue", SqlDbType.Int,4, storeShipFeeInfo.AddValue),
                                 GenerateInParam("@addfee", SqlDbType.Int,4, storeShipFeeInfo.AddFee)
                             };
     string commandText = string.Format("INSERT INTO [{0}storeshipfees]([storestid],[regionid],[startvalue],[startfee],[addvalue],[addfee]) VALUES(@storestid,@regionid,@startvalue,@startfee,@addvalue,@addfee)",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
Ejemplo n.º 6
0
        public ActionResult AddStoreShipFee(StoreShipFeeModel model, int storeSTid = -1)
        {
            StoreShipTemplateInfo storeShipTemplateInfo = AdminStores.GetStoreShipTemplateById(storeSTid);
            if (storeShipTemplateInfo == null)
                return PromptView("店铺配送模板不存在");
            if (storeShipTemplateInfo.StoreId != WorkContext.StoreId)
                return PromptView("不能操作其它店铺的配送模板");

            if (ModelState.IsValid)
            {
                StoreShipFeeInfo storeShipFeeInfo = new StoreShipFeeInfo()
                {
                    StoreSTid = storeSTid,
                    RegionId = model.RegionId,
                    StartValue = model.StartValue,
                    StartFee = model.StartFee,
                    AddValue = model.AddValue,
                    AddFee = model.AddFee
                };
                AdminStores.CreateStoreShipFee(storeShipFeeInfo);
                AddStoreAdminLog("添加店铺配送费用", "添加店铺配送费用");
                return PromptView("店铺配送费用添加成功");
            }
            LoadStoreShipFee(model.RegionId);
            return View(model);
        }
Ejemplo n.º 7
0
        public ActionResult AddStoreShipTemplate(AddStoreShipTemplateModel model)
        {
            if (ModelState.IsValid)
            {
                StoreShipTemplateInfo storeShipTemplateInfo = new StoreShipTemplateInfo()
                {
                    StoreId = WorkContext.StoreId,
                    Title = model.TemplateTitle,
                    Free = model.Free,
                    Type = model.Type
                };

                int storeSTid = AdminStores.CreateStoreShipTemplate(storeShipTemplateInfo);
                if (storeSTid > 0)
                {
                    StoreShipFeeInfo storeShipFeeInfo = new StoreShipFeeInfo()
                    {
                        StoreSTid = storeSTid,
                        RegionId = -1,
                        StartValue = model.StartValue,
                        StartFee = model.StartFee,
                        AddValue = model.AddValue,
                        AddFee = model.AddFee
                    };
                    AdminStores.CreateStoreShipFee(storeShipFeeInfo);
                    AddStoreAdminLog("添加店铺配送模板", "添加店铺配送模板,店铺配送模板为:" + model.TemplateTitle);
                    return PromptView("店铺配送模板添加成功");
                }
                else
                {
                    return PromptView("店铺配送模板添加失败");
                }
            }
            ViewData["referer"] = MallUtils.GetStoreAdminRefererCookie();
            return View(model);
        }