public JsonResult Edit1(HttpPostedFileBase aFile, string name, string address, string about) { ShopInformation data = _db.ShopInformations.FirstOrDefault(n => n.ID == 1); FileInfo fileImg = new FileInfo(Server.MapPath("~" + data.IconShop)); if (aFile != null) { string file = aFile.FileName; if (!file.Contains(".ico")) { return(Json(false, JsonRequestBehavior.AllowGet)); } string path = Server.MapPath("~/Content/img/MonAn/KhuyenMai-Sukien/"); var ac = Guid.NewGuid() + "." + file.Split('.')[1]; aFile.SaveAs(path + ac); if (fileImg.Exists) { fileImg.Delete(); } if (data != null) { _db.Entry(data).State = System.Data.Entity.EntityState.Detached; } data.IconShop = "/Content/img/MonAn/KhuyenMai-Sukien/" + ac; } data.NameShop = name; data.AddressShop = address; data.About = about; _db.Entry(data).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }
public JsonResult Edit5(string keyword) { ShopInformation data = _db.ShopInformations.FirstOrDefault(n => n.ID == 1); data.Keywords = keyword; _db.Entry(data).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }
public void Create(ShopInformation shop) { var dto = new Shop(); PropertyCopier <ShopInformation, Shop> .Copy(shop, dto); var script = GetInsertScript(dto); ExecDbScripts(script); }
public JsonResult Edit3(string facebook, string google, string zalo) { ShopInformation data = _db.ShopInformations.FirstOrDefault(n => n.ID == 1); data.FaceBook = facebook; data.Google = google; data.Zalo = zalo; _db.Entry(data).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }
private void OnEnable() { lineHeight = EditorGUIUtility.singleLineHeight; lineHeightSpace = lineHeight + 5; shop = target as ShopInformation; shopName = serializedObject.FindProperty("shopName"); commodities = serializedObject.FindProperty("commodities"); acquisitions = serializedObject.FindProperty("acquisitions"); HandlingCommodityList(); HandlingAcquisitionList(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
/// <summary> /// 商品列表 /// </summary> /// <returns></returns> public ShopInformation GetShopList() { var shopInformation = new ShopInformation(); var solarTerms = GetSolarTerms(); var products = _context.Product.Where(x => x.SolarTerms == solarTerms.Name || x.SolarTerms == "無").ToList(); shopInformation.ShopItems = _mapper.Map <List <Product>, List <ShopItem> >(products); shopInformation.SolarTerms = solarTerms.Name; shopInformation.Description = solarTerms.Description; shopInformation.DayDescription = solarTerms.DayDescription; return(shopInformation); }
public JsonResult Edit2(string phone, string phone2, string email, string bankAcc, string password) { ShopInformation data = _db.ShopInformations.FirstOrDefault(n => n.ID == 1); data.Phone = phone; data.Phone2 = phone; data.Email = email; data.PassWordEmail = password; data.BankAcc = bankAcc; _db.Entry(data).State = System.Data.Entity.EntityState.Modified; _db.SaveChanges(); return(Json(true, JsonRequestBehavior.AllowGet)); }
public ShopData(TalkerData vendor, ShopInformation info) { Vendor = vendor; Info = info; foreach (MerchandiseInfo mi in Info.Commodities) { Commodities.Add(new GoodsData(this, mi, GoodsType.SellToPlayer)); } foreach (MerchandiseInfo mi in Info.Acquisitions) { Acquisitions.Add(new GoodsData(this, mi, GoodsType.BuyFromPlayer)); } }
public void Init(ShopInformation shop) { if (shop == null) { return; } MShop = shop; UI.shopName.text = MShop.ShopName; foreach (MerchandiseAgent ma in merchandiseAgents) { ma.Clear(true); } merchandiseAgents.RemoveAll(x => !x.gameObject.activeSelf); UI.commodityTab.isOn = true; SetPage(0); }
private ShopFormViewModel Compose(Shop shop, Dictionary <int, string> categories, List <FoodItemViewModel> foodItems, UserShopRatingInformation rating) { var model = new ShopFormViewModel(); var shopModel = new ShopInformation(); PropertyCopier <Shop, ShopInformation> .Copy(shop, shopModel); model.Info = shopModel; model.UserRating = rating; model.FoodItems = GetFoodItemsPerCategory(categories, foodItems); return(model); }
public int CreateUserShopOwner(UserInformation user, ShopInformation shop) { user.IsShopOwner = true; var id = CreateUser(user); shop.OwnerId = id; var coords = _geoLocation.CalculateLatLong(shop.Address); shop.Latitude = coords.Latitude; shop.Longitude = coords.Longitude; shop.IsActive = false; _repository.Create(shop); return(id); }
public override void CloseWindow() { base.CloseWindow(); if (IsUIOpen) { return; } MShop = null; if (BackpackManager.Instance.IsUIOpen) { BackpackManager.Instance.CloseWindow(); } ItemWindowManager.Instance.CloseWindow(); if (DialogueManager.Instance.IsUIOpen) { DialogueManager.Instance.PauseDisplay(false); } AmountManager.Instance.Cancel(); }
public JsonResult DataInformation() { ShopInformation data = _db.ShopInformations.FirstOrDefault(n => n.ID == 1); return(Json(data, JsonRequestBehavior.AllowGet)); }
private void Start() { instance = this; noticeOff(); }