コード例 #1
0
ファイル: AdminStores.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 创建店铺
 /// </summary>
 /// <param name="storeInfo">店铺信息</param>
 /// <param name="storeKeeperInfo">店主信息</param>
 /// <returns>店铺id</returns>
 public static int CreateStore(StoreInfo storeInfo, StoreKeeperInfo storeKeeperInfo)
 {
     int storeId = BrnMall.Data.Stores.CreateStore(storeInfo);
     if (storeId > 0)
     {
         storeKeeperInfo.StoreId = storeId;
         CreateStoreKeeper(storeKeeperInfo);
     }
     return storeId;
 }
コード例 #2
0
ファイル: Stores.cs プロジェクト: qq550723504/zone
        /// <summary>
        /// 从IDataReader创建StoreKeeperInfo
        /// </summary>
        public static StoreKeeperInfo BuildStoreKeeperFromReader(IDataReader reader)
        {
            StoreKeeperInfo storeKeeperInfo = new StoreKeeperInfo();

            storeKeeperInfo.StoreId = TypeHelper.ObjectToInt(reader["storeid"]);
            storeKeeperInfo.Type = TypeHelper.ObjectToInt(reader["type"]);
            storeKeeperInfo.Name = reader["name"].ToString();
            storeKeeperInfo.IdCard = reader["idcard"].ToString();
            storeKeeperInfo.Address = reader["address"].ToString();

            return storeKeeperInfo;
        }
コード例 #3
0
ファイル: Stores.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 更新店长
 /// </summary>
 /// <param name="storeKeeperInfo">店长信息</param>
 public static void UpdateStoreKeeper(StoreKeeperInfo storeKeeperInfo)
 {
     BrnMall.Core.BMAData.RDBS.UpdateStoreKeeper(storeKeeperInfo);
     if (_storenosql != null)
         _storenosql.UpdateStoreKeeper(storeKeeperInfo);
 }
コード例 #4
0
ファイル: Stores.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 创建店长
 /// </summary>
 /// <param name="storeKeeperInfo">店长信息</param>
 public static void CreateStoreKeeper(StoreKeeperInfo storeKeeperInfo)
 {
     BrnMall.Core.BMAData.RDBS.CreateStoreKeeper(storeKeeperInfo);
 }
コード例 #5
0
ファイル: AdminStores.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 更新店长
 /// </summary>
 /// <param name="storeKeeperInfo">店长信息</param>
 public static void UpdateStoreKeeper(StoreKeeperInfo storeKeeperInfo)
 {
     BrnMall.Data.Stores.UpdateStoreKeeper(storeKeeperInfo);
 }
コード例 #6
0
ファイル: StoreStrategy.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 更新店长
 /// </summary>
 /// <param name="storeKeeperInfo">店长信息</param>
 public void UpdateStoreKeeper(StoreKeeperInfo storeKeeperInfo)
 {
     DbParameter[] parms = {
                                 GenerateInParam("@storeid", SqlDbType.Int,4,storeKeeperInfo.StoreId),
                                 GenerateInParam("@type", SqlDbType.TinyInt,1,storeKeeperInfo.Type),
                                 GenerateInParam("@name", SqlDbType.NVarChar, 100, storeKeeperInfo.Name),
                                 GenerateInParam("@idcard", SqlDbType.NVarChar,50,storeKeeperInfo.IdCard),
                                 GenerateInParam("@address", SqlDbType.NVarChar,300,storeKeeperInfo.Address)
                             };
     string commandText = string.Format("UPDATE [{0}storekeepers] SET [type]=@type,[name]=@name,[idcard]=@idcard,[address]=@address WHERE [storeid]=@storeid",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
コード例 #7
0
ファイル: StoreStrategy.cs プロジェクト: qq550723504/zone
 /// <summary>
 /// 创建店长
 /// </summary>
 /// <param name="storeKeeperInfo">店长信息</param>
 public void CreateStoreKeeper(StoreKeeperInfo storeKeeperInfo)
 {
     DbParameter[] parms = {
                                 GenerateInParam("@storeid", SqlDbType.Int,4,storeKeeperInfo.StoreId),
                                 GenerateInParam("@type", SqlDbType.TinyInt,1,storeKeeperInfo.Type),
                                 GenerateInParam("@name", SqlDbType.NVarChar, 100, storeKeeperInfo.Name),
                                 GenerateInParam("@idcard", SqlDbType.NVarChar,50,storeKeeperInfo.IdCard),
                                 GenerateInParam("@address", SqlDbType.NVarChar,300,storeKeeperInfo.Address)
                             };
     string commandText = string.Format("INSERT INTO [{0}storekeepers]([storeid],[type],[name],[idcard],[address]) VALUES(@storeid,@type,@name,@idcard,@address)",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
コード例 #8
0
ファイル: StoreController.cs プロジェクト: qq550723504/zone
        public ActionResult AddStore(AddStoreModel model)
        {
            if (AdminStores.GetStoreIdByName(model.StoreName) > 0)
                ModelState.AddModelError("StoreName", "名称已经存在");

            if (ModelState.IsValid)
            {
                StoreInfo storeInfo = new StoreInfo()
                {
                    State = (int)StoreState.Open,
                    Name = model.StoreName,
                    RegionId = 0,
                    StoreRid = AdminStoreRanks.GetLowestStoreRank().StoreRid,
                    StoreIid = 0,
                    Logo = "",
                    CreateTime = DateTime.Now,
                    Mobile = "",
                    Phone = "",
                    QQ = "",
                    WW = "",
                    DePoint = 10.00m,
                    SePoint = 10.00m,
                    ShPoint = 10.00m,
                    Honesties = 0,
                    StateEndTime = model.StateEndTime,
                    Theme = "Default",
                    Banner = "",
                    Announcement = "",
                    Description = ""
                };

                StoreKeeperInfo storeKeeperInfo = new StoreKeeperInfo()
                {
                    Type = model.Type,
                    Name = model.StoreKeeperName,
                    IdCard = model.IdCard,
                    Address = model.Address
                };

                int storeId = AdminStores.CreateStore(storeInfo, storeKeeperInfo);
                if (storeId > 0)
                {
                    AddMallAdminLog("添加店铺", "添加店铺,店铺id为:" + storeId);
                    return PromptView("店铺添加成功");
                }
                else
                {
                    return PromptView("店铺添加失败");
                }
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return View(model);
        }