private void prcShowReport() { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); try { DataSourceName = "DataSet1"; FormCaption = "Report :: Monthly Attendance**..."; string SectId = "0", EmpId = "0", Band = "=All=", EmpType = "", SubSectId = "0"; EmpType = gridEmpType.ActiveRow.Cells["varName"].Value.ToString(); if (optCriteria.Value.ToString().ToUpper() == "All".ToUpper()) { } else if (optCriteria.Value.ToString().ToUpper() == "Section".ToUpper()) { SectId = gridSection.ActiveRow.Cells["SectId"].Value.ToString(); } else if (optCriteria.Value.ToString().ToUpper() == "Employee".ToUpper()) { EmpId = gridEmployeeID.ActiveRow.Cells["EmpId"].Value.ToString(); } else if (optCriteria.Value.ToString().ToUpper() == "Band".ToUpper()) { Band = gridBand.ActiveRow.Cells["varName"].Value.ToString(); } else if (optCriteria.Value.ToString().ToUpper() == "SubSec".ToUpper()) { SubSectId = gridSubSec.ActiveRow.Cells["SubSectId"].Value.ToString(); } rptQuery = "Exec rptAttendMonthlyB " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', " + SectId + ", '', '', " + EmpId + ",'" + Band + "','" + EmpType + "'," + SubSectId + ""; clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, rptQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); //clsReport.strReportPathMain = ReportPath; //clsReport.strQueryMain = rptQuery; //clsReport.strDSNMain = DataSourceName; //clsReport.dsReport = dsDetails; //FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { rptQuery = null; DataSourceName = null; DataSourceName = null; ReportPath = null; dsDetails = null; } }
private void prcSaveData(DataSet ds) { clsConnection clsCon = new clsConnection(); ArrayList arQuery = new ArrayList(); try { // Clear Existing Data string query = "Truncate Table tblDN_xls"; clsCon.GTRSaveDataWithSQLCommand(query); txtProcessNo.Text = DateTime.Now.ToString("yyyyMMddHHmmss"); string dtProcess = DateTime.Today.ToString("dd-MMM-yyyy"); //Generating Insert Statement Row By Row for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i][0].ToString().Replace("'", "").Length > 0) { string sqlQuery = "Insert Into tblDN_xls (ComId, xlsFileName, dtProcess, EntryNo, Consignee, BookingNo, Carrier, FVessel, ETDCGP, ETAHub, MVessel, ETDHub, ETADestination, ContainerNo, " + " SealNo, Size, Type, Shipper, PO, ItemNo, ttlCartoon, ttlPCS, ttlCBM, ttlGrossWT, Mode, ttlLP, dtRcvdCGO, dtDocRcvd, dtStuffing, " + " Desitnation, ShipBillNo, VAT, HBLNo, OBLNo, Remarks, PayTerms, NoOfOriginal) " + " Values(" + Common.Classes.clsMain.intComId + ",'" + txtFileName.Tag.ToString() + "', '" + dtProcess + "','" + txtProcessNo.Text.ToString() + "', '" + ds.Tables[0].Rows[i][0].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][1].ToString().Replace("'", "") + "','" + ds.Tables[0].Rows[i][2].ToString().Replace("'", "") + "', " + " '" + ds.Tables[0].Rows[i][3].ToString().Replace("'", "") + "', '" + clsProc.GTRDate(ds.Tables[0].Rows[i][4].ToString().Replace("'", "")) + "', " + " '" + ds.Tables[0].Rows[i][5].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][6].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][7].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][8].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][9].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][10].ToString().Replace("'", "") + "', " + " '" + ds.Tables[0].Rows[i][11].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][12].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][13].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][14].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][15].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][16].ToString().Replace("'", "").Replace("NA", "0").Replace("N/A", "0") + "', " + " '" + ds.Tables[0].Rows[i][17].ToString().Replace("'", "").Replace("NA", "0").Replace("N/A", "0") + "', '" + ds.Tables[0].Rows[i][18].ToString().Replace("'", "").Replace("NA", "0").Replace("N/A", "0") + "', '" + ds.Tables[0].Rows[i][19].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][20].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][21].ToString().Replace("'", "").Replace("NA", "0").Replace("N/A", "0") + "', '" + ds.Tables[0].Rows[i][22].ToString().Replace("'", "") + "', " + " '" + ds.Tables[0].Rows[i][23].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][24].ToString().Replace("'", "''") + "', '" + ds.Tables[0].Rows[i][25].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][26].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][27].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][28].ToString().Replace("'", "") + "', " + " '" + ds.Tables[0].Rows[i][29].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][30].ToString().Replace("'", "''") + "', '" + ds.Tables[0].Rows[i][31].ToString().Replace("'", "") + "', '" + ds.Tables[0].Rows[i][32].ToString().Replace("'", "") + "')"; arQuery.Add(sqlQuery); } } //Transaction with database server clsCon.GTRSaveDataWithSQLCommand(arQuery); } catch (Exception ex) { throw (ex); } finally { arQuery = null; clsCon = null; } }
private void cboAddList_Click(object sender, EventArgs e) { if (fncBlank()) { return; } if (optCriteria.Value == "All") { Data = ""; } else if (optCriteria.Value == "EmpID") { Data = cboEmpID.Value.ToString(); } else if (optCriteria.Value == "Sec") { Data = cboSection.Value.ToString(); } else if (optCriteria.Value == "ShiftTime") { Data = cboShiftTime.Value.ToString(); } else if (optCriteria.Value == "Status") { Data = cboStatus.Text.ToString(); } else if (optCriteria.Value == "Missing") { Data = "Missing"; } GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsDetails = new System.Data.DataSet(); try { string sqlQuery = "Exec [prcGetFixAttBuyer] 1," + Common.Classes.clsMain.intComId + ",'" + optCriteria.Value + "','" + strValue + "','" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "','" + clsProc.GTRDate(dtInputToDate.Value.ToString()) + "' "; clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, sqlQuery); dsDetails.Tables[0].TableName = "tblFixData"; gridList.DataSource = null; gridList.DataSource = dsDetails.Tables["tblFixData"]; gridList.DisplayLayout.Bands[0].Columns["ShiftId"].ValueList = uddShift; if (dsDetails.Tables["tblFixData"].Rows.Count > 0) { btnFillData.Enabled = true; groupData.Enabled = true; cboStatus1.Text = "P"; dtTimeIn.Text = "00:00"; dtTimeOut.Text = "00:00"; dtOT.Text = "0.00"; } else { MessageBox.Show("No Data Found."); } // this.gridList.DisplayLayout.Bands[0].Columns["Timeout"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Time; // this.gridList.DisplayLayout.Bands[0].Columns["Timeout"].Format = "HH:mm"; } catch (Exception ex) { MessageBox.Show(ex.Message); // throw; } finally { clsCon = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); string sqlQuery = ""; Int32 NewId = 0; Int32 intId = 0; //Value update with number of rows affected in sql server try { //Member Master Table if (btnSave.Text.ToString() != "&Save") { //Update sqlQuery = "Delete From [tblSubtmp_Data] Where TmpId = " + double.Parse(txtId.Text.ToString()) + ""; arQuery.Add(sqlQuery); foreach (UltraGridRow row in gridTemp.Rows) { if (row.Cells["SubjectId"].Text.ToString().Length == 0) { break; } Int32 RowId = row.Index + 1; sqlQuery = "Insert Into tblSubtmp_Data ( comId,tmpId,subId, subCode, marks,RowNo) " + " Values (" + clsMain.intComId + ", " + txtId.Text.ToString() + ", " + row.Cells["SubjectId"].Value.ToString() + ", '" + row.Cells["subjectCode"].Value.ToString() + "', " + row.Cells["marks"].Text.ToString() + ", " + RowId + ")"; arQuery.Add(sqlQuery); } //Insert Information To Log File sqlQuery = "Insert Into GTRSystem.dbo.tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Update')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Succefully"); } else { //NewId sqlQuery = "Select Isnull(Max(TmpId),0)+1 As NewId from tblsubTmp_Data"; NewId = clsCon.GTRCountingData(sqlQuery); foreach (UltraGridRow row in gridTemp.Rows) { if (row.Cells["SubjectId"].Text == "") { break; } Int32 RowId = row.Index + 1; sqlQuery = "Insert Into tblSubtmp_Data ( comId,tmpId,subId,subCode, marks, RowNo) " + " Values (" + clsMain.intComId + ", " + NewId + ", " + row.Cells["SubjectId"].Value.ToString() + ", '" + row.Cells["subjectCode"].Value.ToString() + "','" + row.Cells["marks"].Value.ToString() + "', " + RowId + ")"; arQuery.Add(sqlQuery); } sqlQuery = "Insert Into tblSubTmp_info (comId, TmpId, dtCreate, ClassId, Description, sesn, ttlExam, LUserId ) " + " Values (" + clsMain.intComId + ", " + NewId + ", '" + clsProc.GTRDate(dtCreate.Value.ToString()) + "'," + cboClass.Value.ToString() + ",'" + txtDescription.Text.ToString() + "', '" + cbosesn.Text.ToString() + "', '" + cboExam.Text.ToString() + "', " + clsMain.intUserId + ")"; arQuery.Add(sqlQuery); //Insert Information To Log File sqlQuery = "Insert Into GTRSystem.dbo.tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Succefully"); } prcClearData(); txtTempNo.Focus(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); try { string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = ""; DataSourceName = "DataSet1"; FormCaption = "Report :: Employee Information ..."; string SectId = "0", type = "", EmpId = "0", Status = "0"; SectId = gridArea.ActiveRow.Cells["SectId"].Value.ToString(); Status = gridEmpStatus.ActiveRow.Cells["EmpStatus"].Value.ToString(); type = gridEmpType.ActiveRow.Cells["EmpType"].Value.ToString(); // gridSection.ActiveRow.Cells["SectId"].Value.ToString(); ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptEmpList.rdlc"; SQLQuery = "Exec rptEmpCasual " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtTo.Value.ToString()) + "', " + SectId + " , '" + Status + "', 0 ,'" + type + "' "; clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); //clsReport.strReportPathMain = ReportPath; //clsReport.strQueryMain = SQLQuery; //clsReport.strDSNMain = DataSourceName; //clsReport.dsReport = dsDetails; //FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { clsCon = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection("GTRHRIS"); string sqlQuery = ""; Int32 NewId = 0; //string sqlQuery = ""; Int32 RowID; try { //Member Master Table if (btnSave.Text.ToString() != "&Save") { try { foreach (UltraGridRow row in this.gridList.Rows) { if (row.Cells["isChecked"].Value.ToString() == "1") { sqlQuery = " Delete tblExamMark_Info where empid = '" + row.Cells["empid"].Text.ToString() + "' and sesn = '" + cboSesn.Text.ToString() + "' and classId = '" + cboClass.Value.ToString() + "' and ExamId = '" + cboType.Value.ToString() + "' "; arQuery.Add(sqlQuery); sqlQuery = "insert into tblExamMark_Info (ComId, empId,EmpCode, EmpName,sesn,ClassId,ExamId, SubId, SubTtlMark, GetMark, dtInput,PCName)" + "values (" + clsMain.intComId + ", '" + row.Cells["empid"].Text.ToString() + "', '" + row.Cells["EmpCode"].Value.ToString() + "', '" + row.Cells["EmpName"].Value.ToString() + "', '" + cboSesn.Text.ToString() + "','" + cboClass.Value.ToString() + "', '" + cboType.Value.ToString() + "', '" + cboSub.Value.ToString() + "','" + row.Cells["marks"].Value.ToString() + "','" + row.Cells["GetMark"].Value.ToString() + "','" + clsProc.GTRDate(dtInput.Value.ToString()) + "','" + clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); } } clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Update Successfully"); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } finally { clsCon = null; }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int64 NewId = 0; Int64 ChkCard = 0; DateTime firstDay = new DateTime(dtCardAssign.DateTime.Year, dtCardAssign.DateTime.Month, 1); dtFrom.Value = firstDay; sqlQuery = "Select dbo.fncCheckCardAssign (" + Common.Classes.clsMain.intComId + ", '" + this.txtCard.Text.ToString() + "')"; ChkCard = clsCon.GTRCountingDataLarge(sqlQuery); if (ChkCard == 1) { MessageBox.Show("This Employee Card already Exist. Please input another Punch Card Number."); return; } try { //Update data sqlQuery = "Update tblEmp_Info Set CardNo = '" + txtCard.Text.ToString() + "' + 'Rel' Where ComId = " + Common.Classes.clsMain.intComId + " and CardNo = '" + txtCard.Text.ToString() + "' and Len(CardNo)=10 and isinactive = 1"; arQuery.Add(sqlQuery); sqlQuery = "Update tblEmp_Info Set dtCardAssign = '" + clsProc.GTRDate(dtCardAssign.Value.ToString()) + "',CardNo = '" + txtCard.Text.ToString() + "' Where ComId = " + Common.Classes.clsMain.intComId + " and EmpId = " + Int32.Parse(txtId.Text.ToString()); arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, PCName, tranType,EmpId)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Update','" + txtId.Value.ToString() + "')"; arQuery.Add(sqlQuery); sqlQuery = "Update R Set R.EmpId = E.EmpId from tblRawData R,tblEmp_Info E Where R.CardNo = E.CardNo and E.CardNo = '" + txtCard.Text.ToString() + "' and R.dtPunchDate >= '" + clsProc.GTRDate(dtFrom.Value.ToString()) + "' and E.ComId = " + Common.Classes.clsMain.intComId + ""; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Succefully."); prcClearData(); txtEmpCode.Focus(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void prcShowAbsent(string Param) { try { DataSourceName = "DataSet1"; FormCaption = "Report :: Absent Information..."; string SectId = "0", DesigId = "0", ShiftId = "0", EmpId = "0"; if (optCriteria.Value.ToString().ToUpper() == "All".ToUpper()) { } else if (optCriteria.Value.ToString().ToUpper() == "Section".ToUpper()) { SectId = gridSection.ActiveRow.Cells["SectId"].Value.ToString(); } if (optCriteria.Value.ToString().ToUpper() == "Employee".ToUpper()) { EmpId = gridEmployeeID.ActiveRow.Cells["EmpId"].Value.ToString(); } rptQuery = "Exec rptAttend " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', " + ShiftId + ", " + DesigId + ", " + SectId + ", '', '', " + EmpId + ",'" + Param + "'"; clsReport.strReportPathMain = ReportPath; clsReport.strQueryMain = rptQuery; clsReport.strDSNMain = DataSourceName; FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { rptQuery = null; DataSourceName = null; DataSourceName = null; // ReportPath = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int32 NewId = 0; //string sqlQuery = ""; Int32 RowID; try { //Member Master Table if (btnSave.Text.ToString() != "&Save") { //Update data //sqlQuery = " Update tblEmp_Released Set relDate = '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "' Where RelID = " + Int32.Parse(txtId.Text.ToString()); //arQuery.Add(sqlQuery); //// Insert Information To Log File //sqlQuery= "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" // + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Update')"; //arQuery.Add(sqlQuery); ////Transaction with database //clsCon.GTRSaveDataWithSQLCommand(arQuery); //MessageBox.Show("Data Updated Succefully."); } else { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridList.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { //RowID = row.Index + 1; ///CONVERT(VARCHAR,OtHour,108) AS FROM tblAttfixed As A sqlQuery = " Delete tblAttfixed where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblAttfixed(empid,dtPunchDate,TimeIn,TimeOut,OtHour,Status,Remarks,Luserid,comid,pcname) " + " Values ('" + row.Cells["empid"].Text.ToString() + "', '" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["timein"].Text.ToString() + "','" + row.Cells["timeout"].Text.ToString() + "','" + row.Cells["otHour"].Value.ToString() + "','" + row.Cells["Status"].Value.ToString() + "','Fix Attendance - ' + '" + row.Cells["Remarks"].Value.ToString() + "'," + Common.Classes.clsMain.intUserId + "," + Common.Classes.clsMain.intComId + ",'" + Common.Classes.clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); } } sqlQuery = " exec [prcProcessAttendFix] " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "' "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Succefully."); } prcClearData(); cboEmpID.Focus(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlankA() == true) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new DataSet(); int NewID, slno; string AdmID; string sqlQuery; try { if (txtAdmsnID.Text.Length > 0) { sqlQuery = "update tblAdm_Form set frmNo='" + txtFormNo.Text.ToString() + "', nmFirst='" + txtNm.Text + "', nmMiddle='" + txtMn.Text + "', nmLast='" + txtLn.Text.Trim() + "', nmFather='" + txtFatherNm.Text.Trim() + "', nmMother='" + txtMotherNm.Text.Trim() + "', sesn='" + txtSesion.Text.Trim() + "',frmTakenDt='" + clsProc.GTRDate(dtAdmsn.Value.ToString()) + "',clsid='" + cboAdmisnFor.Value.ToString() + "', sex = '" + cboSex.Text.Trim() + "', relegion = '" + cboReligion.Text.Trim() + "',mobile = '" + txtMobile.Text.Trim() + "',Phone = '" + txtPhone.Text.Trim() + "', amount = " + txtAmt.Text.Trim() + ",Reference = '" + txtReferrance.Text.Trim() + "',remarks = '" + txtFrmRemarks.Text.Trim() + "' " + " where admid='" + txtAdmsnID.Text + "'"; arQuery.Add(sqlQuery); sqlQuery = "Insert Into GTRSystem.dbo.tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','UPDATE')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Update Successfully"); } else { NewID = 0; slno = 0; //Select ISNULL(max((right(frmNoAuto,6))),100000 )+1 as NewID from tblAdm_Form sqlQuery = "Select ISNULL(max(frmNoAuto),100000 )+1 as NewID from tblAdm_Form"; AdmID = clsCon.GTRCountingData(sqlQuery).ToString(); // string addata =AdmID.ToString().Substring(4, 6); sqlQuery = "Select convert(int,ISNULL(max(AdmId),0 )+1) as NewID from tblAdm_Form"; NewID = clsCon.GTRCountingData(sqlQuery); //sqlQuery = "Select convert(int,ISNULL(max(slno),0 )+1) as slno from tblAdm_Form where sesn = '"+ txtSesion.Text +"' and clsId = '"+cboClas.Value.ToString()+ "'"; sqlQuery = "Select convert(int,ISNULL(max(slno),0 )+1) as slno from tblAdm_Form where sesn = '" + txtSesion.Text + "'"; slno = clsCon.GTRCountingData(sqlQuery); sqlQuery = "Insert Into tblAdm_Form (sesn,AdmId,slno, frmNo, frmNoAuto,nmFirst, nmMiddle, nmLast, nmFather, nmMother, clsid, yrNm,frmTakenDt,Address,sex,relegion,phone,mobile,amount,Reference,remarks)"; sqlQuery = sqlQuery + "values('" + txtSesion.Text.Trim() + "'," + NewID + "," + slno + ",'" + txtFormNo.Text.Trim() + "'," + AdmID + ",'" + txtNm.Text.Trim() + "','" + txtMn.Text.Trim() + "','" + txtLn.Text.Trim() + "','" + txtFatherNm.Text.Trim() + "','" + txtMotherNm.Text.Trim() + "','" + cboAdmisnFor.Value.ToString() + "','" + txtSesion.Text.Trim() + "','" + clsProc.GTRDate(dtAdmsn.Value.ToString()) + "','" + txtAddress.Text + "','" + cboSex.Text + "','" + cboReligion.Text + "','" + txtPhone.Text + "','" + txtMobile.Text + "','" + txtAmt.Text + "','" + txtReferrance.Text + "','" + txtFrmRemarks.Text + "')"; arQuery.Add(sqlQuery); sqlQuery = "Insert Into GTRSystem.dbo.tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Insert')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Successfully"); } PrcCleraData(); PrcLoadList(); PrcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { clsCon = null; arQuery = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int32 NewId = 0; //string sqlQuery = ""; Int32 RowID; try { //Member Master Table if (btnSave.Text.ToString() != "&Save") { } else { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridList.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { //RowID = row.Index + 1; ///CONVERT(VARCHAR,OtHour,108) AS FROM tblOTPermission As A sqlQuery = " Delete tblTempCount;Insert into tblTempCount(EmpID,Cnt,DateTime1) Select EmpID,OTHour,dtPunchDate from tblOTPermission where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Delete tblOTPermission where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblOTPermission(empid,dtPunchDate,OtHour,Remarks,Luserid,comid,pcname,Approval) " + " Values ('" + row.Cells["empid"].Text.ToString() + "', '" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["otHour"].Value.ToString() + "',' ' + '" + row.Cells["Remarks"].Value.ToString() + "'," + Common.Classes.clsMain.intUserId + "," + Common.Classes.clsMain.intComId + ",'" + Common.Classes.clsMain.strComputerName + "','Y')"; arQuery.Add(sqlQuery); sqlQuery = " Update O Set O.PrevOTHour = T.Cnt from tblOTPermission O,tblTempCount T Where O.EmpID = T.EmpID and O.dtPunchDate = T.DateTime1 and O.Approval = 'Y' and O.empid = '" + row.Cells["empid"].Text.ToString() + "' and O.dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); } } sqlQuery = " exec [prcProcessOTPermission] " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "','" + clsProc.GTRDate(dtInputToDate.Value.ToString()) + "' "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, PCName,tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Succefully."); } prcClearData(); cboDept.Focus(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); try { DataSourceName = "DataSet1"; FormCaption = "Report :: Cadre Summary Unit.."; string ProssType = "", Rpt = ""; ProssType = gridProssType.ActiveRow.Cells["ProssType"].Value.ToString(); Rpt = gridReportCategory.ActiveRow.Cells["rptName"].Value.ToString(); if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Cadre Summary")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptCadreSumUnit.rdlc"; rptQuery = "Exec rptCadreSumUnit " + Common.Classes.clsMain.intComId + ",'" + ProssType + "','" + clsProc.GTRDate(dtPross.Value.ToString()) + "',0,2"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Cadre Status")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptCadreSumStatusUnit.rdlc"; rptQuery = "Exec rptCadreSumUnit " + Common.Classes.clsMain.intComId + ",'" + ProssType + "','" + clsProc.GTRDate(dtPross.Value.ToString()) + "',0,3"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Position wise Cadre List")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptCadrePositionList.rdlc"; rptQuery = "Exec rptCadreSumUnit " + Common.Classes.clsMain.intComId + ",'" + ProssType + "','" + clsProc.GTRDate(dtPross.Value.ToString()) + "','" + cboPosition.Value.ToString() + "',4"; } clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, rptQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.strQueryMain = rptQuery; clsReport.strDSNMain = DataSourceName; clsReport.dsReport = dsDetails; FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { rptQuery = null; DataSourceName = null; DataSourceName = null; ReportPath = null; dsDetails = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new clsConnection(); string sqlQuery = ""; Int32 NewId = 0; try { if (dtFest.Value != null) { dtFest.Value = clsProc.GTRDate(dtFest.Value.ToString()); } //Member Master Table if (txtDollarRate.Text.Length != 0) { //Update arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + GTRHRIS.Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Update')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Successfully"); } else { //NewId sqlQuery = "Select Isnull(Max(IncId),0)+1 As NewId from tblEmp_Incr"; NewId = clsCon.GTRCountingData(sqlQuery); //Insert Data sqlQuery = "INSERT into dbo.tblEmp_Incr(IncId, IncType, EmpId, dtInc, Amount, Percentage, OldSal, CurrSal, OldDesigId, NewDesigId, HR, TA, FA, PBns, OldSectId, NewSectId, OldGrade, NewGrade, OldOTstatus, NewOTstatus, OldStatus, NewStatus, newSectIdSal, OldSectIdSal, IsInactive, ComId, LUserId, PCName)" + " Values (" + NewId + ",'" + clsProc.GTRDate(dtFest.Value.ToString()) + "'" + " ," + txtDollarRate.Text + ",'" + txtPer.Text + ",'" + Common.Classes.clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + GTRHRIS.Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Successfully"); } prcClearData(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = ""; DataSourceName = "DataSet1"; FormCaption = "Report :: Leave Information..."; if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "General".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveList.rdlc"; SQLQuery = "Exec rptLeave " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', '" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','=ALL=','General'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "ML".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveList.rdlc"; SQLQuery = "Exec rptLeave " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', '" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "', 'ML'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "FirstML".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveList.rdlc"; SQLQuery = "Exec rptLeave " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', '" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "', 'FirstML'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "LastML".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveList.rdlc"; SQLQuery = "Exec rptLeave " + Common.Classes.clsMain.intComId + ", '" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "', '" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "', '" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "', 'LastML'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "Details".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveDetails.rdlc"; SQLQuery = "Exec rptLeaveBalance " + Common.Classes.clsMain.intComId + ", '" + cboFinyear.Value.ToString() + "', '" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "', 'Details'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "Summary".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveSum.rdlc"; SQLQuery = "Exec rptLeaveBalance " + Common.Classes.clsMain.intComId + ", " + cboFinyear.Value.ToString() + ",'" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "','Summary'"; } else if (gridCriteria.ActiveRow.Cells[0].Value.ToString().ToUpper() == "MonthDetails".ToUpper()) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptLeaveMonthDetails.rdlc"; SQLQuery = "Exec rptLeaveBalanceDetails " + Common.Classes.clsMain.intComId + ", " + cboFinyear.Value.ToString() + ",'" + (gridSec.ActiveRow.Cells["sectid"].Value.ToString()) + "', '" + (gridEmp.ActiveRow.Cells["empid"].Value.ToString()) + "','" + (gridActive.ActiveRow.Cells["SL"].Value.ToString()) + "','" + (gridEmpType.ActiveRow.Cells["varName"].Value.ToString()) + "', 'MonthDetails'"; } clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); string sqlQuery = ""; Int32 NewId = 0; Int32 MonthId = 0; Int32 CountRow = 0; DateTime lastDay = new DateTime(dtInputeDate.DateTime.Year, dtInputeDate.DateTime.Month, 1); lastDay = lastDay.AddMonths(1); lastDay = lastDay.AddDays(-(lastDay.Day)); dtInputeDate.Value = lastDay; try { if (btnSave.Text.ToString() != "&Save") { //Update sqlQuery = " Update tblCat_ExchangeRatePF Set dtInput = '" + clsProc.GTRDate(dtInputeDate.DateTime.ToString()) + "', ExchRate = '" + clsProc.GTRValidateDouble(txtExchangeRate.Text) + "' Where ExchId = '" + int.Parse(txtId.Text.ToString()) + "' "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, PCName, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Update')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Succefully"); } else { sqlQuery = "Select Isnull(Max(ExchId),0)+1 As NewId from tblCat_ExchangeRatePF"; NewId = clsCon.GTRCountingData(sqlQuery); //Insert to Table sqlQuery = " Insert Into tblCat_ExchangeRatePF (ComId, ExchId, dtInput, ExchRate, aId, PCName, LUserId) " + "Values('" + Common.Classes.clsMain.intComId + "','" + NewId + "','" + clsProc.GTRDate(dtInputeDate.Value.ToString()) + "','" + clsProc.GTRValidateDouble(txtExchangeRate.Text) + "','" + NewId + "','" + Common.Classes.clsMain.strComputerName + "','" + Common.Classes.clsMain.intUserId + "') "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, PCName, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Insert')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Succefully"); } prcClearData(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int32 NewId = 0; //DateTime lastDay = new DateTime(dtInputDate.DateTime.Year, dtInputDate.DateTime.Month, 1); //lastDay = lastDay.AddMonths(1); //lastDay = lastDay.AddDays(-(lastDay.Day)); //dtInputDate.Value = lastDay; try { //Member Master Table if (btnSave.Text.ToString() != "&Save") { //Update data sqlQuery = " Update tblEmp_ShortLeave Set dtInput = '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "', SrtHr = '" + clsProc.GTRValidateDouble(txtHr.Value.ToString()) + "',remarks = '" + txtRemarks.Text.ToString() + "' Where SrtId = " + Int32.Parse(txtId.Text.ToString()); arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement,PCName, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Update')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Succefully."); } else { sqlQuery = "Delete from tblEmp_ShortLeave Where EmpID = '" + cboEmpID.Value.ToString() + "' and dtInput = '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "'"; arQuery.Add(sqlQuery); //add new sqlQuery = "Select Isnull(Max(SrtId),0)+1 As NewId from tblEmp_ShortLeave"; NewId = clsCon.GTRCountingData(sqlQuery); //Insert data sqlQuery = "Insert Into tblEmp_ShortLeave ( empid,SrtId,aid, dtInput,SrtHr, Remarks,LUserId,comid ,PcName) " + " Values ('" + cboEmpID.Value.ToString() + "'," + NewId + ", " + NewId + ",'" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "', '" + clsProc.GTRValidateDouble(txtHr.Value.ToString()) + "', '" + txtRemarks.Text.ToString() + "'," + Common.Classes.clsMain.intUserId + "," + Common.Classes.clsMain.intComId + ",'" + Common.Classes.clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement,PCName, tranType)" + " Values (" + Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Succefully."); } prcClearData(); cboEmpID.Focus(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void prcLoadList() { clsConnection clscon = new clsConnection(); dsList = new System.Data.DataSet(); try { string sqlquary = "Exec [rptLoan] " + Common.Classes.clsMain.intComId + ", '','0','0','',0,'','" + clsProc.GTRDate(dtFrom.Value.ToString()) + "'"; clscon.GTRFillDatasetWithSQLCommand(ref dsList, sqlquary); dsList.Tables[0].TableName = "EmpType"; dsList.Tables[1].TableName = "Section"; dsList.Tables[2].TableName = "Employee"; dsList.Tables[3].TableName = "Band"; dsList.Tables[4].TableName = "ReportCategory"; gridProssType.DataSource = dsList.Tables["EmpType"]; gridSec.DataSource = dsList.Tables["Section"]; gridEmployee.DataSource = dsList.Tables["Employee"]; gridBand.DataSource = dsList.Tables["Band"]; gridReportCategory.DataSource = dsList.Tables["ReportCategory"]; DateTime lastDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); lastDay = lastDay.AddMonths(1); lastDay = lastDay.AddDays(-(lastDay.Day)); dtFrom.Value = lastDay; } catch (Exception ex) { throw (ex); } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = "", Band = "=All="; //EmpStatus = "=All=" DataSourceName = "DataSet1"; FormCaption = "Report :: Salary Information..."; Band = gridBand.ActiveRow.Cells["varName"].Value.ToString(); // EmpStatus = cboStatus.ActiveRow.Cells["EmpStatus"].Value.ToString(); if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Salary Sheet")) { if (cboStatus.Text == "=ALL=") { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySheetB3.rdlc"; SQLQuery = "Exec [rptSalarySheetB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if (cboStatus.Text == "Released") { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySheetB3.rdlc"; SQLQuery = "Exec [rptSalarySheetB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySheetB3.rdlc"; SQLQuery = "Exec [rptSalarySheetB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Salary Sheet Excel")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySheetExcel.rdlc"; SQLQuery = "Exec [rptSalarySheetB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Payslip")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptPayslipB3.rdlc"; SQLQuery = "Exec [rptSalarySheetPaySlipB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Data Check List")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptDataCheckList.rdlc"; SQLQuery = "Exec [rptSalaryDataCheckList] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Summary Sheet")) { if (cboStatus.Text == "=ALL=") { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySumB3.rdlc"; SQLQuery = "Exec [rptSalarySumB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if (cboStatus.Text == "Released") { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySumB2.rdlc"; SQLQuery = "Exec [rptSalarySumB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySumB3.rdlc"; SQLQuery = "Exec [rptSalarySumB3] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Individual Salary Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySheetSingle.rdlc"; SQLQuery = "Exec [rptSalarySheetInd] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Denomination")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySumDenomination.rdlc"; SQLQuery = "Exec [rptSalarySumDenomination] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Other Allowance Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAddition.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Other Allowance Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Addition Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAddition.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Addition Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Production Bonus")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAddition.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Production Bonus'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Loan Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryLoan.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Loan Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Advance Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAdvance.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Advance Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Income Tax")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAdvance.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Income Tax'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "PF Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryPF.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','PF Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Deduction Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryAdvance.rdlc"; SQLQuery = "Exec [rptSalaryAll] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Deduction Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Bank Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryBankACC.rdlc"; SQLQuery = "Exec [rptSalarySheetCadre] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Bank Sheet'"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Cadre Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryCadre.rdlc"; SQLQuery = "Exec [rptSalarySheetCadre] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','Cadre Sheet'"; } clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); //clsReport.strReportPathMain = ReportPath; //clsReport.strQueryMain = SQLQuery; //clsReport.strDSNMain = DataSourceName; //FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { if (fncBlank()) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new clsConnection(); string sqlQuery = ""; Int64 NewId = 0; try { //Member Master Table if (btnSave.Text != "&Save") { //Update sqlQuery = "Update tblProssType set ProssDt = '" + clsProc.GTRDate(this.dtProcess.Value.ToString()) + "', DaySts = '" + this.cboType.Text.ToString() + "', DayStsB = ' " + this.cboBuyer.Text.ToString() + "' where ComId = " + Common.Classes.clsMain.intComId + " and ProssDt = '" + clsProc.GTRDate(this.dtProcess.Value.ToString()) + "' "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + GTRHRIS.Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Update')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Updated Successfully"); } else { //NewId //sqlQuery = "Select Isnull(Max(EmpId),0)+1 As NewId from tblEmp_Info"; //NewId = clsCon.GTRCountingDataLarge(sqlQuery); //Insert Data sqlQuery = "Insert Into tblProssType (ComId,ProssDt, DaySts,DayStsB)" + " Values (" + Common.Classes.clsMain.intComId + ",'" + this.dtProcess.Value.ToString() + "', '" + this.cboType.Value.ToString() + "', '" + this.cboBuyer.Value.ToString() + "') "; arQuery.Add(sqlQuery); // Insert Information To Log File sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, tranType)" + " Values (" + GTRHRIS.Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Saved Successfully"); } prcLoadList(); prcLoadCombo(); prcClearData(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); clsConnection clsCon = new clsConnection(); try { DataSourceName = "DataSet1"; FormCaption = "Report :: Employee Details Information..."; string SQLQuery = ""; string SectId = "0", EmpId = "0", Datewise = "0"; if (optCriteria.Value.ToString().ToUpper() == "All".ToUpper()) { } else if (optCriteria.Value.ToString().ToUpper() == "Section".ToUpper()) { SectId = gridSection.ActiveRow.Cells["SectId"].Value.ToString(); } else if (optCriteria.Value.ToString().ToUpper() == "Employee".ToUpper()) { EmpId = gridEmployeeID.ActiveRow.Cells["EmpId"].Value.ToString(); } else if (optCriteria.Value.ToString().ToUpper() == "Date".ToUpper()) { Datewise = "1"; } if ((gridrptCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Employee Details")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Attendence\Reports\rptEmpDetails.rdlc"; SQLQuery = "Exec rptEmployeeDetails " + Common.Classes.clsMain.intComId + ", '" + SectId + "', '" + EmpId + "','" + Datewise + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "' "; } else if ((gridrptCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Service Book")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Letter\Reports\rptServiceBook.rdlc"; SQLQuery = "Exec rptEmployeeDetails " + Common.Classes.clsMain.intComId + ", '" + SectId + "', '" + EmpId + "','" + Datewise + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "' "; } clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { clsCon = null; } }
private void btnPreview_Click(object sender, EventArgs e) { dsDetails = new DataSet(); ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string ReportPath = "", SQLQuery = "", DataSourceName = "DataSet1", FormCaption = "", Band = ""; Band = ""; DataSourceName = "DataSet1"; FormCaption = "Report :: Earn Leave"; if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Earn Leave Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptEarnLeave.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',1"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Payslip")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptPaySlipEarnLeave.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',2"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Summary Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptEarnLeaveSum.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',3"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Denomination")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalarySumDenomination.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',4"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Bank Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryBankACC.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',5"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Released Earn Leave")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptEarnLeaveRel.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',6"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Released Payslip")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptPaySlipEarnLeave.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',7"; } else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Released Summary Sheet")) { ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptEarnLeaveSum.rdlc"; SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "', '" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',8"; } //else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Cadre Sheet")) //{ // ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryCadre.rdlc"; // SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "',6"; //} //else if ((gridReportCategory.ActiveRow.Cells["rptname"].Text.ToString() == "Band Cadre Sheet")) //{ // ReportPath = Common.Classes.clsMain.AppPath + @"\Payroll\Reports\rptSalaryCadreBand.rdlc"; // SQLQuery = "Exec [rptEarnLeave] " + Common.Classes.clsMain.intComId + ", '" + gridProssType.ActiveRow.Cells[0].Value.ToString() + "','" + cboPayMode.Value.ToString() + "', '" + cboEmpType.Value.ToString() + "','" + gridSec.ActiveRow.Cells[0].Value.ToString() + "','" + gridEmployee.ActiveRow.Cells[0].Value.ToString() + "','" + Band + "','" + cboStatus.Value.ToString() + "',7"; //} clsCon.GTRFillDatasetWithSQLCommand(ref dsDetails, SQLQuery); if (dsDetails.Tables[0].Rows.Count == 0) { MessageBox.Show("Data Not Found"); return; } clsReport.strReportPathMain = ReportPath; clsReport.dsReport = dsDetails; clsReport.strDSNMain = DataSourceName; Common.Classes.clsMain.strExtension = optFormat.Value.ToString(); Common.Classes.clsMain.strFormat = optFormat.Text.ToString(); FM.prcShowReport(FormCaption); //clsReport.strReportPathMain = ReportPath; //clsReport.strQueryMain = SQLQuery; //clsReport.strDSNMain = DataSourceName; //FM.prcShowReport(FormCaption); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void prcLoadList() { clsConnection clsCon = new clsConnection(); string sqlQuery = ""; dsList = new DataSet(); try { sqlQuery = "Exec prcGetSalAdvAll " + Common.Classes.clsMain.intComId + ", 0, 0,'','','" + clsProc.GTRDate(dtFrom.Value.ToString()) + "'"; clsCon.GTRFillDatasetWithSQLCommand(ref dsList, sqlQuery); dsList.Tables[0].TableName = "Grid"; dsList.Tables[1].TableName = "tblSect"; dsList.Tables[2].TableName = "tblBand"; dsList.Tables[3].TableName = "tblEmp"; gridDetails.DataSource = null; gridDetails.DataSource = dsList.Tables["Grid"]; this.dtFrom.Value = DateTime.Now; if (dtFrom.DateTime.Month == 1) { if (dtFrom.DateTime.Day <= 6) { var DaysInMonth = DateTime.DaysInMonth(dtFrom.DateTime.Year, dtFrom.DateTime.Month); var lastDay = new DateTime(dtFrom.DateTime.Year, dtFrom.DateTime.Month, DaysInMonth); dtFrom.Value = lastDay; } else { DateTime lastDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); lastDay = lastDay.AddMonths(1); lastDay = lastDay.AddDays(-(lastDay.Day)); dtFrom.Value = lastDay; } } else { if (dtFrom.DateTime.Day <= 6) { var DaysInMonth = DateTime.DaysInMonth(dtFrom.DateTime.Year, dtFrom.DateTime.Month - 1); var lastDay = new DateTime(dtFrom.DateTime.Year, dtFrom.DateTime.Month - 1, DaysInMonth); dtFrom.Value = lastDay; } else { DateTime lastDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); lastDay = lastDay.AddMonths(1); lastDay = lastDay.AddDays(-(lastDay.Day)); dtFrom.Value = lastDay; } } } catch (Exception ex) { throw (ex); } finally { clsCon = null; } }