public void setReceiptDetail() { txt_Keyword.Text = ""; txt_Keyword.Enabled = false; int nRow = STORE_LIST.RowCount; int i = 0; for (i = nRow - 1; i >= 0; i--) { STORE_LIST.Rows.RemoveAt(i); } STORE_LIST.Refresh(); txt_ReceiptNo.Focus(); }
public void initialize() { txt_Keyword.Text = ""; txt_Keyword.Enabled = true; txt_ReceiptNo.Text = ""; txt_PurchaseDate.Value = new DateTime(int.Parse(DateTime.Now.ToString("yyyy")), int.Parse(DateTime.Now.ToString("MM")), int.Parse(DateTime.Now.ToString("dd"))); txt_PurchaseAmt.Text = "0.00"; txt_Quantity.Text = "1"; txt_StoreName.Text = ""; txt_GSTNo.Text = ""; txt_TID.Text = ""; txt_MID.Text = ""; txt_GroupName.Text = ""; int nRow = STORE_LIST.RowCount; int i = 0; for (i = nRow - 1; i >= 0; i--) { STORE_LIST.Rows.RemoveAt(i); } STORE_LIST.Refresh(); for (i = 0; i < cmbbox_PurchateItem.Items.Count; i++) { cmbbox_PurchateItem.Items.RemoveAt(i); } cmbbox_PurchateItem.Text = ""; txt_Keyword.Focus(); }
private void txt_Keyword_KeyUp(object sender, KeyEventArgs e) { if (txt_Keyword.Text.Length > 0) { //MessageBox.Show(searchStoreName.Text); try { int nRow = STORE_LIST.RowCount; for (int i = nRow - 1; i >= 0; i--) { STORE_LIST.Rows.RemoveAt(i); } STORE_LIST.Refresh(); Transaction tran = new Transaction(); string strRsult = tran.searchStoreName(txt_Keyword.Text); if (!strRsult.Equals("")) { nRow = STORE_LIST.RowCount; JArray a = JArray.Parse(strRsult); int i = 0; foreach (JObject json in a.Children <JObject>()) { STORE_LIST.Rows.Add(); STORE_LIST[0, nRow + i].Value = json["company_name"].ToString(); STORE_LIST[1, nRow + i].Value = json["store_name"].ToString(); STORE_LIST[2, nRow + i].Value = json["gst_no"].ToString(); STORE_LIST[3, nRow + i].Value = json["tid"].ToString(); STORE_LIST[4, nRow + i].Value = json["mid"].ToString(); STORE_LIST[5, nRow + i].Value = json["group_name"].ToString(); STORE_LIST[6, nRow + i].Value = json["item_code1"].ToString(); STORE_LIST[7, nRow + i].Value = json["item_code2"].ToString(); STORE_LIST[8, nRow + i].Value = json["item_code3"].ToString(); STORE_LIST[9, nRow + i].Value = json["item_code4"].ToString(); STORE_LIST[10, nRow + i].Value = json["item_code5"].ToString(); STORE_LIST[11, nRow + i].Value = json["rec_prefix"].ToString(); STORE_LIST[12, nRow + i].Value = json["rec_digits"].ToString(); STORE_LIST[13, nRow + i].Value = json["dup_rc"].ToString(); i++; } } } catch (Exception ex) { } } else { int nRow = STORE_LIST.RowCount; if (nRow > 1) { for (int i = nRow - 1; i >= 0; i--) { STORE_LIST.Rows.RemoveAt(i); } } } }