// GET: Order /// <summary> /// 장바구니 추가 /// </summary> /// <param name="Param"></param> /// <returns></returns> public JsonResult ShoppingCartAdd(SHOPPING_ITEM Param) { string msg = string.Empty; string cartListHtml = string.Empty; string totAmt = String.Format(SessionHelper.LoginInfo.CultureInfo, "{0:C}", 0); try { SHOPPING_CART cart = new SHOPPING_CART(); if (SessionHelper.LoginInfo.SHOPPING_CART == null) { cart = new SHOPPING_CART(); } else { cart = SessionHelper.LoginInfo.SHOPPING_CART; } if (Param != null) { List <SHOPPING_ITEM> Itemlist = new List <SHOPPING_ITEM>(); if (cart.ITEM_LIST == null) { Itemlist = new List <SHOPPING_ITEM>(); } else { Itemlist = cart.ITEM_LIST; } bool chkAdd = false; foreach (var item in Itemlist.Where(w => w.ITEM_CODE == Param.ITEM_CODE && w.ITEM_GROUP_NAME == Param.ITEM_GROUP_NAME)) { item.CNT = item.CNT + 1; item.SALES_AMT = item.CNT * item.PRICE; chkAdd = true; } if (!chkAdd) { Param.SALES_AMT = Param.PRICE; Itemlist.Add(Param); } cart.ITEM_LIST = Itemlist; this.SetCartMasterData(ref cart); totAmt = String.Format(SessionHelper.LoginInfo.CultureInfo, "{0:C}", cart.TOTAL_AMT); SessionHelper.LoginInfo.SHOPPING_CART = cart; } }catch (Exception ex) { msg = ex.Message; } return(new JsonResult { Data = new { TOT_AMT = totAmt, error_message = msg } }); }
// Use this for initialization void Start() { world = GameObject.Find("wrldctrl").GetComponent <worldgenerator>(); inv = GameObject.Find("wrldctrl").GetComponent <Inventory>(); list = GameObject.Find("wrldctrl").GetComponent <Itemlist>(); bag = new Inventory.bag(); overlay = GameObject.Find("wrldctrl").GetComponent <GUIoverlay>(); progress = false; initInventory(); }
// Use this for initialization void Start() { world = GameObject.Find("wrldctrl").GetComponent<worldgenerator>(); inv = GameObject.Find("wrldctrl").GetComponent<Inventory>(); list = GameObject.Find("wrldctrl").GetComponent<Itemlist>(); bag = new Inventory.bag(); overlay = GameObject.Find("wrldctrl").GetComponent<GUIoverlay>(); progress = false; initInventory(); }
// Use this for initialization void Start() { planted = false; plantable = false; plowedTex = Resources.Load("Materials/plowed") as Material; items = GameObject.Find("wrldctrl").GetComponent <Itemlist>(); var rend = gameObject.GetComponent <Renderer>(); rend.enabled = true; rend.material = plantTex; initPlant(1); plowable = true; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { string connString = System.Configuration.ConfigurationManager.ConnectionStrings["MywebConnection"].ToString(); using (MySqlConnection con = new MySqlConnection(connString)) { using (MySqlCommand cmd = new MySqlCommand("SELECT Product_Id, Product_Name FROM mydatabase.product order by Product_Name")) { cmd.CommandType = CommandType.Text; cmd.Connection = con; con.Open(); Itemlist.DataSource = cmd.ExecuteReader(); Itemlist.DataTextField = "Product_Name"; Itemlist.DataValueField = "Product_Id"; Itemlist.DataBind(); con.Close(); } } Itemlist.Items.Insert(0, new ListItem("--Select Item--", "0")); Itemlist.Items.Add(new ListItem("New Item", "-1")); } catch (MySqlException ex) { Console.WriteLine("{0} Exception caught.", ex); } finally { if (cmd != null) { cmd.Dispose(); } if (con != null) { con.Close(); } } } }
private void AddItem(object s, RoutedEventArgs e) // Adding new item To the List { string _ItemName = ItemName.Text; string _ItemDetailed = ItemDetailed.Text; string _ItemStatus = cbox_status.Text; if (_ItemName.Trim() != "" && _ItemDetailed.Trim() != "" && _ItemStatus.Trim() != "") { if (_ItemId != 0) { //------------------------------------------------ Update var ItemToUpdate = new Itemlist { ItemlistId = _ItemId, Name = _ItemName, Detailed = _ItemDetailed, Status = _ItemStatus, DatalistId = _ItemDataListId }; MessageBox.Show(_itemController.UpdateItem_Class(ItemToUpdate)); } else { // ----------------------------------------------------------- Add ITEM var addingItem = new Itemlist { Name = _ItemName, Detailed = _ItemDetailed, Status = _ItemStatus, DatalistId = _ItemDataListId }; MessageBox.Show(_itemController.AddItem_Class(addingItem)); } this.Close(); } else { MessageBox.Show("Please Fill Up All Boxes!"); } }
public void InsertList(Itemlist insertList) // ------------ Add { context.Itemlists.Add(insertList); //throw new NotImplementedException(); }
// Use this for initialization void Start() { planted = false; plantable = false; plowedTex = Resources.Load("Materials/plowed") as Material; items = GameObject.Find("wrldctrl").GetComponent<Itemlist>(); var rend = gameObject.GetComponent<Renderer>(); rend.enabled = true; rend.material = plantTex; initPlant(1); plowable = true; }
public async Task <Itemlist> _AddItem(Itemlist data) { var add_data = await genericRepository.InsertList(data); return }