private void txt_ItemCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { string item = txt_ItemCode.Text; if (item != "") { FormName = "Sales Order"; var form2 = new ItemListForSales(FormName, txt_ItemCode.Text); form2.ShowDialog(); if (ItemCode_From_List != "") { txt_ItemCode.Text = ItemCode_From_List; txt_Discription.Text = ItemName_From_List; } } } }
private void btn_item_Choose_Click(object sender, EventArgs e) { FormName = "Sales Order"; if (txt_ItemCode.Text != "") { var form2 = new ItemListForSales(FormName, txt_ItemCode.Text); form2.ShowDialog(); if (itemid != "") { txt_ItemCode.Text = ItemCode_From_List; if (itemcheck() == 0) { txt_Discription.Text = ItemName_From_List; DataTable dtb = this.cntrl.get_salesrate(itemid); load_unitcost(dtb); } else { } } } else { var form2 = new ItemListForSales(FormName); form2.ShowDialog(); form2.Dispose(); if (itemid != "") { txt_ItemCode.Text = ItemCode_From_List; if (itemcheck() == 0) { txt_Discription.Text = ItemName_From_List; DataTable dtb = this.cntrl.get_salesrate(itemid); load_unitcost(dtb); } } } }