private void frmCashPayment_Load(object sender, EventArgs e) { c.GetMdiParent(this).EnableAllEditMenuButtons(); c.getconnstr(); c.FillcomboBox("select BHM_DESH, BHM_COD from tbl_LedgerAcc where GRP_COD not in (1) order by BHM_DESH", "BHM_DESH", "BHM_COD", ref valcmbaccountgroup); enableData(); SqlConnection con = c.myconn; }
private void frmBankReceipt_Load(object sender, EventArgs e) { c.GetMdiParent(this).EnableAllEditMenuButtons(); c.getconnstr(); //m.FillcomboBox("select * from tbl_LedgerAcc where BHM_COD in('140','587','588') order by BHM_DESH", "BHM_DESH", "BHM_COD", ref valcmbbank); c.FillcomboBox("select * from tbl_LedgerAcc where GRP_COD in (2) order by BHM_DESH", "BHM_DESH", "GRP_COD", ref valcmbbank); c.FillcomboBox("select * from tbl_LedgerAcc where GRP_COD NOT in(1) order by BHM_DESH", "BHM_DESH", "GRP_COD", ref valcmbaccountgroup); enableData(); SqlConnection con = c.myconn; }
private void FrmJurnalLadger_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select acname,accode from tbl_account order by acname", "acname", "accode", ref valcmbbank); dtpfrom.Value = c.GetFromDate(school.CurrentSessionCode); dtpto.Value = c.GetToDate(school.CurrentSessionCode); }
private void Distic_Setup_Load(object sender, EventArgs e) { c.btnenable(btnnew, btnedit, btndelete, btnsave, btncancel, btnprint, btnedit); c.getconnstr(); showList(); //c.FillListBox("select * from tbl_district order by district", "district", "distcode", ref listBox1); }
private void frmEvalutionField_Load(object sender, EventArgs e) { c.GetMdiParent(this).EnableAllEditMenuButtons(); c.getconnstr(); c.FillListBox("SELECT [SessionCode] ,[ActivityID] ,[ActivityName] ,[ActivityField] ,[MaximumMarks] ,[ActivityOrder] FROM [tbl_ExamActivity] Order By ActivityOrder ", "ActivityName", "ActivityID", ref listBox1); cmbExamOrder.Items.Clear(); for (int i = 1; i <= listBox1.Items.Count; i++) { cmbExamOrder.Items.Add(i); } }
private void Frmsubject_Load(object sender, EventArgs e) { c.btnenable(btnnew, btnedit, btndelete, btnsave, btncancel, btnprint, btnexit); c.getconnstr(); c.FillListBox("Select subjectno,subjectname,SubjectCode ,SubjectOrder from tbl_subject Group By subjectno,subjectname,SubjectCode ,SubjectOrder Order By SubjectOrder ", "subjectname", "subjectno", ref listBox1); cmbSubjectOrder.Items.Clear(); for (int i = 1; i <= listBox1.Items.Count; i++) { cmbSubjectOrder.Items.Add(i); } btnnew.Focus(); }
private void textBox1_TextChanged(object sender, EventArgs e) { try { c.getconnstr(); DataSet ds = Connection.GetDataSet("SELECT tbl_student.scholarno as [Scholar No.], tbl_student.name as [Name], tbl_student.father as [Fathers Name], tbl_classmaster.classname as Class, tbl_section.sectionname as Section,barcode FROM tbl_classstudent INNER JOIN tbl_student ON tbl_classstudent.studentno = tbl_student.studentno INNER JOIN tbl_section ON tbl_classstudent.Section = tbl_section.sectioncode INNER JOIN tbl_classmaster ON tbl_classstudent.classno = tbl_classmaster.classcode where tbl_classstudent.sessioncode='" + school.CurrentSessionCode.ToString() + "' and tbl_student.name like '" + textBox1.Text + '%' + "' "); GVStudentDetails.DataSource = ds.Tables[0]; } catch (Exception ex) { throw ex; } }
private void FrmBookWaiting_Load(object sender, EventArgs e) { try { c.getconnstr(); c.FillcomboBox("select * from tbl_Book order by bookName", "bookName", "bookno", ref cmbBookName); //Connection.FillComboBox(cmbBookName, "Select Distinct bookno,bookName from tbl_Book "); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void textBox1_TextChanged(object sender, EventArgs e) { try { c.getconnstr(); DataSet ds = Connection.GetDataSet("select tb.bookname as [Book Name],tb.booksubname as [Book Sub Name],tb.author as [Author],bt.booktitle as [Title],bt.prize as [Rs.],bt.BarcodeNo as [BarCode] from tbl_booktitle bt inner join tbl_book tb on bt.bookno=tb.bookno where tb.bookname like '" + textBox1.Text + '%' + "' "); GVStudentDetails.DataSource = ds.Tables[0]; } catch (Exception ex) { throw ex; } }
private void FrmPublisher_Load(object sender, EventArgs e) { c.btnenable(btnnew, btnedit, btndelete, btnsave, btncancel, btnprint, btnexit); c.getconnstr(); btnnew.Focus(); c.FillListBox("select * from tbl_publisher", "publishar", "publishcode", ref listBox1); c.returnconn(c.myconn); SqlCommand command = new SqlCommand("select max(publishcode) from tbl_publisher", c.myconn); command.CommandTimeout = 120; Int32 mstudentno; mstudentno = 1001; if (command.ExecuteScalar() != System.DBNull.Value) { mstudentno = Convert.ToInt32(command.ExecuteScalar()) + 1; } }
private void frmsankay_Load(object sender, EventArgs e) { c.btnenable(btnnew, btnedit, btndelete, btnsave, btncancel, btnprint, null); c.getconnstr(); c.FillcomboBox("select * from tbl_district order by district", "district", "distcode", ref valcmbdistrict); c.FillListBox("select * from tbl_tehsil order by tehsil", "tehsil", "tehcode", ref listBox1); c.returnconn(c.myconn); SqlCommand command = new SqlCommand("select max(tehcode) from tbl_tehsil", c.myconn); command.CommandTimeout = 120; Int32 mstudentno; mstudentno = 1001; if (command.ExecuteScalar() != System.DBNull.Value) { mstudentno = Convert.ToInt32(command.ExecuteScalar()) + 1; } }
private void frmNewEmployee_Load(object sender, EventArgs e) { try { img = imgemployee.Image; imgClear = img; c.getconnstr(); DataSet dsEmpType = Connection.GetDataSet("SELECT EmpTypeId, Detail, allowleaves FROM tbl_EmployeeType"); if (dsEmpType != null) { cmbEmpType.DataSource = dsEmpType.Tables[0]; cmbEmpType.DisplayMember = "Detail"; cmbEmpType.ValueMember = "EmpTypeId"; cmbEmpType.Text = "-Select-"; } txtEmployeeNo.Text = Connection.NewCode("EMP"); EnabledFalseAllControl(); Connection.SetUserLevelAuth(c.GetMdiParent(this)); } catch (Exception ex) { } }
public override void btnsave_Click(object sender, EventArgs e) { c.getconnstr(); i = 0; c.returnconn(c.myconn); SqlTransaction trn; trn = c.myconn.BeginTransaction(); try { Connection.AllPerform("delete tbl_hostelroom where hostelcode='" + valcmbclass.SelectedValue + "'"); Connection.AllPerform("delete tbl_roomdet where hostelcode='" + valcmbclass.SelectedValue + "'"); do { string mysql = ""; if (dtgbook.Rows[i].Cells[0].Value != null) { mysql = "insert into tbl_hostelroom (hostelcode,roomno,totalbeds) values (" + valcmbclass.SelectedValue + "," + dtgbook.Rows[i].Cells[0].Value + "," + dtgbook.Rows[i].Cells[1].Value + ")"; c.connectsql(mysql, c.myconn, trn); } if (dtgbook.Rows[i].Cells[1].Value != null) { int totbed = Convert.ToInt16(dtgbook.Rows[i].Cells[1].Value); for (int j = 0; j < totbed; j++) { string bedno = ""; switch (j) { case 0: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-A"; break; case 1: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-B"; break; case 2: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-C"; break; case 3: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-D"; break; case 4: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-E"; break; case 5: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-F"; break; case 6: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-G"; break; case 7: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-H"; break; case 8: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-I"; break; case 9: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-J"; break; case 10: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-K"; break; case 11: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-L"; break; case 12: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-M"; break; case 13: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-N"; break; case 14: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-O"; break; case 15: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-P"; break; case 16: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-Q"; break; case 17: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-R"; break; case 18: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-S"; break; case 19: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-T"; break; case 20: bedno = dtgbook.Rows[i].Cells[0].Value.ToString() + "-U"; break; default: break; } mysql = "insert into tbl_roomdet(hostelcode,roomno,bedno) values (" + valcmbclass.SelectedValue + "," + dtgbook.Rows[i].Cells[0].Value + ",'" + bedno + "')"; c.connectsql(mysql, c.myconn, trn); } // } // } } i++; // } // else { MessageBox.Show("Duplicate Data Not Allowed"); } }while (i <= dtgbook.Rows.Count - 1); trn.Commit(); MessageBox.Show("Data Saved..", "School"); //} //else { MessageBox.Show("duplicate entry not allowed"); } } catch (Exception ex) { MessageBox.Show(ex.Message); trn.Rollback(); } }
private void TrialBalance_Load(object sender, EventArgs e) { c.getconnstr(); }
private void frmCashBook_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select BHM_DESH,GRP_COD,BHM_COD from tbl_LedgerAcc where BHM_COD=1 order by BHM_DESH", "BHM_DESH", "BHM_COD", ref valcmbcash); SqlConnection con = c.myconn; }
private void FrmCashBook_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select acname,accode from tbl_account where actype=dbo.GetAccountCode('C') order by acname", "acname", "accode", ref valcmbcash); c.FillcomboBox("select acname,accode from tbl_account where actype=dbo.GetAccountCode('B') order by acname", "acname", "accode", ref valcmbbank); }
private void frmJournalLedger_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select BHM_DESH,BHM_COD from tbl_LedgerAcc where GRP_COD not in(1,2) order by BHM_DESH", "BHM_DESH", "BHM_COD", ref valcmbcash); SqlConnection con = c.myconn; }
private void FrmTrialBalance_Load(object sender, EventArgs e) { c.getconnstr(); SqlConnection con = c.myconn; }
private void FmTitle_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select * from tbl_book", "bookname", "bookno", ref valcmbbook); }
public void btnsave_Click(object sender, EventArgs e) { try { int ricept; int Payment; ricept = Convert.ToInt32(txtReciept.Text); Payment = Convert.ToInt32(txtPayment.Text); if (ricept != Payment) { MessageBox.Show("Payment Amount and Reciept Amount Does not Match...Entry Cannot Saved.."); } else { c.getconnstr(); c.returnconn(c.myconn); txtvchtype.Text = "JV"; if (add_edit == true) { SqlConnection con = c.myconn; DateTime dt = dtp.Value; Int32 VchNo = c.getvchno(txtvchtype.Text, ref dt, con); vouchNo = c.getvouchernumber(txtvchtype.Text, ref dt, con); //txtvchtype.Text + dtp.Value.Date.ToString("ddMMyyyy") + VchNo; txtvoucherno.Text = vouchNo; SqlTransaction trn; trn = c.myconn.BeginTransaction(); try { string mysql; mysql = "insert into tbl_Voucher(yearno,VchNo,VouchNo,VchType,VchDate,Remark,status)values('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dtp.Value.Date + "','" + txtRemark.Text + "','AE')"; c.connectsql(mysql, c.myconn, trn); for (int i = 0; i < dataGridView1.Rows.Count; i++) { decimal pay = Convert.ToInt32(dataGridView1.Rows[i].Cells["Payment"].Value); decimal rec = Convert.ToInt32(dataGridView1.Rows[i].Cells["Reciept"].Value); if (pay == 0) { mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "','" + rec + "')"; } else { mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "','" + -1 * pay + "')"; } c.connectsql(mysql, c.myconn, trn); } trn.Commit(); MessageBox.Show("Record Saved..."); } catch (Exception ex) { MessageBox.Show(ex.Message); trn.Rollback(); } } if (add_edit == false) { c.getconnstr(); c.returnconn(c.myconn); SqlDataReader dr = null; con = c.myconn; dr = c.fillreader(ref dr, "select VchNo from tbl_Voucher where vchtype='JV' and VouchNo='" + txtvoucherno.Text + "'", con); if (dr.HasRows == true) { dr.Read(); VchNo = Convert.ToInt16(dr[0]); if (dr[1] == "AE") { MessageBox.Show("Voucher Not Made from Account Entry..."); dr.Close(); goto mline; } } dr.Close(); SqlTransaction trn; trn = c.myconn.BeginTransaction(); try { string mysql; mysql = "delete from tbl_Voucher where vchtype='JV' and VouchNo='" + txtvoucherno.Text + "'"; c.connectsql(mysql, c.myconn, trn); mysql = "delete from tbl_VoucherDetail where vchtype='JV' and VouchNo='" + txtvoucherno.Text + "'"; c.connectsql(mysql, c.myconn, trn); for (int i = 0; i < dataGridView1.Rows.Count; i++) { decimal pay = Convert.ToInt32(dataGridView1.Rows[i].Cells["Payment"].Value); decimal rec = Convert.ToInt32(dataGridView1.Rows[i].Cells["Reciept"].Value); if (pay == 0) { mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "'," + rec + "')"; } else { mysql = "insert into tbl_VoucherDetail (yearno,vchno,VouchNo,VchType,AccCode,VchDate,Amount) values ('" + school.CurrentSessionCode + "','" + VchNo + "','" + vouchNo + "','" + txtvchtype.Text + "','" + dataGridView1.Rows[i].Cells["ACCOUNT"].Value.ToString() + "','" + dtp.Value.Date + "'," + -1 * pay + "')"; } c.connectsql(mysql, c.myconn, trn); } trn.Commit(); MessageBox.Show("Record Update..."); } catch (Exception ex) { MessageBox.Show(ex.Message); trn.Rollback(); } trn.Dispose(); } mline: c.GetMdiParent(this).EnableAllEditMenuButtons(); DesignForm.fromDesign1(this); } } catch { } }
private void FrmVaccent_Load(object sender, EventArgs e) { c.getconnstr(); c.FillcomboBox("select hostelcode,hostelname from tbl_hostel order by hostelname", "hostelname", "hostelcode", ref valcmbclass); c.GetMdiParent(this).ToggleSaveButton(true); }