private List<Shop_Store> BuildTestData() { List<Shop_Store> stores = new List<Shop_Store>(); for (int i = 0; i < 100; i++) { Account_Period ap = new Account_Period(); ap.AccountID = Guid.NewGuid(); ap.BeginDate = DateTime.Now; ap.EndDate = DateTime.Now; ProInfo pi = new ProInfo(); pi.Name = "name" + i; pi.Unit = "jin"; ShopInfo si = new ShopInfo(); si.ShopName = "name" + i; Shop_Store ss = new Shop_Store(); ss.Account_Period = ap; ss.ChkQty = i; ss.CurrQty = i; ss.ExpQty = i; ss.Id = i; ss.ImpQty = ss.PreQty = i; ss.ProInfo = pi; ss.ShopInfo = si; stores.Add(ss); } return stores; }
protected void btnSave_Click(object sender, EventArgs e) { ShopInfo si = new ShopInfo(); if (shopid == null) { si.ShopID = Guid.Empty; } else { si.ShopID = new Guid(shopid); } si.ShopNo = tbShopNo.Text; si.ShopName = tbShopName.Text; si.AreaInfo = da.GetByAreaID(new Guid(ddlarea.SelectedValue)); si.Address = tbAddress.Text; si.Tel = tbTel.Text; si.Fax = tbFax.Text; si.IsCenter = cbIsCenter.Checked; si.DeleteFlag = false; dsi.Save(si); Session[WebHint.Web_Hint] = new WebHint("保存成功", "/Shop/Default.aspx", HintFlag.跳转); Response.Redirect(WebHint.HintURL); }
public ShopGridData(EShopType shopType, ShopInfo info, ShopGridData.ShopItemCallback buyCallback, ShopGridData.ShopItemCallback showCallback) { this.ShopType = shopType; this.shopInfo = info; if (info.IsFashion != 0) { this.fashionInfo = Globals.Instance.AttDB.FashionDict.GetInfo(this.shopInfo.InfoID); } else { this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.shopInfo.InfoID); } this.BuyShopItemEvent = buyCallback; this.ShowShopItemEvent = showCallback; }
private List<Shop_Store> BuildTestData() { List<Shop_Store> details = new List<Shop_Store>(); for (int i = 0; i < 100; i++) { Shop_Store d = new Shop_Store(); ShopInfo si = new ShopInfo(); si.ShopName = "shopname" + i; d.ShopInfo = si; d.Account_Period = new Account_Period(); d.ChkQty = d.CurrQty = d.ExpQty = d.ImpQty = i; details.Add(d); } return details; }
private List<Shop_AccountDetail> BuildTestData() { List<Shop_AccountDetail> details = new List<Shop_AccountDetail>(); for (int i = 0; i < 100; i++) { Shop_AccountDetail d = new Shop_AccountDetail(); ShopInfo si = new ShopInfo(); si.ShopName = "shopname" + i; d.ShopInfo = si; d.Account_Period = new Account_Period(); d.BillDate = DateTime.Now; d.BillNO = "BillNo"; d.ChkQty = d.CurrQty = d.ExpQty =d.ImpQty= i; details.Add(d); } return details; }
public int GetBuyCount(ShopInfo shopInfo) { BuyRecord buyRecord = this.GetBuyRecord(shopInfo.ID); if (buyRecord == null) { return 0; } if (shopInfo.ResetType == 1) { return buyRecord.Count; } if (this.GetTimeStamp() >= buyRecord.TimeStamp) { return 0; } return buyRecord.Count; }
IDictionary <int, string> GetPrintElementIndexAndOrderValue(ShopInfo shop, OrderInfo order, IEnumerable <int> printElementIndexes) { if (order == null) { throw new NullReferenceException("预约单为空"); } var dic = new Dictionary <int, string>(); RegionService regionService = new RegionService(); string[] regionNames = order.RegionFullName.Split(' '); string sellerRegionFullName = string.Empty; string[] sellerRegionNames = new string[] { }; if (shop.SenderRegionId.HasValue) { sellerRegionFullName = regionService.GetFullName(shop.SenderRegionId.Value); sellerRegionNames = sellerRegionFullName.Split(' '); } string value; string fullRegionName = string.Empty; foreach (var index in printElementIndexes.ToList()) { value = string.Empty; #region 获取对应值 switch (index) { case 1: //"收货人-姓名" value = order.ShipTo; break; case 2: //"收货人-地址" value = order.Address; break; case 3: //"收货人-电话" value = order.CellPhone; break; case 4: //"收货人-邮编" value = ""; break; case 5: //"收货人-地区1级" value = regionNames[0]; break; case 6: //"收货人-地区2级" value = regionNames.Length > 1 ? regionNames[1] : ""; break; case 7: //"收货人-地区3级" value = regionNames.Length > 2 ? regionNames[2] : ""; break; case 8: //"发货人-姓名" value = shop.SenderName; break; case 9: //"发货人-地区1级" value = sellerRegionNames.Length > 0 ? sellerRegionNames[0] : ""; break; case 10: // "发货人-地区2级" value = sellerRegionNames.Length > 1 ? sellerRegionNames[1] : ""; break; case 11: //"发货人-地区3级" value = sellerRegionNames.Length > 2 ? sellerRegionNames[2] : ""; break; case 12: //"发货人-地址" value = shop.SenderAddress; break; case 13: //"发货人-邮编" value = ""; break; case 14: //"发货人-电话" value = shop.SenderPhone; break; case 15: //"预约单-预约单号" value = order.Id.ToString(); break; case 16: //"预约单-总金额" value = order.OrderTotalAmount.ToString("F2"); break; case 17: //"预约单-物品总重量" value = string.Empty; break; case 18: //"预约单-备注" value = string.IsNullOrWhiteSpace(order.UserRemark) ? "" : order.UserRemark.ToString(); break; case 19: //"预约单-详情" value = string.Empty; break; case 21: //"网店名称" value = shop.ShopName; break; case 22: //"对号-√" value = "√"; break; default: value = string.Empty; break; } #endregion dic.Add(index, value); } return(dic); }
public static void RequestShopBuyItem(ShopInfo shopInfo, EShopType shopType, int count) { if (shopInfo == null) { return; } LocalPlayer player = Globals.Instance.Player; if (shopInfo.Type == 1 && (player.GuildSystem.Guild == null || player.GuildSystem.Guild.Level < shopInfo.Value)) { GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT4"), shopInfo.Value), 0f, 0f); return; } if (shopInfo.Type == 2 && player.Data.TrialMaxWave < shopInfo.Value) { GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT41"), shopInfo.Value), 0f, 0f); return; } if (shopInfo.Type == 3 && (player.Data.ArenaHighestRank == 0 || player.Data.ArenaHighestRank > shopInfo.Value)) { GameUIManager.mInstance.ShowMessageTip(string.Format(Singleton<StringManager>.Instance.GetString("ShopT42"), shopInfo.Value), 0f, 0f); return; } int buyCount = player.GetBuyCount(shopInfo); if (shopInfo.Times != 0) { int num = Tools.GetShopBuyTimes(shopInfo) - buyCount; if (num <= 0) { GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("ShopT3"), 0f, 0f); return; } } int num2 = 0; int num3 = 0; if (shopInfo.IsFashion != 0) { if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType2, 0) < shopInfo.Price2) { Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType2, shopInfo.Price2, 0); return; } num2 = count * shopInfo.Price; if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType, 0) < num2) { Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType, num2, 0); return; } MC2S_ShopBuyFashion mC2S_ShopBuyFashion = new MC2S_ShopBuyFashion(); mC2S_ShopBuyFashion.ID = shopInfo.ID; Globals.Instance.CliSession.Send(534, mC2S_ShopBuyFashion); } else { ItemInfo info = Globals.Instance.AttDB.ItemDict.GetInfo(shopInfo.InfoID); while (count - num3 > 0) { num2 += Tools.GetItemBuyConst(info, buyCount + ++num3, shopInfo); } if (Tools.GetCurrencyMoney((ECurrencyType)shopInfo.CurrencyType, 0) < num2) { Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType, num2, 0); return; } if (shopInfo.Price2 > 0 && Tools.MoneyNotEnough((ECurrencyType)shopInfo.CurrencyType2, num3 * shopInfo.Price2, 0)) { return; } MC2S_ShopBuyItem mC2S_ShopBuyItem = new MC2S_ShopBuyItem(); mC2S_ShopBuyItem.ID = shopInfo.ID; mC2S_ShopBuyItem.Price = (uint)shopInfo.Price; mC2S_ShopBuyItem.ShopType = (int)shopType; mC2S_ShopBuyItem.Count = count; Globals.Instance.CliSession.Send(514, mC2S_ShopBuyItem); } }
public JsonResult UpdateAfter(ShopInfo model) { ShopInfoBll shopBll = new ShopInfoBll(); model.EnterpriseID = AgentLoginUser.UserBasic.EnterpriseID; return Json(shopBll.Update(model)); }
public ActionResult EditAgentShopAfter(ShopInfo model) { ShopInfoBll shopBll = new ShopInfoBll(); model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return Json(shopBll.Update(model)); }
/// <summary> /// Shows the shop form. /// </summary> /// <param name="shopInfo">The info for the shop to display.</param> public void DisplayShop(ShopInfo <IItemTemplateTable> shopInfo) { _shopInfo = shopInfo; IsVisible = true; }
/// <summary> /// Hides the shop form. /// </summary> public void HideShop() { IsVisible = false; _shopInfo = null; }
private static void Process(Map map, Rectangle2D[] regions) { m_ShopTable = new Hashtable(); m_ShopList = new ArrayList(); World.Broadcast(0x35, true, "Generating vendor spawns for {0}, please wait.", map); for (int i = 0; i < regions.Length; ++i) { for (int x = 0; x < map.Width; ++x) { for (int y = 0; y < map.Height; ++y) { CheckPoint(map, regions[i].X + x, regions[i].Y + y); } } } for (int i = 0; i < m_ShopList.Count; ++i) { ShopInfo si = (ShopInfo)m_ShopList[i]; int xTotal = 0; int yTotal = 0; bool hasSpawner = false; for (int j = 0; !hasSpawner && j < si.m_Floor.Count; ++j) { Point2D fp = (Point2D)si.m_Floor[j]; xTotal += fp.X; yTotal += fp.Y; IPooledEnumerable eable = map.GetItemsInRange(new Point3D(fp.X, fp.Y, 0), 0); foreach (Item item in eable) { if (item is Spawner) { hasSpawner = true; break; } } eable.Free(); if (hasSpawner) { break; } } if (hasSpawner) { continue; } int xAvg = xTotal / si.m_Floor.Count; int yAvg = yTotal / si.m_Floor.Count; ArrayList names = new ArrayList(); ShopFlags flags = si.m_Flags; if ((flags & ShopFlags.Armor) != 0) { names.Add("armorer"); } if ((flags & ShopFlags.MetalWeapon) != 0) { names.Add("weaponsmith"); } if ((flags & ShopFlags.ArcheryWeapon) != 0) { names.Add("bowyer"); } if ((flags & ShopFlags.Scroll) != 0) { names.Add("mage"); } if ((flags & ShopFlags.Spellbook) != 0) { names.Add("mage"); } if ((flags & ShopFlags.Bread) != 0) { names.Add("baker"); } if ((flags & ShopFlags.Jewel) != 0) { names.Add("jeweler"); } if ((flags & ShopFlags.Potion) != 0) { names.Add("herbalist"); names.Add("alchemist"); names.Add("mage"); } if ((flags & ShopFlags.Reagent) != 0) { names.Add("mage"); names.Add("herbalist"); } if ((flags & ShopFlags.Clothes) != 0) { names.Add("tailor"); names.Add("weaver"); } for (int j = 0; j < names.Count; ++j) { Point2D cp = Point2D.Zero; int dist = 100000; int tz; for (int k = 0; k < si.m_Floor.Count; ++k) { Point2D fp = (Point2D)si.m_Floor[k]; int rx = fp.X - xAvg; int ry = fp.Y - yAvg; int fd = (int)Math.Sqrt(rx * rx + ry * ry); if (fd > 0 && fd < 5) { fd -= Utility.Random(10); } if (fd < dist && GetFloorZ(map, fp.X, fp.Y, out tz)) { dist = fd; cp = fp; } } if (cp == Point2D.Zero) { continue; } int z; if (!GetFloorZ(map, cp.X, cp.Y, out z)) { continue; } new Spawner(1, 1, 1, 0, 4, (string)names[j]).MoveToWorld(new Point3D(cp.X, cp.Y, z), map); } } World.Broadcast(0x35, true, "Generation complete. {0} spawners generated.", m_ShopList.Count); }
public static void OnShopLoaded(ShopInfo shopInfo) { ShopLoaded?.Invoke(shopInfo); LoadedShops.Add(shopInfo); }
protected void StartShop(ShopInfo _s) { EventHandler.StartShop(_s); }
public JsonResult CreateAfter(ShopInfo model) { Utility.ReturnData<string> returnData = new Utility.ReturnData<string>(); ShopInfoBll shopBll = new ShopInfoBll(); //UserPC _model = CacheHelp.Get("user") as UserPC; model.Relation = 2; model.ContactPhone = ""; model.Address = ""; model.Range = ""; model.shopIMG = ""; model.WeixinMPID = 0; model.Remarks = ""; model.AgentID = AgentLoginUser.RoleID; model.ContactTEL = ""; model.Status = 1; model.ChannelGroupID = 0; model.ProvinceID = model.ProvinceID; model.CityID = model.CityID; model.CountyID = model.CountyID; model.EnterpriseID = AgentLoginUser.UserBasic.EnterpriseID; returnData = shopBll.Create(model); return Json(returnData); }
public JsonResult Agent_CreateAfter(ShopInfo model) { ShopInfoBll bll = new ShopInfoBll(); model.Relation = 2; model.ContactPhone = ""; model.Address = ""; model.Range = ""; model.shopIMG = ""; model.WeixinMPID = 0; model.Remarks = ""; model.ContactTEL = ""; model.Status = 1; model.ProvinceID = model.ProvinceID; model.CityID = model.CityID; model.CountyID = model.CountyID; model.EnterpriseID = LoginUser.UserBasic.EnterpriseID; return Json(bll.Create(model)); }
void RecvStartShopping(IIPSocket conn, BitStream r) { var shopOwnerIndex = r.ReadMapEntityIndex(); var canBuy = r.ReadBool(); var name = r.ReadString(); var itemCount = r.ReadByte(); var items = new IItemTemplateTable[itemCount]; for (var i = 0; i < itemCount; i++) { var value = new ItemTemplateTable(); value.ReadState(r); items[i] = value; } var shopOwner = Map.GetDynamicEntity(shopOwnerIndex); var shopInfo = new ShopInfo<IItemTemplateTable>(shopOwner, name, canBuy, items); GameplayScreen.ShopForm.DisplayShop(shopInfo); }
protected void save_info_Click(object sender, EventArgs e) { eWorldEntities db = new eWorldEntities(); var tmp = db.ShopInfoes; db.ShopInfoes.RemoveRange(tmp); ShopInfo s = new ShopInfo(); s.InfoContact = info_contact.Text; s.Warranty = warranty.Text; s.Showroom = showroom.Text; db.ShopInfoes.Add(s); db.SaveChanges(); }
/// <summary> /// Shows the shop form. /// </summary> /// <param name="shopInfo">The info for the shop to display.</param> public void DisplayShop(ShopInfo<IItemTemplateTable> shopInfo) { _shopInfo = shopInfo; IsVisible = true; }
private static void ProcessDisplayCase( Map map, StaticTile[] tiles, int x, int y ) { ShopFlags flags = ShopFlags.None; for ( int i = 0; i < tiles.Length; ++i ) flags |= ProcessDisplayedItem( tiles[i].ID ); if ( flags != ShopFlags.None ) { Point2D p = new Point2D( x, y ); ShopInfo si = (ShopInfo)m_ShopTable[p]; if ( si == null ) { ArrayList floor = new ArrayList(); RecurseFindFloor( map, x, y, floor ); if ( floor.Count == 0 ) return; si = new ShopInfo(); si.m_Flags = flags; si.m_Floor = floor; m_ShopList.Add( si ); for ( int i = 0; i < floor.Count; ++i ) m_ShopTable[(Point2D)floor[i]] = si; } else { si.m_Flags |= flags; } } }
protected void Page_Load(object sender, EventArgs e) { string id = "0"; if (Session["userid"] != null) { id = Session["userid"].ToString(); } int idd = 0; int.TryParse(id, out idd); var sdb = new ShopInfoDb(); shop = sdb.getShopinfo(idd); if (shop == null) { shop = new ShopInfo(); } if (!Page.IsPostBack) { if (idd == 0) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>没有对应的数据,不能修改</td></tr>"; //"请刷新页面"; return; } if (Request.RequestType.ToUpper() == "POST") { //var IdCart = Request.Form["userCompany"]; //if (!string.IsNullOrEmpty(IdCart)) //{ // shop.IdCart = IdCart; //} shop.PhoneNumber = Request.Form["phoneNum"]; if (string.IsNullOrEmpty(shop.PhoneNumber)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入手机号码</td></tr>"; //"请刷新页面"; return; } float phonenum = 0; if (shop.PhoneNumber.Length != 11 || !float.TryParse(shop.PhoneNumber, out phonenum)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>您输入的手机号码有误</td></tr>"; //"请刷新页面"; return; } //var BusinessLicense = Request.Form["CompanyLisent"]; //if (!string.IsNullOrEmpty(BusinessLicense)) //{ // shop.BusinessLicense = BusinessLicense; //} shop.CompanyName = Request.Form["companyName"]; if (string.IsNullOrEmpty(shop.CompanyName)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入公司名称</td></tr>"; //"请刷新页面"; return; } shop.CompanyAddress = Request.Form["CompanyAddress"]; if (string.IsNullOrEmpty(shop.CompanyAddress)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入公司地址</td></tr>"; //"请刷新页面"; return; } //shop.ShopNum = Request.Form["netNumber"]; //if (string.IsNullOrEmpty(shop.ShopNum)) //{ // ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入公司名称短号</td></tr>"; //"请刷新页面"; // return; //} var shortnum = Request.Form["phoneNumber"]; if (string.IsNullOrEmpty(shortnum)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入公司名称短码</td></tr>"; //"请刷新页面"; return; } var numlist = shortnum.Replace("、", " ").Replace(",", " ").Replace(";", " ").Replace(",", " ").Replace(";", " ").Split(' '); List <string> resultnum = new List <string>(); foreach (var item in numlist) { var tempitem = item.Trim(' '); if (tempitem == "" || tempitem.Length < 3) { continue; } int tempnum; if (int.TryParse(tempitem, out tempnum)) { resultnum.Add(tempitem); } } var PhoneShopNum = string.Join(" ", resultnum); if (string.IsNullOrEmpty(PhoneShopNum)) { ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>请输入公司名称短码</td></tr>"; //"请刷新页面"; return; } if (shop.PhoneShopNum != PhoneShopNum) { shop.PhoneShopNum = PhoneShopNum; new CarDetialInfoDb().UpdateCarinfoByShopnum(shop.PhoneShopNum, shop.ShopNum); } //^[A-Za-z0-9]+$ new ShopInfoDb().UpdateData(shop); // new CarDetialInfoDb().ExecSql("update CarDetialInfo set ProNum='" + shop.PhoneShopNum + "' where SellerNumber='" + shop.ShopNum + "' and pronum is NULL "); ErrorMsg = "<tr><td width=\'80\' height=\'40\' align=\'right\'></td><td style=\'color:red;\'>您的数据已提交成功</td></tr>"; //"请刷新页面"; } } }