private void frmCompanySelection_Load(object sender, EventArgs e) { /// Datalayer.SetButtion(btnCreate); Datalayer.SetButtion(btnExit); // Datalayer.SetButtion(btnSelection); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); PopulateData(); }
void AddUpateBank() { try { ep1.Clear(); if (string.IsNullOrEmpty(cmbExpense.Text.Trim())) { ep1.SetError(cmbExpense, "Name is Required.."); cmbExpense.Focus(); return; } if (string.IsNullOrEmpty(txtAmount.Text.Trim())) { ep1.SetError(txtAmount, "Amount is Required.."); txtAmount.Focus(); return; } int TM05_EXPENSEID = 0, TM04_BANKID = 0, T009_AMOUNT = 0; int.TryParse(cmbExpense.SelectedValue.ToString(), out TM05_EXPENSEID); int.TryParse(txtAmount.Text.Trim(), out T009_AMOUNT); MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_EXPENSE_TRANSACTION(Datalayer.iT013_EXPENSETRANSACATIONID, TM05_EXPENSEID, dtpDate.Value, T009_AMOUNT, txtDetails.Text.Trim(), Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.iT013_EXPENSETRANSACATIONID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.iT013_EXPENSETRANSACATIONID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
private void dgDisplayData_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation)) { dgDisplayData.Rows.Remove(dgDisplayData.CurrentRow); } } }
void ResetData() { Datalayer.iT005_STOCKINID = 0; txtQty.Text = ""; txtDetails.Text = ""; Datalayer.Reset(panel1.Controls); dtProducts.Clear(); dgDisplayData.DataSource = dtProducts; cmbName.Focus(); }
private void frmManagePurchase_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnSearch); Datalayer.SetButtion(btnClear); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); dbo.FillAccountList(cmbName, "pl"); if (cmbName.Items.Count > 0) cmbName.SelectedIndex = -1; }
private void MDIMaster_Load(object sender, EventArgs e) { Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); Datalayer.MakeConnections(); PopualteData(); //frmDashBoard fmDashboard = new frmDashBoard(); //fmDashboard.MdiParent = this; //fmDashboard.Show(); }
void ResteData() { Datalayer.iT002_PURCHASEID = 0; Datalayer.Reset(panel1.Controls); Datalayer.Reset(panel5.Controls); Cursor.Current = Cursors.Default; dtProducts.Clear(); dgDisplayData.DataSource = dtProducts; cmbName.Focus(); }
void AddUpdateParty() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtName.Text.Trim())) { ep1.SetError(txtName, "Name is Required.."); txtName.Focus(); return; } MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); decimal T001_OPENINGBAL = 0, T001_DISCOUNT = 0; decimal.TryParse(txtOpeningBal.Text.Trim(), out T001_OPENINGBAL); decimal.TryParse(txtDiscount.Text.Trim(), out T001_DISCOUNT); int TM_STATEID = 0; int.TryParse(cmbState.SelectedValue.ToString(), out TM_STATEID); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_ACCOUNT(Datalayer.iT001_ACCOUNTID, txtName.Text.Trim(), txtContactPerson.Text.Trim(), txtAddress1.Text.Trim(), txtAddress2.Text.Trim(), cmbType.SelectedItem.ToString(), txtCity.Text.Trim(), TM_STATEID, txtMobile1.Text.Trim(), txtMobile2.Text.Trim(), txtPhone.Text.Trim(), txtEmailID.Text.Trim(), T001_OPENINGBAL, txtGSTNo.Text.Trim(), txtTinNo.Text.Trim(), T001_DISCOUNT, Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.iT001_ACCOUNTID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.iT001_ACCOUNTID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } PopualteData(); ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
private void frmOrder_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnExit); Datalayer.SetButtion(btnSave); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); dbo.FillAccountList(cmbAccount, "c"); dbo.FillItemName(cmbItemName); dbo.FillItemSize(cmbItemName, cmbMainItemSize); PopualteData(); }
private void frmManageStockIn_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnSearch); Datalayer.SetButtion(btnClear); Datalayer.SetButtion(btnExit); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); PopualteData(); ToolTip t1 = new ToolTip(); t1.SetToolTip(btnExit, "ctrl + X"); }
void ResteData() { Datalayer.iT012_CHALLENID = 0; Datalayer.Reset(panel2.Controls); Datalayer.Reset(panel3.Controls); Datalayer.Reset(panel4.Controls); dtProducts.Clear(); Cursor.Current = Cursors.Default; dgDisplayData.DataSource = dtProducts; PopualteLastBillNo(); cmbName.Focus(); }
void AddUpdateParty() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtName.Text.Trim())) { ep1.SetError(txtName, "Name is Required.."); txtName.Focus(); return; } MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); decimal T14_DAY_PRICE = 0, T14_HOURS_PRICE = 0; decimal.TryParse(txtDayPrice.Text.Trim(), out T14_DAY_PRICE); decimal.TryParse(txtHoursPrice.Text.Trim(), out T14_HOURS_PRICE); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_WORKER(Datalayer.iT14_WORKERID, txtName.Text.Trim(), txtAddress1.Text.Trim(), txtMobile1.Text.Trim(), T14_DAY_PRICE, T14_HOURS_PRICE, txtDetails.Text.Trim(), Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.iT14_WORKERID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.iT14_WORKERID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } PopualteData(); ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
private void frmAddUpdatePurchase_Load(object sender, EventArgs e) { Datalayer.SetButtion(button1); Datalayer.SetButtion(btnExit); Datalayer.SetButtion(btnSave); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); dbo.FillStateList(cmbState); dbo.FillAccountList(cmbName, "p"); dbo.FillItemName(cmbItemName); cmbUnitName.SelectedIndex = 0; dtProducts.Columns.Add("rkd", typeof(Int32)); dtProducts.Columns.Add("TM01_PRODUCTID", typeof(int)); dtProducts.Columns.Add("TM01_NAME", typeof(string)); dtProducts.Columns.Add("T003_QTY", typeof(decimal)); dtProducts.Columns.Add("T003_UNIT", typeof(string)); dtProducts.Columns.Add("T003_RATE", typeof(decimal)); dtProducts.Columns.Add("T003_AMOUNT", typeof(decimal)); dgDisplayData.DataSource = dtProducts; dgDisplayData.Columns["TM01_NAME"].HeaderText = "Item"; dgDisplayData.Columns["T003_QTY"].HeaderText = "Qty"; dgDisplayData.Columns["T003_UNIT"].HeaderText = "Unit"; dgDisplayData.Columns["T003_RATE"].HeaderText = "Price"; dgDisplayData.Columns["T003_AMOUNT"].HeaderText = "Amount"; dgDisplayData.Columns["TM01_NAME"].DisplayIndex = 0; dgDisplayData.Columns["T003_QTY"].DisplayIndex = 1; dgDisplayData.Columns["T003_UNIT"].DisplayIndex = 2; dgDisplayData.Columns["T003_RATE"].DisplayIndex = 3; dgDisplayData.Columns["T003_AMOUNT"].DisplayIndex = 4; dgDisplayData.Columns["rkd"].Visible = false; dgDisplayData.Columns["TM01_PRODUCTID"].Visible = false; this.dgDisplayData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; dgDisplayData.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(Datalayer.sGridHeaderColor1, Datalayer.sGridHeaderColor2, Datalayer.sGridHeaderColor3); dgDisplayData.EnableHeadersVisualStyles = false; this.dgDisplayData.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; dgDisplayData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing; dgDisplayData.ColumnHeadersHeight = 30; dgDisplayData.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("Tahoma", 12F, FontStyle.Bold, GraphicsUnit.Pixel); dgDisplayData.ColumnHeadersDefaultCellStyle.ForeColor = Color.White; dgDisplayData.Columns["TM01_NAME"].Width = 350; PopualteData(); }
void AddUpdateData() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtName.Text.Trim())) { ep1.SetError(txtName, "Name is Required.."); txtName.Focus(); return; } decimal TM01_TAX_RATE = 0; decimal.TryParse(txtTaxRate.Text.Trim(), out TM01_TAX_RATE); MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_PRODUCT(Datalayer.iTM01_PRODUCTID, txtNo.Text.Trim(), txtName.Text.Trim(), chkIsSet.Checked, txtHSNCode.Text.Trim(), TM01_TAX_RATE, Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.iTM01_PRODUCTID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.iTM01_PRODUCTID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
public bool SendSMS(string sMobileNumber, string sMsg) { // sMobileNumber = "9374045413"; string result = ""; WebRequest request = null; HttpWebResponse response = null; bool bSMSsent = false; try { if (CheckForInternetConnection()) { string url = "http://login.arihantsms.com/vendorsms/pushsms.aspx?user=PENAMT&password=PENAMT&msisdn=91" + sMobileNumber.Trim() + "&sid=PENAMT&msg=" + sMsg.Trim() + "&fl=0&gwid=2"; request = WebRequest.Create(url); // Send the 'HttpWebRequest' and wait for response. response = (HttpWebResponse)request.GetResponse(); Stream stream = response.GetResponseStream(); Encoding ec = System.Text.Encoding.GetEncoding("utf-8"); StreamReader reader = new System.IO.StreamReader(stream, ec); result = reader.ReadToEnd(); int iT025_SMSLOGID_OUT = 0; bSMSsent = (result.ToLower().IndexOf("success") >= 0); //S reader.Close(); stream.Close(); } else { Datalayer.InformationMessageBox("Please check the internet connection.."); return(false); } } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } finally { if (response != null) { response.Close(); } } return(bSMSsent); }
private void frmAddUpdateProduct_Load(object sender, EventArgs e) { Datalayer.SetButtion(button1); Datalayer.SetButtion(btnExit); Datalayer.SetButtion(btnSave); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); PopauteData(); ToolTip t1 = new ToolTip(); t1.SetToolTip(button1, "ctrl + N"); t1.SetToolTip(btnExit, "ctrl + X"); t1.SetToolTip(btnSave, "ctrl + S"); }
void EditData() { if (dgDisplayData.SelectedRows.Count > 0) { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["TM01_PRODUCTID"].Value.ToString(), out ID); Datalayer.iTM01_PRODUCTID = ID; PopauteEditData(); } else { Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection); } }
void ResteData() { cmbName.Enabled = true; Datalayer.T010_PACKINGSLIPID = 0; Datalayer.Reset(panel1.Controls); Cursor.Current = Cursors.Default; if (cmbName.Items.Count > 0) { cmbName.SelectedIndex = -1; } PopualtePackingDetails(); PopualteLastBillNo(); cmbName.Focus(); }
private void dgDisplayData_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) { if (Datalayer.ShowQuestMsg(Datalayer.sMessageConfirmation)) { dgDisplayData.Rows.Remove(dgDisplayData.CurrentRow); PopautleGrandTotal(); } } if (e.KeyCode == Keys.Tab) { txtBillNo.Focus(); dgDisplayData.ClearSelection(); } }
private void frmManageJobWorkInvoice_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnSearch); Datalayer.SetButtion(btnClear); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); dbo.FillItemName(cmbName); // dbo.FillItemSize(cmbName, cmbMainItemSize); if (cmbName.Items.Count > 0) { cmbName.SelectedIndex = -1; } //if (cmbMainItemSize.Items.Count > 0) // cmbMainItemSize.SelectedIndex = -1; }
private void frmManageItem_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnAdd); Datalayer.SetButtion(btnExit); Datalayer.SetButtion(btnEdit); Datalayer.SetButtion(btnDelete); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); PopualteData(); ToolTip t1 = new ToolTip(); t1.SetToolTip(btnAdd, "ctrl + N"); t1.SetToolTip(btnExit, "ctrl + X"); t1.SetToolTip(btnEdit, "ctrl + E"); t1.SetToolTip(btnDelete, "ctrl + D"); }
private void frmPackingSlip_Load(object sender, EventArgs e) { Datalayer.SetButtion(btnSave); Datalayer.SetButtion(btnExit); Datalayer.SetButtion(button1); Datalayer.SetSoftwareThems(pnlHeader, pnlFooter); PopualteLastBillNo(); dbo.FillAccountList(cmbName, "c"); if (cmbName.Items.Count > 0) { cmbName.SelectedIndex = -1; } PopualteData(); }
void AddUpateBank() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtBank.Text.Trim())) { ep1.SetError(txtBank, "Name is Required.."); txtBank.Focus(); return; } MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_BANK(Datalayer.T010_PACKINGSLIPID, txtBank.Text.Trim(), txtAccount.Text.Trim(), txtIFSC.Text.Trim(), txtBranch.Text.Trim(), txtDetails.Text.Trim(), Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.T010_PACKINGSLIPID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.T010_PACKINGSLIPID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
void AddUser() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtOldPassword.Text.Trim())) { ep1.SetError(txtOldPassword, "Old Password is requied."); txtOldPassword.Focus(); return; } if (string.IsNullOrEmpty(txtPassword.Text.Trim())) { ep1.SetError(txtPassword, "Password is requied."); txtPassword.Focus(); return; } db = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); var lst = (from u in db.TL01_USERs select u).Where(s => s.TL01_USERID == Datalayer.iTL01_USERID).ToList(); if (lst != null && lst.Count > 0) { if (lst[0].TL01_PASSWORD.ToString() != txtOldPassword.Text.Trim()) { Datalayer.InformationMessageBox("Old password is not correct.."); txtOldPassword.Focus(); return; } } db = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); TL01_USER tlUser = new TL01_USER(); tlUser.TL01_PASSWORD = txtPassword.Text.Trim(); tlUser.TL01_ROLE = "User"; db.TL01_USERs.InsertOnSubmit(tlUser); db.SubmitChanges(); txtPassword.Text = ""; txtPassword.Focus(); Datalayer.InsertMessageBox(sPageName); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
void AddUpdateData() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtName.Text.Trim())) { ep1.SetError(txtName, "Name is Required.."); txtName.Focus(); return; } MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); int?Iout = 0; MyDa.USP_VP_ADDUPDATE_EXPENSE(Datalayer.iTM05_EXPENSEID, txtName.Text.Trim(), Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { if (Datalayer.iTM05_EXPENSEID == 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.UpdateMessageBox(sPageName); } } else { if (Datalayer.iTM05_EXPENSEID == 0) { Datalayer.DosenotInsertMessageBox(sPageName); } else { Datalayer.DosenotUpdateMessageBox(sPageName); } } ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
void Filldata() { if (dgDisplayData.SelectedRows.Count > 0) { int iTL01_SCHOOLID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["TM_COMPAYID"].Value.ToString(), out iTL01_SCHOOLID); Datalayer.iT001_COMPANYID = iTL01_SCHOOLID; MDIMaster fmMain = new MDIMaster(); fmMain.Show(); this.Hide(); } else { Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection); } }
private void btnAdd_Click(object sender, EventArgs e) { if (dgDisplayData.Rows.Count == 0) { Datalayer.InformationMessageBox("Please select customer "); return; } if (Datalayer.ShowQuestMsg("Are you sure? Do you want to Send SMS? ")) { int iSend = 0, iNotSend = 0; for (int i = 0; i < dgDisplayData.Rows.Count; i++) { if (Convert.ToString(dgDisplayData.Rows[i].Cells[0].Value) == "True") { string sMobileNo = dgDisplayData.Rows[i].Cells["T001_MOBILE1"].Value.ToString(); string sName = dgDisplayData.Rows[i].Cells["T001_NAME"].Value.ToString(); string sAmount = dgDisplayData.Rows[i].Cells["TOTALPENDING"].Value.ToString(); string sCompanyName = dgDisplayData.Rows[i].Cells["TM_NAME"].Value.ToString(); string sPhoneNo = dgDisplayData.Rows[i].Cells["TM_PHONENO"].Value.ToString(); string sMSG = "Dear, " + sName + " your pending amount payable to " + sCompanyName + " is Rs." + sAmount + " and it is now overdue. Please Contact us on " + sPhoneNo + " urgently to discuss our policy."; bool IsSend = SendSMS(sMobileNo, sMSG); if (IsSend) { iSend = iSend + 1; } else { iNotSend = iNotSend + 1; } int?Iout = 0; MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); MyDa.USP_VP_ADDSMS(0, DateTime.Now, sMobileNo, sMSG, IsSend, Datalayer.iT001_COMPANYID, ref Iout); } } Datalayer.InformationMessageBox("SMS Send successfully."); lblTotalSend.Text = "Total Send SMS:" + iSend.ToString(); lblNotSend.Text = "Total Not Send SMS:" + iNotSend.ToString(); } }
void PopualteData() { int iPartyID = 0, TM02_MAIN_PRODUCTSIZEID = 0; string sPartyID = "", sTM02_MAIN_PRODUCTSIZEID = ""; if (!string.IsNullOrEmpty(cmbName.Text.Trim())) { int.TryParse(cmbName.SelectedValue.ToString(), out iPartyID); } //if (!string.IsNullOrEmpty(cmbMainItemSize.Text.Trim())) // int.TryParse(cmbMainItemSize.SelectedValue.ToString(), out TM02_MAIN_PRODUCTSIZEID); if (iPartyID > 0) { sPartyID = iPartyID.ToString(); } if (TM02_MAIN_PRODUCTSIZEID > 0) { sTM02_MAIN_PRODUCTSIZEID = TM02_MAIN_PRODUCTSIZEID.ToString(); } DAL dl = new DAL(); DataTable dt = new DataTable(); dt = dl.SelectMethod("exec USP_VP_GET_STOCK '" + sPartyID + "','" + sTM02_MAIN_PRODUCTSIZEID + "','" + Datalayer.iT001_COMPANYID + "' "); if (dt.Rows.Count > 0) { ReportDocument RptDoc = new ReportDocument(); RptDoc.Load(Application.StartupPath + @"\Report\rptStock.rpt"); RptDoc.SetDataSource(dt); Datalayer.RptReport = RptDoc; Datalayer.sReportName = "Stock Listing Report"; Report.frmReportViwer fmReport = new Report.frmReportViwer(); fmReport.Show(); } else { Datalayer.InformationMessageBox("No Record.."); } }
void AddUpdateData() { try { ep1.Clear(); if (string.IsNullOrEmpty(txtName.Text.Trim())) { ep1.SetError(txtName, "Name is Required.."); txtName.Focus(); return; } decimal dTM02_PRICE1 = 0, dTM02_PRICE2 = 0; decimal.TryParse(txtPrice.Text.Trim(), out dTM02_PRICE1); int iTM02_PRODUCTSIZEID1 = 0, iTM02_PRODUCTSIZEID2 = 0; int.TryParse(lblSizeId1.Text.Trim(), out iTM02_PRODUCTSIZEID1); int.TryParse(lblSizeId2.Text.Trim(), out iTM02_PRODUCTSIZEID2); MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev); int?Iout = 0; MyDa.USP_VP_ADD_PRODUCT(Datalayer.iTM01_PRODUCTID, txtName.Text.Trim(), chkIsSet.Checked, txtHSNCode.Text.Trim(), dTM02_PRICE1, Datalayer.iT001_COMPANYID, ref Iout); if (Iout > 0) { Datalayer.InsertMessageBox(sPageName); } else { Datalayer.DosenotInsertMessageBox(sPageName); } PopualteData(); ResetData(); } catch (Exception ex) { Datalayer.WorningMessageBox(ex.Message.ToString(), "Error"); } }
void EditData() { if (dgDisplayData.SelectedRows.Count > 0) { int ID = 0; int.TryParse(dgDisplayData.CurrentRow.Cells["TM03_PRODUCTITEMID"].Value.ToString(), out ID); Datalayer.iTM03_PRODUCTITEMID = ID; frmAddUpdateProductItem frmAddSTD = new frmAddUpdateProductItem(); frmAddSTD.MdiParent = this.MdiParent; frmAddSTD.Show(); this.Close(); } else { Datalayer.InformationMessageBox(Datalayer.sMeessgeSelection); } }