private void btnSalProcessFull_Click(object sender, EventArgs e) { string SelDescription = ""; System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); string strMonthName = mfi.GetMonthName(dtLast.DateTime.Month).ToString(); SelDescription = strMonthName + "-" + (dtLast.DateTime.Year); btnSalProcessFull.Text = "Please Wait"; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new System.Data.DataSet(); string sqlQuery1 = ""; Int64 ChkLock = 0; sqlQuery1 = "Select dbo.fncProcessLock (" + Common.Classes.clsMain.intComId + ", 'Active Salary Lock','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "')"; ChkLock = clsCon.GTRCountingDataLarge(sqlQuery1); if (ChkLock == 1) { MessageBox.Show("Process Lock. Please communicate with Administrator."); return; } try { string sqlQuery = "Exec prcProcessSalary " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "','" + clsProc.GTRDate(dtPayment.Value.ToString()) + "','" + SelDescription + "'"; int i = clsCon.GTRSaveDataWithSQLCommand(sqlQuery); //string sqlQuery = "Exec prcProcessSalaryB " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "','" + clsProc.GTRDate(dtPayment.Value.ToString()) + "','" + SelDescription + "'"; //int i = clsCon.GTRSaveDataWithSQLCommand(sqlQuery); sqlQuery = "Insert Into tblUser_Trans_Log (LUserId, formName, tranStatement, PCName, tranType)" + " Values (" + GTRHRIS.Common.Classes.clsMain.intUserId + ", '" + this.Name.ToString() + "','" + sqlQuery.Replace("'", "|") + "','" + Common.Classes.clsMain.strComputerName + "','Process')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Process Complete"); btnSalProcessFull.Text = "Salary Process"; } catch (Exception ex) { throw (ex); } 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 = ""; 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 tblLeave_Balance where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtOpBal = '" + row.Cells["dtOpeningDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = "insert into tblLeave_Balance (EmpId, dtOpBal, CL,SL, EL, ML,ComID)" + "values ('" + row.Cells["empid"].Text.ToString() + "', '" + row.Cells["dtOpeningDate"].Text.ToString() + "', '" + row.Cells["CL"].Value.ToString() + "' , '" + row.Cells["SL"].Value.ToString() + "','" + row.Cells["EL"].Value.ToString() + "', '" + row.Cells["ML"].Value.ToString() + "'," + Common.Classes.clsMain.intComId + ")"; arQuery.Add(sqlQuery); } } 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 Update Successfully"); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } finally { clsCon = null; }
private void btnReceive_Click(object sender, EventArgs e) { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection("GTRHRIS"); string sqlQuery; try { foreach (UltraGridRow row in gridFrmRcv.Rows) { sqlQuery = "Update tblAdm_Form set IsReceive='" + row.Cells["RcvYN"].Value + "' where admID='" + row.Cells["admID"].Value + "' "; 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("'", "|") + "','Receive')"; arQuery.Add(sqlQuery); } clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Receive Form Successfully"); PrcCleraData(); PrcLoadList(); PrcLoadCombo(); } catch (Exception ex) { throw (ex); } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to Delete Addmisson information of [" + txtNm.Text + "]", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection("GTRHRIS"); try { string sqlQuery = "Delete tblAdm_Form where AdmID='" + txtAdmsnID.Text.ToString() + "'"; 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("'", "|") + "','Delete')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); PrcCleraData(); PrcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnProcess_Click(object sender, EventArgs e) { btnProcess.Text = "Please Wait"; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new System.Data.DataSet(); try { string sqlQuery = "Exec prcProcessMaindataInput " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtFirst.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "',0"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Attendance Data Insert Complete"); btnProcess.Text = "Process Data Input"; } catch (Exception ex) { throw (ex); } finally { clsCon = null; } }
private void btnActivate_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to Active [" + txtName.Text + "] as Current Employee", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string sqlQuery = ""; sqlQuery = "Delete from tblEmp_Released Where RelID = " + Int32.Parse(txtId.Text) + " and ComId = " + Common.Classes.clsMain.intComId + ""; arQuery.Add(sqlQuery); sqlQuery = " Update tblEmp_info Set IsInactive = 0,dtReleased = null Where empid = '" + cboEmpID.Value.ToString() + "' and ComId = " + Common.Classes.clsMain.intComId + ""; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(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 + "','Active','" + cboEmpID.Value.ToString() + "')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Activate Successfully."); prcClearData(); cboEmpID.Focus(); 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; //string sqlQuery = ""; Int32 RowID; try { //Member Master Table if (btnSave.Text.ToString() == "&Save") { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { sqlQuery = " Update tblNightAllow Set NightAbsent = '" + row.Cells["NightAbsent"].Text.ToString() + "',NightPay = '" + row.Cells["NightPay"].Text.ToString() + "',FoodPay = '" + row.Cells["FoodPay"].Text.ToString() + "',NetPay = '" + row.Cells["NetPay"].Text.ToString() + "' Where EmpID = '" + row.Cells["EmpID"].Text.ToString() + "' and ProssType = '" + row.Cells["ProssType"].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 + "','Insert')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Update Succefully."); } prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete Tiffin amount this Employee?", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int32 NewId = 0; //string sqlQuery = ""; Int32 RowID; try { if (btnDelete.Text.ToString() == " &Delete") { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.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 tblTiffin where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtDate = '" + clsProc.GTRDate(dtFrom.Value.ToString()) + "' and ComID = " + Common.Classes.clsMain.intComId + ""; 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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete SuccessFully"); prcClearData(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnCorrection_Click(object sender, EventArgs e) { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; try { //Member Master Table foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1" && row.Cells["Profit"].Value.ToString() != "0") { sqlQuery = " Update tblEmp_PF Set CLProfit = CLProfit - Profit,GrandTotal = GrandTotal-Profit,PayProfit = PayProfit - Profit,PayTotal = PayTotal - Profit Where EmpID = '" + row.Cells["EmpID"].Text.ToString() + "' and ProssType = '" + row.Cells["ProssType"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Update tblEmp_PF Set Profit = 0 Where EmpID = '" + row.Cells["EmpID"].Text.ToString() + "' and ProssType = '" + row.Cells["ProssType"].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); sqlQuery = "Exec PrcProcessPFManual " + Common.Classes.clsMain.intComId + ",'" + row.Cells["ProssType"].Text.ToString() + "','" + row.Cells["EmpID"].Text.ToString() + "',4"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); } } MessageBox.Show("Data Correction Complete Succefully."); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnAdvance_Click(object sender, EventArgs e) { if (fncBlankAdv()) { return; } string SelDescription = ""; System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); string strMonthName = mfi.GetMonthName(dtLast.DateTime.Month).ToString(); SelDescription = strMonthName + "-" + (dtLast.DateTime.Year); btnAdvance.Text = "Please Wait"; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new System.Data.DataSet(); string sqlQuery1 = ""; Int64 ChkLock = 0; sqlQuery1 = "Select dbo.fncProcessLock (" + Common.Classes.clsMain.intComId + ", 'Advance Salary Lock','" + clsProc.GTRDate(dtAdv.Value.ToString()) + "')"; ChkLock = clsCon.GTRCountingDataLarge(sqlQuery1); if (ChkLock == 1) { MessageBox.Show("Process Lock. Please communicate with Administrator."); return; } try { //string sqlQuery = "Exec prcProcessAdvanceSalary " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtAdv.Value.ToString()) + "','" + clsProc.GTRDate(dtLast.Value.ToString()) + "','" + clsProc.GTRDate(dtPayment.Value.ToString()) + "','" + SelDescription + "', '" + cboAdvType.Text.ToString() + "','" + cboAdvFestType.Text.ToString() + "','" + txtAdvRate.Value.ToString() + "','" + txtAdvPer.Value.ToString() + "'"; //int i = clsCon.GTRSaveDataWithSQLCommand(sqlQuery); string sqlQuery = "Exec prcProcessAdvanceSalary " + Common.Classes.clsMain.intComId + ",'" + clsProc.GTRDate(dtAdv.Value.ToString()) + "','" + clsProc.GTRDate(dtPayment.Value.ToString()) + "','" + SelDescription + "', '" + cboAdvType.Text.ToString() + "','" + cboAdvFestType.Text.ToString() + "','" + txtAdvRate.Value.ToString() + "','" + txtAdvPer.Value.ToString() + "'"; int i = clsCon.GTRSaveDataWithSQLCommand(sqlQuery); MessageBox.Show("Advance Salary Process Complete"); btnAdvance.Text = "Advance Process"; } catch (Exception ex) { throw (ex); } finally { clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to Delete Salary Advance [" + txtName.Text + "] this Employee", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string sqlQuery = ""; sqlQuery = "Delete from tblSal_Suspense Where advID = " + Int32.Parse(txtId.Text); arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(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("'", "|") + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Deleted Successfully."); prcClearData(); cboEmpID.Focus(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void prcDataInsert() { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; try { sqlQuery = " Truncate table tblCat_EmpData"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{52D44F79-9D3E-4D94-83EE-9E95958BA5B6}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{BE75A9EA-1866-4B5E-BA6C-8514306EAB3A}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{EBB99F66-64E8-4A54-B4F0-DD91625D575A}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{CF6A764C-9973-4261-8776-2C1AE77A5957}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{070C8678-CAD4-409B-BF6C-AC19788FAABA}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{90C2E947-8E49-4AE1-BBED-46D2CB2A4F30}'))"; arQuery.Add(sqlQuery); // sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{A1EE729B-9149-49D9-A73F-6B3CCE8D56C0}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{8A7C0217-0E5D-498D-BBA1-8891ECF7921B}'))"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblCat_EmpData(FIData) Select Convert(varchar(Max), dbo.fncDataFIEmpCheckET('{0FED0A3E-9F22-4E23-B3D5-3F6F70D1AFE5}'))"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); } 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("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 btnDelete_Click(object sender, EventArgs e) { if ( MessageBox.Show("Do you want to delete FixAttendance which are shown in the Grid", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { string sqlQuery = ""; foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridList.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0) { //RowID = row.Index + 1; ///CONVERT(VARCHAR,OtHour,108) AS FROM tblAttfixedB As A sqlQuery = " Delete tblAttfixedB where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Deleted Successfully."); prcClearData(); cboEmpID.Focus(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; try { //Member Master Table if (btnDelete.Text.ToString() == "&Delete") { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { sqlQuery = " Update tblUnclaimed Set PaidYN = '0' Where empid = '" + row.Cells["empid"].Text.ToString() + "' and ProssType = '" + row.Cells["ProssType"].Text.ToString() + "' and ComID = " + Common.Classes.clsMain.intComId + " and AllowType = '" + cboType.Text.ToString() + "' and PaidYN = 1"; 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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete Succefully."); } //prcClearData(); prcLoadSaveData(); //PrcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnProcess_Click(object sender, EventArgs e) { string SelDescription = ""; System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); string strMonthName = mfi.GetMonthName(dtDateTo.DateTime.Month).ToString(); SelDescription = strMonthName + "-" + (dtDateTo.DateTime.Year); btnProcess.Text = "Please Wait"; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new System.Data.DataSet(); string sqlQuery1 = ""; Int64 ChkLock = 0; //sqlQuery1 = "Select dbo.fncProcessLock (" + Common.Classes.clsMain.intComId + ", 'Salary Lock','" + clsProc.GTRDate(dtFirst.Value.ToString()) + "')"; //ChkLock = clsCon.GTRCountingDataLarge(sqlQuery1); //if (ChkLock == 1) //{ // MessageBox.Show("Process Lock. Please communicate to Administrator."); // return; //} try { string sqlQuery = "Exec rptNightAllowance " + Common.Classes.clsMain.intComId + ",'" + SelDescription + "',0,'','" + clsProc.GTRDate(dtDateFrom.Value.ToString()) + "','" + clsProc.GTRDate(dtDateTo.Value.ToString()) + "',1"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Process Complete"); btnProcess.Text = "&Process"; prcLoadList(); } catch (Exception ex) { throw (ex); } finally { clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete Festival Advance Salary Amount.", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } string sqlQuery = ""; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { if (btnDelete.Text.ToString() == " &Delete") { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { sqlQuery = " Delete tblFestAdvSalary Where EmpId = '" + row.Cells["empid"].Text.ToString() + "' and ProssType = '" + row.Cells["ProssType"].Text.ToString() + "' and ComID = " + Common.Classes.clsMain.intComId + ""; 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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete SuccessFuly"); } prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnPaid_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to update this employee all unlclaimed amount.", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = "", EmpID = ""; EmpID = gridEmployee.ActiveRow.Cells[0].Value.ToString(); try { //Member Master Table if (btnPaid.Text.ToString() == "&All Paid") { sqlQuery = " Update tblUnclaimed Set PaidYN = '0' Where EmpId = '" + EmpID + "' and ComID = " + Common.Classes.clsMain.intComId + " and PaidYN = 1"; 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 + "','Paid')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Update Successfully Complete."); prcLoadSaveData(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete all employee Increment.", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } string sqlQuery = ""; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { if (btnDelete.Text.ToString() == " &Delete") { sqlQuery = " Update E Set E.GS = A.OldSal, E.GSUSD = A.OldSalUSD from tblEmp_Info E, tblEmp_Incr A Where E.EmpID = A.EmpID And E.ComId = " + Common.Classes.clsMain.intComId + " And A.ComId = " + Common.Classes.clsMain.intComId + " and A.dtInc = '" + this.clsProc.GTRDate(this.dtInc.Value.ToString()) + "' and A.IncYearly = 1"; arQuery.Add(sqlQuery); sqlQuery = " Update E Set E.BS = round(((E.GS-560)/1.4),0),E.HR = E.GS-(round(((E.GS-560)/1.4),0)+560),E.MA = 560 from tblEmp_Info E, tblEmp_Incr A Where E.EmpID = A.EmpID And E.ComId = " + Common.Classes.clsMain.intComId + " And A.ComId = " + Common.Classes.clsMain.intComId + " and A.dtInc = '" + this.clsProc.GTRDate(this.dtInc.Value.ToString()) + "' and A.IncYearly = 1"; arQuery.Add(sqlQuery); sqlQuery = " Delete tblEmp_Incr Where ComId = " + Common.Classes.clsMain.intComId + " And dtInc = '" + this.clsProc.GTRDate(this.dtInc.Value.ToString()) + "' and IncYearly = 1"; 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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete SuccessFuly"); } prcClearData(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnRsltSave_Click(object sender, EventArgs e) { string sqlQuery; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection("GTRHRIS"); try { Int32 hNmbr = 0; sqlQuery = "Delete tblAdm_Exam_Result where clsid='" + cboClsnm.Value.ToString() + "' and Yrnm='" + cboyrnm.Text.ToString() + "'"; arQuery.Add(sqlQuery); foreach (UltraGridRow row in gridResult.Rows) { Int32 i = 0; if (row.Cells["Number"].Text.Length > 0) { i = Int32.Parse(row.Cells["Number"].Text.ToString()); if (i > Int32.Parse(cbo.Text.ToString())) { hNmbr = 1; } } sqlQuery = "Insert Into tblAdm_Exam_Result (AdmID, FormNo, clsID, Yrnm, IsPassed, Number,IsMainList,iswaiting)" + "values('" + row.Cells["AdmID"].Value + "','" + row.Cells["frmNoAuto"].Value + "','" + cboClsnm.Value.ToString() + "','" + cboyrnm.Text.ToString() + "','" + row.Cells["IsPassed"].Value + "','" + row.Cells["Number"].Value + "','" + row.Cells["isMerit"].Value + "','" + row.Cells["isWaiting"].Value + "')"; 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("'", "|") + "','Result')"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Save SuccessFully"); PrcClrrData(); PrcLoadList(); } catch (Exception ex) { throw (ex); } finally { clsCon = null; arQuery = null; } }
private void btnUpdate_Click(object sender, EventArgs e) { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; //Int32 NewId = 0; try { foreach (UltraGridRow row in this.gridList.Rows) { if (row.Cells["isChecked"].Value.ToString() == "1") { //sqlQuery = " Delete tblJobApp_Info where AppId = '" + row.Cells["AppId"].Text.ToString() + "' "; // arQuery.Add(sqlQuery); sqlQuery = "Update tblJobApp_Info Set isPassed = '" + row.Cells["isPassed"].Value.ToString() + "', isWaiting ='" + row.Cells["isWaiting"].Value.ToString() + "', isFaild = '" + row.Cells["isFaild"].Value.ToString() + "', isAppointed = '" + row.Cells["isAppointed"].Value.ToString() + "', dtJoin = '" + row.Cells["dtJoin"].Value.ToString() + "', Status = '" + row.Cells["Status"].Text.ToString() + "' where AppId = '" + row.Cells["AppId"].Value.ToString() + "' "; arQuery.Add(sqlQuery); } } clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Update Successfully"); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { clsCon = null; } }
private void prcLoadStatus() { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; try { sqlQuery = "Update tblMachineNo_GTR set Status = 'Disconnect'"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); } catch (Exception ex) { throw (ex); } finally { clsCon = null; } }
private void btnRfrs_Click(object sender, EventArgs e) { GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery; try { foreach (UltraGridRow row in gridDataBKUp.Rows) { if (Int16.Parse(row.Cells["Mark"].Value.ToString()) == 1) { row.Appearance.BackColor = Color.Coral; row.Cells["Status"].Value = "Running"; row.Cells["Status"].Refresh(); gridDataBKUp.Refresh(); sqlQuery = "Exec prcDBBackup '" + row.Cells["SLNo"].Value + "','','','" + Common.Classes.clsMain.intUserId + "'"; clsCon.GTRSaveDataWithSQLCommand(sqlQuery); row.Appearance.BackColor = Color.BlanchedAlmond; row.Cells["Status"].Value = "Complete"; row.Cells["Status"].Refresh(); gridDataBKUp.Refresh(); } } // dbName = dbName.Substring(0, dbName.Length - 1); // MessageBox.Show("Data backup SuccessFully"); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { clsCon = null; } }
private void btnIncIndDel_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete Yearly Increment this Employee.", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } string sqlQuery = ""; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); try { sqlQuery = "delete tblEmp_Incr Where ComId = " + Common.Classes.clsMain.intComId + " and dtInc = '" + this.clsProc.GTRDate(this.dtInc.Value.ToString()) + "' and EmpId = '" + cboEmpId.Value.ToString() + "' and IncYearly in (1,2)"; 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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete Successfully"); prcClearData(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnProcess_Click(object sender, EventArgs e) { string Description = ""; //System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo(); //string strMonthName = mfi.GetMonthName(dtPross.DateTime.Month).ToString(); //Description = strMonthName + "-" + (dtPross.DateTime.Year); Description = clsProc.GTRDate(dtPross.Value.ToString()); btnProcess.Text = "Please Wait"; ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); dsList = new System.Data.DataSet(); try { string sqlQuery = "Exec rptCadreAttendance " + Common.Classes.clsMain.intComId + ",'" + Description + "','" + clsProc.GTRDate(dtPross.Value.ToString()) + "',0,0,'','',1"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Process Complete"); btnProcess.Text = "&Process"; prcLoadList(); } catch (Exception ex) { throw (ex); } 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 ChkData = 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 tblSal_Suspense Set dtInput = '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "', amount = '" + clsProc.GTRValidateDouble(txtAmt.Value.ToString()) + "',remarks = '" + txtRemarks.Text.ToString() + "' Where advID = " + 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 { //add new //sqlQuery = "Select Isnull(Max(advID),0)+1 As NewId from tblSal_Suspense"; //NewId = clsCon.GTRCountingData(sqlQuery); sqlQuery = "Select dbo.fncCheckData (" + Common.Classes.clsMain.intComId + ",'" + cboEmpID.Value.ToString() + "','" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "','Salary Advance')"; ChkData = clsCon.GTRCountingDataLarge(sqlQuery); if (ChkData == 1) { MessageBox.Show("This employee's advance amount already inputted. Please select another employee Id."); return; } //Insert data sqlQuery = "Insert Into tblSal_Suspense ( empid, dtInput,amount, Remarks,LUserId,comid ,PcName) " + " Values ('" + cboEmpID.Value.ToString() + "', '" + clsProc.GTRDate(dtInputDate.Value.ToString()) + "', '" + clsProc.GTRValidateDouble(txtAmt.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 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 tblAttfixedB As A sqlQuery = " Delete tblAttfixedB where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblAttfixedB(empid,dtPunchDate,TimeIn,TimeOut,OT,Status,Remarks,ShiftID,TimeInPrev,TimeOutPrev,OTHrPrev,StatusPrev,Luserid,comid,pcname) " + " Values ('" + row.Cells["empid"].Text.ToString() + "', '" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["timein"].Text.ToString() + "','" + row.Cells["timeout"].Text.ToString() + "','0','" + row.Cells["Status"].Value.ToString() + "','" + row.Cells["Remarks"].Value.ToString() + "','" + row.Cells["ShiftID"].Value.ToString() + "','" + row.Cells["TimeInPrev"].Text.ToString() + "','" + row.Cells["TimeOutPrev"].Text.ToString() + "','" + row.Cells["OTHrPrev"].Value.ToString() + "','" + row.Cells["StatusPrev"].Value.ToString() + "'," + Common.Classes.clsMain.intUserId + "," + Common.Classes.clsMain.intComId + ",'" + Common.Classes.clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); //if (row.Cells["OTHour"].Value.ToString() != "0.00") //{ // string sqlQuery1 = " Update P Set P.FirstAppId = I.FirstAppId,P.FinalAppId = I.FinalAppId,P.AppFirst = I.AppFirst,P.AppFinal = I.AppFinal" // + " from tblAttfixedB as P " // + " inner join tblInput_Permission as I on I.ComId = P.ComID " // + " inner join tblEmp_Info as E on E.ComId = P.ComID and E.OfficeGrade = I.EmpType " // + " Where P.EmpId = '" + row.Cells["empid"].Text.ToString() // + "' and P.ComId = " + Common.Classes.clsMain.intComId + " and P.dtPunchDate = '" // + row.Cells["dtPunchDate"].Text.ToString() + "' and I.PType = 'Fix-Attendance'"; // arQuery.Add(sqlQuery1); //} string sqlQuery2 = "Exec [prcProcessAttendFixB] " + Common.Classes.clsMain.intComId + ",'" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["empid"].Text.ToString() + "'"; arQuery.Add(sqlQuery2); } } // 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."); } prcClearDataSave(); cboEmpID.Focus(); prcLoadList(); prcLoadCombo(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnDelete_Click(object sender, EventArgs e) { if (fncBlank()) { return; } if (MessageBox.Show("Do you want to delete Night OT for selected Employee.", "", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return; } //string ProssType = ""; //ProssType = clsProc.GTRDate(dtDate.Value.ToString()) + "-" + cboBill.Text.ToString(); ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = ""; Int32 NewId = 0; //string sqlQuery = ""; Int32 RowID; try { if (btnDelete.Text.ToString() == " &Delete") { foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["empid"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1") { sqlQuery = " Delete tblProssAllowanceBill where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtDate = '" + clsProc.GTRDate(dtDate.Value.ToString()) + "' and ComID = " + Common.Classes.clsMain.intComId + " and AllowType = 'Night'"; arQuery.Add(sqlQuery); //sqlQuery = " Delete tblProcessedDataWH Where EmpID = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + // clsProc.GTRDate(dtDate.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 + "','Delete')"; arQuery.Add(sqlQuery); //Transaction with database clsCon.GTRSaveDataWithSQLCommand(arQuery); MessageBox.Show("Data Delete SuccessFully"); prcClearData(); prcLoadList(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { arQuery = null; clsCon = null; } }
private void btnFP_Click(object sender, EventArgs e) { ArrayList arQuery = new ArrayList(); GTRLibrary.clsConnection clsCon = new GTRLibrary.clsConnection(); string sqlQuery = "", GetDeviceIP = ""; string DeviceIp = "", pDate = "", pTime = ""; string sdwEnrollNumber = ""; string sName = ""; string sPassword = ""; int iPrivilege = 0; bool bEnabled = false; int idwFingerIndex; string sTmpData = ""; int iTmpLength = 0; int iFlag = 0; //Data Clear sqlQuery = "Truncate table tblTempCount_GTR"; arQuery.Add(sqlQuery); clsCon.GTRSaveDataWithSQLCommand(arQuery); foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in this.gridDetails.Rows) { if (row.Cells["Id"].Text.ToString().Length != 0 && row.Cells["isChecked"].Value.ToString() == "1" && row.Cells["Active"].Value.ToString() == "1") { GetDeviceIP = "" + row.Cells["IpAddress"].Text.ToString() + ""; axCZKEM1.EnableDevice(iMachineNumber, false); Cursor = Cursors.WaitCursor; bIsConnected = axCZKEM1.Connect_Net(GetDeviceIP, 4370); if (bIsConnected == true) { iMachineNumber = 1; axCZKEM1.RegEvent(iMachineNumber, 65535); } axCZKEM1.ReadAllUserID(iMachineNumber); //read all the user information to the memory axCZKEM1.ReadAllTemplate(iMachineNumber); //read all the users' fingerprint templates to the memory while (axCZKEM1.SSR_GetAllUserInfo(iMachineNumber, out sdwEnrollNumber, out sName, out sPassword, out iPrivilege, out bEnabled)) //get all the users' information from the memory { for (idwFingerIndex = 0; idwFingerIndex < 10; idwFingerIndex++) { if (axCZKEM1.GetUserTmpExStr(iMachineNumber, sdwEnrollNumber, idwFingerIndex, out iFlag, out sTmpData, out iTmpLength))//get the corresponding templates string and length from the memory { sqlQuery = "Delete tblEmp_FingerData Where EmpId = '" + sdwEnrollNumber + "' and FPIndex = " + idwFingerIndex + ""; arQuery.Add(sqlQuery); sqlQuery = "Insert into tblEmp_FingerData(ComId,EmpId,FingerData,FPIndex,Privilege,Password) values('2','" + sdwEnrollNumber + "','" + sTmpData + "'," + idwFingerIndex + "," + iPrivilege + ",'" + sPassword + "')"; arQuery.Add(sqlQuery); sqlQuery = "Insert into tblTempCount_GTR(ComId,EmpId,FingerData,FPIndex,Privilege,Password) values('2','" + sdwEnrollNumber + "','" + sTmpData + "'," + idwFingerIndex + "," + iPrivilege + ",'" + sPassword + "')"; arQuery.Add(sqlQuery); } //if } //for } //while axCZKEM1.EnableDevice(iMachineNumber, true); Cursor = Cursors.Default; } //if axCZKEM1.Disconnect(); } //foreach clsCon.GTRSaveDataWithSQLCommand(arQuery); prcGetFingerData(); }
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") { sqlQuery = " Delete tblAttfixedCasual where empid = '" + row.Cells["empid"].Text.ToString() + "' and dtPunchDate = '" + row.Cells["dtPunchDate"].Text.ToString() + "'"; arQuery.Add(sqlQuery); sqlQuery = " Insert Into tblAttfixedCasual(empid,dtPunchDate,TimeIn,TimeOut,OTHr,Status,Remarks,TimeInPrev,TimeOutPrev,OTHrPrev,StatusPrev,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() + "','" + row.Cells["Remarks"].Value.ToString() + "','" + row.Cells["TimeInPrev"].Text.ToString() + "','" + row.Cells["TimeOutPrev"].Text.ToString() + "','" + row.Cells["OTHrPrev"].Value.ToString() + "','" + row.Cells["StatusPrev"].Value.ToString() + "'," + Common.Classes.clsMain.intUserId + "," + Common.Classes.clsMain.intComId + ",'" + Common.Classes.clsMain.strComputerName + "')"; arQuery.Add(sqlQuery); string sqlQuery1 = "Exec [prcProcessAttendFixDriver] " + Common.Classes.clsMain.intComId + ",'" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["dtPunchDate"].Text.ToString() + "','" + row.Cells["empid"].Text.ToString() + "'"; arQuery.Add(sqlQuery1); } } // 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; } }