private void mod() { GoodsId goods = new GoodsId(); goods.id = _goods.id; goods.goods = t_goods.Text; goods.describe = t_describe.Text; goods.collect_addr = t_collect_addr.Text; goods.collect_date = dateTimePicker1.Value.Date; goods.contact_man = t_contact_man.Text; goods.contact_phone = t_contact_phone.Text; goods.contact_email = t_contact_email.Text; string str = JsonConvert.SerializeObject(goods); //转为字符串 string strRes = HttpHelp.PostJson(@"/api/Goods/Mod", str); if (string.IsNullOrEmpty(strRes)) { MessageBox.Show("网络请求有误,请重试!"); } else { Res res = JsonConvert.DeserializeObject <Res>(strRes); MessageBox.Show(res.msg); if (res.code == 1) { this.Close(); } } }
public FrmGood(FrmMain main, GoodsId goods) { InitializeComponent(); this.main = main; this._goods = goods; t_goods.Text = this._goods.goods; t_describe.Text = this._goods.describe; t_collect_addr.Text = this._goods.collect_addr; dateTimePicker1.Value = this._goods.collect_date; t_contact_man.Text = this._goods.contact_man; t_contact_phone.Text = this._goods.contact_phone; t_contact_email.Text = this._goods.contact_email; }
//修改招领信息 public Res modGoods(GoodsId data) { Res res = new Res(); //判断请求的数据是否合法 if (data.id <= 0) { res.code = -1; res.msg = "ID不能为空"; } else if (string.IsNullOrEmpty(data.goods) || string.IsNullOrEmpty(data.describe) || string.IsNullOrEmpty(data.contact_man)) { res.code = -1; res.msg = "物品名称、物品描述、联系人不能为空"; } else if (string.IsNullOrEmpty(data.contact_phone) && string.IsNullOrEmpty(data.contact_email)) { res.code = -1; res.msg = "必须输入一种联系方式(手机号码/EMAIL)"; } else { t_lostgoods lostgoods = lostGoodsDal.getGoods(data.id); if (lostgoods == null) { res.code = -1; res.msg = "无此招领信息"; } else { //从接口请求过来的数据赋值给数据库的表对象 lostgoods.contact_man = data.contact_man; lostgoods.contact_email = data.contact_email; lostgoods.contact_phone = data.contact_phone; lostgoods.describe = data.describe; lostgoods.goods = data.goods; lostgoods.collect_addr = data.collect_addr; lostgoods.collect_date = data.collect_date; //修改到数据 res = lostGoodsDal.modGoods(lostgoods); } } return(res); }
public static void Clear() { Wheels.Clear(); GoodsId.Clear(); Goods.Clear(); GoodsBundle.Clear(); Store.Clear(); Inventory.Clear(); Sound.Clear(); Sounds.Clear(); Question.Clear(); Degree.Clear(); AdChannelPostfix.Clear(); DailyTarget.Clear(); Language.Clear(); GameConst.Clear(); }
public override int GetHashCode() { int hash = 1; if (GoodsId != 0) { hash ^= GoodsId.GetHashCode(); } if (AdvNum != 0) { hash ^= AdvNum.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public static void Init() { Inited = true; if (GameConfig.Inst.DebugEnable && (Application.platform == RuntimePlatform.WindowsEditor || Application.platform == RuntimePlatform.OSXEditor)) { Wheels.Init(); GoodsId.Init(); Goods.Init(); GoodsBundle.Init(); Store.Init(); Inventory.Init(); Sound.Init(); Sounds.Init(); Question.Init(); Degree.Init(); AdChannelPostfix.Init(); DailyTarget.Init(); Language.Init(); GameConst.Init(); } }
private void button4_Click(object sender, EventArgs e) { //如果没记录则不处理 if (dataGridView1.RowCount <= 0) { return; } if ((dataGridView1.SelectedRows[0].Cells[0].Value) == null) { return; } //获取选择行并赋值给对象 GoodsId goodsId = new GoodsId(); Object temp; goodsId.id = long.Parse(dataGridView1.SelectedRows[0].Cells["id"].Value.ToString()); temp = dataGridView1.SelectedRows[0].Cells["goods"].Value; goodsId.goods = (temp == null ? "" : temp.ToString()); temp = dataGridView1.SelectedRows[0].Cells["describe"].Value; goodsId.describe = (temp == null ? "" : temp.ToString()); temp = dataGridView1.SelectedRows[0].Cells["collect_date"].Value; goodsId.collect_date = (temp == null ? DateTime.Now : DateTime.Parse(temp.ToString())); temp = dataGridView1.SelectedRows[0].Cells["collect_addr"].Value; goodsId.collect_addr = (temp == null?"": temp.ToString()); temp = dataGridView1.SelectedRows[0].Cells["contact_man"].Value; goodsId.contact_man = (temp == null ? "" : temp.ToString()); temp = dataGridView1.SelectedRows[0].Cells["contact_phone"].Value; goodsId.contact_phone = (temp == null ? "" : temp.ToString()); temp = dataGridView1.SelectedRows[0].Cells["contact_email"].Value; goodsId.contact_email = (temp == null ? "" : temp.ToString()); //打开维护物品界面,并把获取的输入传过去 FrmGood frmGood = new FrmGood(this, goodsId); frmGood.title = "修改"; frmGood.ShowDialog(); //查询最新的数据 query(); }
public Res Mod([FromBody] GoodsId data) { return(lostGoodsBll.modGoods(data)); }
public OrderCalculationGoodsModel(SingleGoods model, int quantity) { GoodsId = model.GoodsId; SingleGoodsId = model.Id; Quantity = quantity; GoodsName = model.Goods.Name; GoodsAttribute = string.Join(",", model.Attributes.Select(me => me.AttributeValue).ToList()); Price = model.Goods.IsGroupon ? ((model.Goods.GrouponStartTime <= DateTime.Now && DateTime.Now <= model.Goods.GrouponEndTime) ? model.GrouponPrice : model.Price) : model.Price; var fileService = HostConstObject.Container.Resolve <IStorageFileService>(); var goodsImage = fileService.GetFiles(SingleGoodsId, MallModule.Instance.InnerKey, GoodsId.ToString()).FirstOrDefault() ?? fileService.GetFiles(GoodsId, MallModule.Key, "MainImage").FirstOrDefault(); GoodsImage = goodsImage?.Simplified(); }
public OrderCalculationGoodsModel(Cart model) { GoodsId = model.GoodsId; SingleGoodsId = model.SingleGoodsId; Quantity = model.Quantity; GoodsName = model.GoodsName; GoodsAttribute = model.GoodsAttribute; Price = model.Price; var fileService = HostConstObject.Container.Resolve <IStorageFileService>(); var goodsImage = fileService.GetFiles(SingleGoodsId, MallModule.Instance.InnerKey, GoodsId.ToString()).FirstOrDefault() ?? fileService.GetFiles(GoodsId, MallModule.Key, "MainImage").FirstOrDefault(); GoodsImage = goodsImage?.Simplified(); }
/// <summary> /// /// </summary> /// <returns></returns> public override int GetHashCode() { if (GoodsId == Guid.Empty) { return(base.GetHashCode()); } string stringRepresentation = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "#" + GoodsId.ToString(); return(stringRepresentation.GetHashCode()); }
public override void SerializeTo(IDictionary <string, string> serializableInfo) { serializableInfo.Add("GoodsId", GoodsId.ToString()); serializableInfo.Add("ReservationId", ReservationId.ToString()); }
/// <summary> /// Конструктор /// </summary> /// <param name="goodsDescription">описание купленного товара</param> /// <param name="uniqueDownloadId">уникальный идентификатор скачивания</param> /// <param name="goodsId"> </param> public SuccessPaymentModel(string goodsDescription, string uniqueDownloadId, GoodsId goodsId) { GoodsDescription = goodsDescription; UniqueDownloadId = uniqueDownloadId; GoodsId = goodsId; }