Exemple #1
0
 private string proxyAccount(string content, string[] arr, Func<string, string> msgRet, string authId)
 {
     if (!online(authId))
     {
         return msgRet("请登录");
     }
     Regex g = new Regex("开代理\\s\\d{11}\\s\\w{2,5}\\s\\d");
     if (g.IsMatch(content))
     {
         using (busyManDataContext busy = new busyManDataContext(conStr))
         {
             var f = busy.HCTLoginUser.FirstOrDefault(p => p.Account > 888800001 && p.UserState == 1);
             f.Name = arr[2];
             f.Phone = arr[1];
             f.UserState = int.Parse(arr[3]);
             busy.SubmitChanges();
             return
                 msgRet(
                     string.Format("{0} {1} {2} {3}", f.Name, f.Phone, f.Account,
                         f.Password));
         }
     }
     else
     {
         return msgRet("格式:开代理 电话 姓名 0:使用1:测试");
     }
 }
Exemple #2
0
        private string modifyAccountInfo(string[] arr, Func<string, string> msgRet, string authId)
        {
            if (!online(authId))
            {
                return msgRet("请登录");
            }
            if (arr.Length != 9)
            {
                return msgRet("账号 姓名 电话 城市 区域 商场 楼层 店铺名");
            }
            int id = int.Parse(arr[1]);
            string name = arr[2];
            string phone = arr[3];
            string city = arr[4];
            string dis = arr[5];
            string market = arr[6];
            string floor = arr[7];
            string shopName = arr[8];
            using (busyManDataContext context = new busyManDataContext(conStr))
            {

                var shop = context.HCTShop.SingleOrDefault(p => p.Number == id);
                var account = context.HCTLoginUser.SingleOrDefault(p => p.Account == id);
                if (shop != null && account != null)
                {
                    shop.ShopkeeperName = name;
                    shop.ShopkeeperPhone = phone;
                    shop.AddrCity = city;
                    shop.AddrMarket = market;
                    shop.AddrDistrict = dis;
                    shop.AddrFloor = floor;
                    shop.ShopName = shopName;
                    shop.CompanyName = shopName;
                    WriteLog("modifyAccountInfoBAK", string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", shop.Number, shop.ShopkeeperName, shop.ShopkeeperPhone, shop.AddrCity, shop.AddrDistrict, shop.AddrMarket, shop.AddrFloor, shop.ShopName));
                    var cmp = context.HCTCompany.SingleOrDefault(
                        p => p.CompanyNumber == shop.CompanyNumber);
                    cmp.CompanyName = shopName;
                    cmp.CompanyPhone = phone;
                    account.Name = name;
                    account.Phone = phone;
                    account.UserState = 0;
                    account.Address = city + dis + market + floor;
                    context.SubmitChanges();
                    WriteLog("modifyAccountInfo", string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8]));
                    return msgRet(string.Format("{0} {1} {2}", shop.Number, shop.ShopName, account.Password));
                }
                else
                {
                    return msgRet("店铺信息错误");
                }
            }
        }