private void GenerateLabelValues() { SqlConnectionInfo db = new SqlConnectionInfo(); DataSet firstSet = db.GetDataSet("select * from CompanyInfo"); lblCompanyName.Text = firstSet.Tables[0].Rows[0]["CompanyName"].ToString(); lblGSTINNO.Text = firstSet.Tables[0].Rows[0]["GSTINNO"].ToString(); lblCIN.Text = firstSet.Tables[0].Rows[0]["CIN"].ToString(); lblAddress.Text = firstSet.Tables[0].Rows[0]["Address1"].ToString() + ", " + firstSet.Tables[0].Rows[0]["Address2"].ToString() + ", " + firstSet.Tables[0].Rows[0]["Address3"].ToString() + ", " + firstSet.Tables[0].Rows[0]["Address4"].ToString() + ", " + firstSet.Tables[0].Rows[0]["Address5"].ToString(); }
private void ddlItemList_SelectedIndexChanged(object sender, EventArgs e) { if (ddlItemList.SelectedValue.ToString() == "0") { lblUnitPrice.Text = "0"; lblHSNCode.Text = ""; } else { SqlConnectionInfo db = new SqlConnectionInfo(); DataSet firstSet = db.GetDataSet("select * from ShippingItem where ItemId=" + ddlItemList.SelectedValue.ToString()); lblUnitPrice.Text = firstSet.Tables[0].Rows[0]["UnitPrice"].ToString(); lblHSNCode.Text = firstSet.Tables[0].Rows[0]["HSNCode"].ToString(); } CalculateTotals(); }
private void btnLogin_Click(object sender, EventArgs e) { string uname = txtUserName.Text.ToString(); string password = txtPassword.Text.ToString(); SqlConnectionInfo db = new SqlConnectionInfo(); string role = db.ValidateUser(uname, Encrypt(password)); if (role == "") { txtUserName.Text = ""; txtPassword.Text = ""; MessageBox.Show("Invalid Username / Password"); return; } if (role == "Admin") { txtUserName.Visible = false; txtPassword.Visible = false; lblPassword.Visible = false; lblUsername.Visible = false; btnLogin.Visible = false; menuStrip1.Visible = true; userToolStripMenuItem.Visible = false; } if (role == "User") { txtUserName.Visible = false; txtPassword.Visible = false; lblPassword.Visible = false; lblUsername.Visible = false; btnLogin.Visible = false; menuStrip1.Visible = true; adminToolStripMenuItem.Visible = false; } }
private void FillDropDown() { SqlConnectionInfo db = new SqlConnectionInfo(); FillDropDownList(ddlBPName, db.GetDataSet("select * from BusinessPartners where isactive=1"), "", "BPName", "Bpid", "BPName"); }
private int?GetLatestInvoiceNumber() { SqlConnectionInfo db = new SqlConnectionInfo(); return(db.GetMaxInvoiceNum()); }
private string GetInvoiceNumber() { SqlConnectionInfo db = new SqlConnectionInfo(); return(db.GetInvoiceNumber().ToString()); }
private void SaveInvoiceDetails() { SqlConnectionInfo db = new SqlConnectionInfo(); db.SaveInvoice("insert into InvoiceDetails values('" + lblInvoiceNo.Text.ToString() + "','" + Convert.ToDateTime(lblInvoiceDate.Text.ToString()) + "','" + txtVehicleNum.Text.ToString() + "'," + ddlBPName.SelectedValue.ToString() + "," + ddlItemList.SelectedValue.ToString() + "," + txtQuantity.Text.ToString() + "," + lblTaxableValue.Text.ToString() + "," + lblTotalAmount.Text.ToString() + ")"); }