private void bindEmployeeGrid(int custId) { try { string stprocedure = "spEmployeeDetails"; DataTable dt = new DataTable(); if (ddlsortby.SelectedItem.Text == "--Select--") { DataSet ds = q.ProcdureWith4Param(stprocedure, 1, custId, "", ""); dt = ds.Tables[0]; } else if (ddlsortby.SelectedItem.Text == "Employee Name-Wise") { DataSet ds = q.ProcdureWith4Param(stprocedure, 2, custId, txtsearchValue.Text, ""); dt = ds.Tables[0]; } else if (ddlsortby.SelectedItem.Text == "Mobile No.-Wise") { DataSet ds = q.ProcdureWith4Param(stprocedure, 3, custId, "", txtsearchValue.Text); dt = ds.Tables[0]; } grdEmployee.DataSource = dt; grdEmployee.DataBind(); checkAuthority(); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }
private void bindMSADueStatusGrd() { try { dt = null; Session["PrintMSAduestatusData"] = null; grdMSADueStatus.DataSource = null; grdMSADueStatus.DataBind(); bool Status = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"])); string stprocedure = "spMSADueStatusReport"; // Check super Admin condition #region supper Admin wise if (Status == true) { if (ddlcust.SelectedIndex == 0) {// For all customer DataSet ds = new DataSet(); if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 1, 0, dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 3, 0, dueDate, txtcurrentlocation.Text); } // DataSet ds = q.ProcdureWith3Param(stprocedure, 1, 0, dueDate); grdMSADueStatus.DataSource = ds.Tables[0]; grdMSADueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintMSAduestatusData"] = ds.Tables[0]; } else { Session["PrintMSAduestatusData"] = null; } } else if (ddlcust.SelectedIndex > 0) { DataSet ds = new DataSet(); // Customer wise if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(ddlcust.SelectedValue), dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, Convert.ToInt32(ddlcust.SelectedValue), dueDate, txtcurrentlocation.Text); } // DataSet ds = q.ProcdureWith3Param(stprocedure, 2, Convert.ToInt32(ddlcust.SelectedValue), dueDate); grdMSADueStatus.DataSource = ds.Tables[0]; grdMSADueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintMSAduestatusData"] = ds.Tables[0]; } else { Session["PrintMSAduestatusData"] = null; } } else { grdMSADueStatus.DataSource = null; grdMSADueStatus.DataBind(); Session["PrintMSAduestatusData"] = null; } } #endregion #region Employee wise else { // Employee logedin customerwise DataSet ds = new DataSet(); if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(Session["Customer_ID"]), dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, Convert.ToInt32(Session["Customer_ID"]), dueDate, txtcurrentlocation.Text); } // DataSet ds = q.ProcdureWith3Param(stprocedure, 2, Convert.ToInt32(Session["Customer_ID"]), dueDate); grdMSADueStatus.DataSource = ds.Tables[0]; grdMSADueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintMSAduestatusData"] = ds.Tables[0]; } else { Session["PrintMSAduestatusData"] = null; } } #endregion checkAuthority(); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }
private void bindTranHistoryGrd() { try { grdCalibTran.DataSource = null; grdCalibTran.DataBind(); string searchValue = txtsearch.Text.Trim(); searchValue = Regex.Replace(searchValue, @"\s+", " "); string searchgaugeid = txtgaugeid.Text.Trim(); searchgaugeid = Regex.Replace(searchgaugeid, @"\s+", " "); string stprocedure = "spcalibhistoryReport"; DataSet ds = new DataSet(); bool Status = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"])); // Check super Admin condition #region supper Admin wise if (Status == true) { if (ddlcust.SelectedIndex == 0) { ds = q.ProcdureWith4Param(stprocedure, 2, 0, 0, ""); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } if (ddlcust.SelectedIndex > 0) { int customerId = Convert.ToInt32(ddlcust.SelectedValue); if (txtsearch.Text == "" && txtgaugeid.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 3, customerId, 0, ""); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else if (txtsearch.Text != "" && txtgaugeid.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 1, customerId, 0, searchValue); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else if (txtsearch.Text != "" && txtgaugeid.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, customerId, Convert.ToInt32(searchgaugeid), searchValue); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else { grdCalibTran.DataSource = null; grdCalibTran.DataBind(); } } } #endregion #region employee wise else { int customerId = Convert.ToInt32(Session["Customer_ID"]); if (txtsearch.Text == "" && txtgaugeid.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 3, customerId, 0, ""); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else if (txtsearch.Text != "" && txtgaugeid.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 1, customerId, 0, searchValue); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else if (txtsearch.Text != "" && txtgaugeid.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, customerId, Convert.ToInt32(searchgaugeid), searchValue); grdCalibTran.DataSource = ds.Tables[0]; grdCalibTran.DataBind(); } else { grdCalibTran.DataSource = null; grdCalibTran.DataBind(); } } #endregion checkAuthority(); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }
private void bindEmpReportGrd() { try { bool Status = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"])); string stprocedure = "spEmployeeDetails"; DataTable dt = new DataTable(); // Check super Admin condition if (Status == true) { if (ddlcust.SelectedIndex == 0) { DataSet ds = q.ProcdureWith4Param(stprocedure, 4, 0, "", ""); dt = ds.Tables[0]; } else if (ddlcust.SelectedIndex > 0) { if (ddlsortby.SelectedIndex == 0) { DataSet ds = q.ProcdureWith4Param(stprocedure, 1, Convert.ToInt32(ddlcust.SelectedValue), "", ""); dt = ds.Tables[0]; } if (ddlsortby.SelectedIndex == 1) { DataSet ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(ddlcust.SelectedValue), txtemp.Text, ""); dt = ds.Tables[0]; } else { DataSet ds = q.ProcdureWith4Param(stprocedure, 3, Convert.ToInt32(ddlcust.SelectedValue), "", txtMobileNo.Text); dt = ds.Tables[0]; } } grdemp.DataSource = dt; grdemp.DataBind(); } else { if (ddlsortby.SelectedIndex == 1) { DataSet ds = q.ProcdureWith4Param(stprocedure, 1, Convert.ToInt32(Session["Customer_ID"]), "", ""); dt = ds.Tables[0]; } if (ddlsortby.SelectedIndex == 1) { DataSet ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(Session["Customer_ID"]), txtemp.Text, ""); dt = ds.Tables[0]; } else { DataSet ds = q.ProcdureWith4Param(stprocedure, 3, Convert.ToInt32(Session["Customer_ID"]), "", txtMobileNo.Text); dt = ds.Tables[0]; } grdemp.DataSource = dt; grdemp.DataBind(); } checkAuthority(); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }
private void bindCalibDueStatusGrd() { try { dt = null; Session["PrintduestatusData"] = null; dueDate = txtNextDueDate.Text; if (String.IsNullOrEmpty(dueDate)) { g.ShowMessage(this.Page, "Select Next Due Date."); return; } else { DateTime dtime = DateTime.ParseExact(dueDate, "dd/MM/yyyy", CultureInfo.InvariantCulture); dueDate = dtime.ToString("yyyy-MM-dd"); } grdCalibrationDueStatus.DataSource = null; grdCalibrationDueStatus.DataBind(); bool Status = g.CheckSuperAdmin(Convert.ToInt32(Session["User_ID"])); string stprocedure = "spCalibrationDueStatusReport"; // Check super Admin condition #region supper Admin wise if (Status == true) { if (ddlcust.SelectedIndex == 0) { // For all customer DataSet ds = new DataSet(); if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 3, 0, dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 5, 0, dueDate, txtcurrentlocation.Text); } // DataSet ds = q.ProcdureWith4Param(stprocedure, 3, 0, dueDate,""); grdCalibrationDueStatus.DataSource = ds.Tables[0]; grdCalibrationDueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintduestatusData"] = ds.Tables[0]; } else { Session["PrintduestatusData"] = null; } } else if (ddlcust.SelectedIndex > 0) { DataSet ds = new DataSet(); // Customer wise if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(ddlcust.SelectedValue), dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, Convert.ToInt32(ddlcust.SelectedValue), dueDate, txtcurrentlocation.Text); } grdCalibrationDueStatus.DataSource = ds.Tables[0]; grdCalibrationDueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintduestatusData"] = ds.Tables[0]; } else { Session["PrintduestatusData"] = null; } } else { grdCalibrationDueStatus.DataSource = null; grdCalibrationDueStatus.DataBind(); Session["PrintduestatusData"] = null; } } #endregion #region Employee wise else { // Employee logedin customerwise DataSet ds = new DataSet(); // Customer wise if (txtcurrentlocation.Text == "") { ds = q.ProcdureWith4Param(stprocedure, 2, Convert.ToInt32(Session["Customer_ID"]), dueDate, ""); } else if (txtcurrentlocation.Text != "") { ds = q.ProcdureWith4Param(stprocedure, 4, Convert.ToInt32(Session["Customer_ID"]), dueDate, txtcurrentlocation.Text); } grdCalibrationDueStatus.DataSource = ds.Tables[0]; grdCalibrationDueStatus.DataBind(); if (ds.Tables[0].Rows.Count > 0) { Session["PrintduestatusData"] = ds.Tables[0]; } else { Session["PrintduestatusData"] = null; } } #endregion checkAuthority(); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }