protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtdat = new DataTable();
         objmysqldb.disposeConnectionObj();
         if (ViewState["querydata"] != null)
         {
             dtdata = (DataTable)ViewState["querydata"];
         }
         if (dtdata != null && dtdata.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtdata, "Query Result");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Add New Query Profile 303: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
        protected void btnExport_Click(object sender, EventArgs e)
        {
            try
            {
                ltrErr.Text = "";
                objmysqldb.ConnectToDatabase();
                DataTable dtmodule    = objmysqldb.GetData("Select EmpId,concat(employee_master.EmpLastName,' ',employee_master.EmpFirstName,' ',employee_master.EmpMiddleName) as EmployeeName from employee_master where IsDelete=0 and EmpStatusFlag=0");
                DataTable dtcategory  = objmysqldb.GetData("Select module_group_id,module_group_name,module_ids from employee_app_module_group where IsDelete=0");
                DataTable dtgrouplist = objmysqldb.GetData("Select emp_module_id,module_group_id,emp_id from employee_app_module_rights where IsDelete=0");

                dtgrouplist.Columns.Add("group_name");
                dtgrouplist.Columns.Add("EmployeeName");
                for (int i = 0; i < dtgrouplist.Rows.Count; i++)
                {
                    string    group_name   = " ";
                    string    EmployeeName = "";
                    DataRow[] dr1          = dtmodule.Select("EmpId ='" + dtgrouplist.Rows[i]["emp_id"].ToString() + "'");
                    if (dr1.Length > 0)
                    {
                        foreach (DataRow dr in dr1)
                        {
                            EmployeeName = dr["EmployeeName"].ToString();
                        }
                        dtgrouplist.Rows[i]["EmployeeName"] = EmployeeName;
                    }
                    DataRow[] dr2 = dtcategory.Select("module_group_id ='" + dtgrouplist.Rows[i]["module_group_id"].ToString() + "'");
                    if (dr2.Length > 0)
                    {
                        foreach (DataRow dr in dr2)
                        {
                            group_name = dr["module_group_name"].ToString();
                        }
                        dtgrouplist.Rows[i]["group_name"] = group_name;
                    }
                }
                dtgrouplist.Columns.Remove("module_group_id");
                dtgrouplist.Columns.Remove("emp_id");
                if (dtgrouplist != null && dtgrouplist.Rows.Count > 0)
                {
                    ExportToExcel kg           = new ExportToExcel();
                    string        exportedfile = kg.ExportDataTableToExcel(dtgrouplist, "List_Of_Employee_Assign_Group");
                    Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
                }
                else
                {
                    ltrErr.Text = "No data exists.";
                }
            }
            catch (Exception ex)
            {
                Logger.WriteCriticalLog("employeeassigngroup 397: exception:" + ex.Message + "::::::::" + ex.StackTrace);
            }
            finally
            {
                objmysqldb.disposeConnectionObj();
            }
        }
 protected void btnExport_Click(object sender, EventArgs e)
 {
     objmysqldb.ConnectToDatabase();
     try
     {
         ltrErr.Text = "";
         DataTable dtmodule   = objmysqldb.GetData("Select module_id,module_name from employee_module_master where IsDelete=0");
         DataTable dtcategory = objmysqldb.GetData("Select module_group_id,module_group_name,module_ids from employee_app_module_group where IsDelete=0");
         objmysqldb.disposeConnectionObj();
         dtcategory.Columns.Add("module_name");
         for (int i = 0; i < dtcategory.Rows.Count; i++)
         {
             string   module_name = " ";
             string   abc         = dtcategory.Rows[i]["module_ids"].ToString();
             string[] ar          = abc.Split(',');
             for (int a = 0; a < ar.Length; a++)
             {
                 DataRow[] dr1 = dtmodule.Select("module_id ='" + ar[a].Trim() + "'");
                 if (dr1.Length > 0)
                 {
                     foreach (DataRow dr in dr1)
                     {
                         module_name += dr["module_name"].ToString() + ",";
                     }
                     dtcategory.Rows[i]["module_name"] = module_name.TrimEnd(',');
                 }
             }
         }
         dtcategory.Columns.Remove("module_ids");
         if (dtcategory != null && dtcategory.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtcategory, "List_Of_Employee_Module_Group");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists.";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("employee_module_group 509: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
Example #4
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         DataTable dtReportingManger = BindGrid();
         if (dtReportingManger != null && dtReportingManger.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtReportingManger, "List_Of_Reporting_Manager");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Manage_ReportingManager 212: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
Example #5
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtreligion = objmysqldb.GetData("Select religion_id,religion_name,IsMasterData from religion_master where IsDelete=0 order by religion_id");
         objmysqldb.disposeConnectionObj();
         if (dtreligion != null && dtreligion.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtreligion, "List_Of_Religion");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Manage_Category 388: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
Example #6
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtleft = objmysqldb.GetData("Select concat(if(EmpFirstName is null,'',EmpFirstName),' ' ,if(EmpLastName is null,'',EmpLastName)) AS EmpFullName,Left_Employee_id,Emp_Id,Left_Date,Left_Reason from left_employee inner join employee_master on left_employee.Emp_Id=employee_master.EmpId  where left_employee.IsDelete=0 order by Left_Employee_id");
         objmysqldb.disposeConnectionObj();
         if (dtleft != null && dtleft.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtleft, "List_Of_LeftEmployee");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("LeftEmployee 259: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtEmpList = BindGrid();
         objmysqldb.disposeConnectionObj();
         if (dtEmpList != null && dtEmpList.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtEmpList, "List_Of_Complaints");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Search_Employee 482: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
Example #8
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtgrpList = (DataTable)ViewState["gvdata"];
         objmysqldb.disposeConnectionObj();
         if (dtgrpList != null && dtgrpList.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtgrpList, "List_Of_Reports_Group");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("EmployeeGroupForReports 196: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dttimegrpDetails = objmysqldb.GetData("SELECT Group_id,Group_Name,Absent_SMS_After,OutPuch_SMS_After,Changes_Applicable_Date,DATE_FORMAT(DATE_ADD('0001-01-01 00:00:00',INTERVAL Changes_Applicable_Date/10000000 SECOND_MICROSECOND), '%d/%m/%Y')as date FROM group_master where IsDelete=0");
         objmysqldb.disposeConnectionObj();
         if (dttimegrpDetails != null && dttimegrpDetails.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dttimegrpDetails, "List_Of_Attendance_Time_Group_Details");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Time_Group_List 118: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }
 protected void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         ltrErr.Text = "";
         objmysqldb.ConnectToDatabase();
         DataTable dtorganization = objmysqldb.GetData("Select School_List_ID,School_Name,School_Id from school_list where IsDelete=0 order by School_List_ID");
         objmysqldb.disposeConnectionObj();
         if (dtorganization != null && dtorganization.Rows.Count > 0)
         {
             ExportToExcel kg           = new ExportToExcel();
             string        exportedfile = kg.ExportDataTableToExcel(dtorganization, "List_Of_Organization");
             Response.Redirect(ExportToExcel.EXPORT_URL + exportedfile, false);
         }
         else
         {
             ltrErr.Text = "No data exists";
         }
     }
     catch (Exception ex)
     {
         Logger.WriteCriticalLog("Manage_Organization 331: exception:" + ex.Message + "::::::::" + ex.StackTrace);
     }
 }