protected void SaveInfo() { ForSale_Info info = new ForSale_Info(int.Parse(txtKey.Text)); info.Datetime = DateTime.ParseExact(txtDatetime.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); info.SeedsKey = DDLSeeds.SelectedValue.ToInt(); info.Code = txtCode.Text; info.Weight = int.Parse(txtWeight.Text); info.Slot = txtSlot.Text; info.PlaceOfBuy = info.PlaceOfBuy; info.Bill = txtBill.Text; info.MemberKey = Convert.ToInt16(Session["EmployeeKey"]); info.Save(); }
protected void LoadInfo(int Key) { ForSale_Info info = new ForSale_Info(Key); if (Key == 0) { DateTime time = DateTime.Now; txtDatetime.Text = time.ToString("dd/MM/yyyy"); } else { txtDatetime.Text = info.Datetime.ToString("dd/MM/yyyy"); } DDLSeeds.SelectedValue = info.SeedsKey.ToString(); txtCode.Text = info.Code; txtWeight.Text = info.Weight.ToString(); txtSlot.Text = info.Slot; txtPlaceOfBuy.Text = info.PlaceOfBuy; txtBill.Text = info.Bill; }