private void ToolStripButton1_Click(object sender, EventArgs e) { var ds1 = new DataSet(); var ds2 = new DataSet(); var MaxRow = ((SFeedingGrid.FocusedView as GridView).RowCount); for (var i = 0; i < MaxRow; i++) { var currentrow = SFeedingGridView.GetDataRow(i); var str1 = "Select EmpCode,EmpName from EmpMst where EmpCode='" + currentrow["EmpCode"].ToString().PadLeft(5, '0') + "'"; ds1 = ProjectFunctions.GetDataSet(str1); if (ds1.Tables[0].Rows.Count > 0) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpName"], ds1.Tables[0].Rows[0]["EmpName"].ToString()); } else { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpCode"], "XXXXXXXXXXXXXXXXXXX"); SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpName"], "XXXXXXXXXXXXXXXXXXX"); XtraMessageBox.Show("Invalid Dept "); } } SFeedingGridView.BestFitColumns(); }
private bool ValidateData() { var MaxRow = ((SFeedingGrid.FocusedView as GridView).RowCount); for (var i = 0; i < MaxRow; i++) { var currentrow = SFeedingGridView.GetDataRow(i); if (currentrow["EmpName"].ToString().Contains("x") || currentrow["EmpName"].ToString() == string.Empty) { XtraMessageBox.Show("Invalid Employee Name"); return(false); } if (currentrow["EmpDW"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpDW"], "0"); } if (currentrow["EmpPH"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpPH"], "0"); } if (currentrow["EmpEL"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpEL"], "0"); } if (currentrow["EmpCL"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpCL"], "0"); } if (currentrow["EmpSL"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpSL"], "0"); } if (currentrow["EmpPymtMode"].ToString() == string.Empty) { XtraMessageBox.Show("Invalid Payment Mode"); return(false); } if (currentrow["MonthYear"].ToString() == string.Empty) { XtraMessageBox.Show("Invalid Month Year"); return(false); } } return(true); }
private bool ValidateData() { var MaxRow = ((SFeedingGrid.FocusedView as GridView).RowCount); for (var i = 0; i < MaxRow; i++) { var currentrow = SFeedingGridView.GetDataRow(i); //if (currentrow["AccName"].ToString().Contains("x") || currentrow["AccName"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Party Name"); // return false; //} //if (currentrow["UnitName"].ToString().Contains("x") || currentrow["UnitName"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Unit"); // return false; //} //if (currentrow["DeptDesc"].ToString().Contains("x") || currentrow["DeptDesc"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Department"); // return false; //} //if (currentrow["DesgDesc"].ToString().Contains("x") || currentrow["DesgDesc"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Designation"); // return false; //} //if (currentrow["EmpDOJ"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Date Of Joining"); // return false; //} //if (currentrow["EmpDOB"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Date Of Birth"); // return false; //} if (currentrow["EmpBasic"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpBasic"], "0"); } if (currentrow["EmpHRA"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpHRA"], "0"); } if (currentrow["EmpConv"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpConv"], "0"); } if (currentrow["EmpPET"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpPET"], "0"); } if (currentrow["EmpSplAlw"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpSplAlw"], "0"); } if (currentrow["EmpTDS"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpTDS"], "0"); } if (currentrow["EmpMscD1"].ToString() == string.Empty) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpMscD1"], "0"); } //if (currentrow["EmpAdharCardNo"].ToString() == string.Empty) //{ // XtraMessageBox.Show("Invalid Aadhaar Card No"); // return false; //} } return(true); }
private void ToolStripButton1_Click(object sender, EventArgs e) { var ds1 = new DataSet(); var ds2 = new DataSet(); var ds3 = new DataSet(); var ds4 = new DataSet(); var MaxRow = ((SFeedingGrid.FocusedView as GridView).RowCount); for (var i = 0; i < MaxRow; i++) { var currentrow = SFeedingGridView.GetDataRow(i); var str1 = "Select DeptCode,DeptDesc from DeptMst where DeptCode='" + currentrow["EmpDeptCode"].ToString().PadLeft(4, '0') + "'"; ds1 = ProjectFunctions.GetDataSet(str1); var str2 = "Select DesgCode,DesgDesc from DesgMst where DesgCode='" + currentrow["EmpDesgCode"].ToString().PadLeft(4, '0') + "'"; ds2 = ProjectFunctions.GetDataSet(str2); var str3 = "Select UnitCode,UnitName from UnitMst where UnitCode='" + currentrow["UnitCode"].ToString().PadLeft(4, '0') + "'"; ds3 = ProjectFunctions.GetDataSet(str3); var str4 = "Select AccCode,AccName from ActMst where AccCode='" + currentrow["EmpPartyCode"].ToString().PadLeft(4, '0') + "'"; ds4 = ProjectFunctions.GetDataSet(str4); if (ds1.Tables[0].Rows.Count > 0) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["DeptDesc"], ds1.Tables[0].Rows[0]["DeptDesc"].ToString()); } else { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpDeptCode"], "XXXXXXXXXXXXXXXXXXX"); SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["DeptDesc"], "XXXXXXXXXXXXXXXXXXX"); XtraMessageBox.Show("Invalid Dept "); } if (ds2.Tables[0].Rows.Count > 0) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["DesgDesc"], ds2.Tables[0].Rows[0]["DesgDesc"].ToString()); } else { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpDesgCode"], "XXXXXXXXXXXXXX"); SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["DesgDesc"], "XXXXXXXXXXXXXX"); XtraMessageBox.Show("Invalid Designation "); } if (ds3.Tables[0].Rows.Count > 0) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["UnitName"], ds3.Tables[0].Rows[0]["UnitName"].ToString()); } else { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["UnitCode"], "XXXXXXXXXXXXXX"); SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["UnitName"], "XXXXXXXXXXXXXX"); XtraMessageBox.Show("Invalid Unit "); } if (ds4.Tables[0].Rows.Count > 0) { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["AccName"], ds4.Tables[0].Rows[0]["AccName"].ToString()); } else { SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["EmpPartyCode"], "XXXXXXXXXXXXXX"); SFeedingGridView.SetRowCellValue(i, SFeedingGridView.Columns["AccName"], "XXXXXXXXXXXXXX"); XtraMessageBox.Show("Invalid Unit "); } } SFeedingGridView.BestFitColumns(); }