public void DBMpost() { try { NSM.IEmpId = EmployeeIdTextBox.Text.ToString().Trim(); NSM.search(NSM); } catch (Exception) { } }
public static NSDataPasser Checking(string emp) { AddSuggestion A = new AddSuggestion(); NewSuggestionModel NSM = new NewSuggestionModel(); Employee E = new Employee(); NSDataPasser tdp = new NSDataPasser(); //Console.Write(emp); //Console.Write("My first ASP script!"); try { if (emp != "" && emp != "System.Data.DataRowView") { Console.Write(emp); NSM.IEmpId = tdp.sesid.ToString(); DataSet DS = new DataSet(); DS = NSM.search(NSM); tdp.empname = DS.Tables[0].Rows[0].ItemArray[0].ToString(); SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString(); tdp.Department = DS.Tables[0].Rows[0].ItemArray[2].ToString(); SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString(); tdp.Designation = DS.Tables[0].Rows[0].ItemArray[4].ToString(); tdp.ErrorLabel = "0"; } else if (emp == "") { tdp.ErrorLabel = "Check the Employee ID "; } else { tdp.ErrorLabel = "1"; } return(tdp); } catch (Exception ex) { tdp.ErrorLabel = "alert ('The Employee Record Does Not Exist')"; ScriptManager.RegisterClientScriptBlock(A, A.GetType(), "alertMessage", "alert('The Employee Record Does Not Exist')", true); return(tdp); } }
public void headerValues(string userid) { AddSuggestion A = new AddSuggestion(); NewSuggestionModel NSM = new NewSuggestionModel(); Employee E = new Employee(); NSDataPasser tdp = new NSDataPasser(); //Console.Write(emp); //Console.Write("My first ASP script!"); try { if (userid != "" && userid != null) { NSM.IEmpId = userid;//tdp.sesid.ToString(); DataSet DS = new DataSet(); DS = NSM.search(NSM); /* tdp.empname = DS.Tables[0].Rows[0].ItemArray[0].ToString(); * SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString(); * tdp.Department = DS.Tables[0].Rows[0].ItemArray[2].ToString(); * SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString(); * tdp.Designation = DS.Tables[0].Rows[0].ItemArray[4].ToString(); */ EmployeeIdTextBox.Text = userid; tdp.ErrorLabel = "0"; EmployeeTextBox.Text = DS.Tables[0].Rows[0].ItemArray[0].ToString(); SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString(); DepartmentTextBox.Text = DS.Tables[0].Rows[0].ItemArray[2].ToString(); SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString(); DesignationTextBox.Text = DS.Tables[0].Rows[0].ItemArray[4].ToString(); } else if (userid == "") { tdp.ErrorLabel = "Check the Employee ID "; } else { tdp.ErrorLabel = "1"; } } catch (Exception ex) { tdp.ErrorLabel = "alert ('The Employee Record Does Not Exist')"; ScriptManager.RegisterClientScriptBlock(A, A.GetType(), "alertMessage", "alert('The Employee Record Does Not Exist')", true); } }
public static testDataPasser Checking(string emp) { NewSuggestionModel NSM = new NewSuggestionModel(); Employee E = new Employee(); testDataPasser tdp = new testDataPasser(); //Console.Write(emp); //Console.Write("My first ASP script!"); try { try { if (emp != "" && emp != "System.Data.DataRowView") { Console.Write(emp); NSM.IEmpId = emp.ToString().Trim(); DataSet DS = new DataSet(); DS = NSM.search(NSM); tdp.empname = DS.Tables[0].Rows[0].ItemArray[0].ToString(); SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString(); tdp.Department = DS.Tables[0].Rows[0].ItemArray[2].ToString(); SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString(); tdp.Designation = DS.Tables[0].Rows[0].ItemArray[4].ToString(); } else { } return(tdp); } catch (Exception ex) { throw new Exception("Error Initializing Data Class." + Environment.NewLine + ex.Message); } } catch (Exception ex) { throw new Exception("Error Initializing Data Class." + Environment.NewLine + ex.Message); } }
public void EmployeeIDSearch() { try { try { if (EmployeeIDTextBox.Text != "" && EmployeeIDTextBox.Text != "System.Data.DataRowView") { NSM.IEmpId = EmployeeIDTextBox.Text.ToString().Trim(); DataSet DS = new DataSet(); DS = NSM.search(NSM); EmployeeNameTextBox.Text = DS.Tables[0].Rows[0].ItemArray[0].ToString(); SIDepID = DS.Tables[0].Rows[0].ItemArray[1].ToString(); DepartmentTextBox.Text = DS.Tables[0].Rows[0].ItemArray[2].ToString(); SIDesID = DS.Tables[0].Rows[0].ItemArray[3].ToString(); DesignationTextBox.Text = DS.Tables[0].Rows[0].ItemArray[4].ToString(); } } catch (Exception ex) { throw new Exception("Error Initializing Data Class." + Environment.NewLine + ex.Message); //if (label2.Text == "") //{ // label2.Text = "Scan/Enter Barcode"; //} //label2.Text = "NOT FOUND"; // MessageBox.Show("The Vehicle is not Authorized"); // clear(); //throw; } } catch (Exception e1) {// //throw new Exception("Error Initializing Data Class." + Environment.NewLine + ex.Message); //MessageBox.Show("The Vehicle is not Authorized"); } }