コード例 #1
0
 public static string GetServiceDetail(string RGroup, string EmployeeType, string OfficeType, string RetireYear, string OfficeWise, string District, string IsVerified)
 {
     try
     {
         Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
         DataTable         dt = new DataTable();
         if (IsVerified != "")
         {
             dt = objDashboard_DBLayer.GetServiceDetail(EmployeeType, OfficeType, (RetireYear != "" ? Convert.ToInt32(RetireYear) : 0), OfficeWise, District, (IsVerified != "" ? true : false), (Convert.ToBoolean(IsVerified)));
         }
         else
         {
             dt = objDashboard_DBLayer.GetServiceDetail(EmployeeType, OfficeType, (RetireYear != "" ? Convert.ToInt32(RetireYear) : 0), OfficeWise, District, false);
         }
         RGroup = (RGroup == "" ? "EmployeeCode" : RGroup);
         if (RGroup != "")
         {
             string strRGroup = JsonConvert.SerializeObject((new DataView(dt).ToTable(true, RGroup, "EmployeeName")));
             return(JsonConvert.SerializeObject(dt) + "E_E" + strRGroup);
         }
         else
         {
             return(JsonConvert.SerializeObject(dt) + "E_E" + "");
         }
     }
     catch (Exception ex)
     {
         return("");
     }
 }
コード例 #2
0
        public static string GetULBEmployeeCount(string empType)
        {
            try
            {
                Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
                DataTable         dt = new DataTable();
                dt = objDashboard_DBLayer.GetULBEmployeeStatistics(empType);

                DataTable dtOffices = new DataTable();
                dtOffices = new DataView(dt).ToTable(true, "OfficeType");

                ArrayList arrList = new ArrayList(dtOffices.Rows.Count);

                foreach (DataRow dr in dtOffices.Rows)
                {
                    string[] arrString = new string[]
                    {
                        dr[0].ToString(), dt.Compute("SUM(EmployeeCount)", "OfficeType = '" + dr[0].ToString() + "'").ToString()
                    };
                    arrList.Add(arrString);
                }

                DataTable dtDistricts = new DataTable();
                dtDistricts = new DataView(dt).ToTable(true, "EnglishName");

                ArrayList arrDistricts = new ArrayList(dtDistricts.Rows.Count);

                int      ind        = 1;
                string[] arrDistCol = new string[dtOffices.Rows.Count + 1];
                arrDistCol[0] = "Offices";
                //Add Column
                foreach (DataRow dr in dtOffices.Rows)
                {
                    arrDistCol[ind] = dr[0].ToString();
                    ind++;
                }
                arrDistricts.Add(arrDistCol);

                foreach (DataRow Disdr in dtDistricts.Rows)
                {
                    string[] arrString = new string[dtOffices.Rows.Count + 1];
                    arrString[0] = Disdr[0].ToString();

                    ind = 1;
                    foreach (DataRow dr in dtOffices.Rows)
                    {
                        arrString[ind] = dt.Compute("SUM(EmployeeCount)", "OfficeType = '" + dr[0].ToString() + "' And EnglishName = '" + Disdr[0].ToString() + "'").ToString();
                        ind++;
                    }
                    arrDistricts.Add(arrString);
                }

                string str = JsonConvert.SerializeObject(arrList) + "E_E" + JsonConvert.SerializeObject(arrDistricts);
                return(str);
            }
            catch (Exception ex)
            {
                return("");
            }
        }
コード例 #3
0
        public static string GetEmployeeDetail(string RGroup, string EmployeeType, string OfficeType, string RetirementYear, string OfficeWise, string District, string Designation, string EmployeeName, string EmployeeKey, string JoiningYear, string IsVerified)
        {
            try
            {
                Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
                DataTable         dt = new DataTable();
                if (IsVerified != "")
                {
                    dt = objDashboard_DBLayer.GetEmployeePrimaryDetail(EmployeeType, OfficeType, (RetirementYear != "" ? Convert.ToInt32(RetirementYear) : 0), OfficeWise, District, Designation, EmployeeName, (EmployeeKey != "" ? Convert.ToInt32(EmployeeKey) : 0), (JoiningYear != "" ? Convert.ToInt32(JoiningYear) : 0), (IsVerified != "" ? true : false), (Convert.ToBoolean(IsVerified)));
                }
                else
                {
                    dt = objDashboard_DBLayer.GetEmployeePrimaryDetail(EmployeeType, OfficeType, (RetirementYear != "" ? Convert.ToInt32(RetirementYear) : 0), OfficeWise, District, Designation, EmployeeName, (EmployeeKey != "" ? Convert.ToInt32(EmployeeKey) : 0), (JoiningYear != "" ? Convert.ToInt32(JoiningYear) : 0));
                }

                if (RGroup != "")
                {
                    string strRGroup = JsonConvert.SerializeObject((new DataView(dt).ToTable(true, RGroup)));
                    return(JsonConvert.SerializeObject(dt) + "E_E" + strRGroup);
                }
                else
                {
                    return(JsonConvert.SerializeObject(dt) + "E_E" + "");
                }
            }
            catch (Exception ex)
            {
                return("");
            }
        }
コード例 #4
0
 public static string GetEmployeeCount()
 {
     try
     {
         Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
         return(JsonConvert.SerializeObject(objDashboard_DBLayer.GetEmployeeStatistics()));
     }
     catch (Exception ex)
     {
         return("");
     }
 }
コード例 #5
0
 public static ICollection <ListItem> GetEmployeeCode()
 {
     try
     {
         Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
         return(objDashboard_DBLayer.GetEmployeeCode());
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #6
0
        public static string GetEmployeeRetirement(string empType)
        {
            try
            {
                Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
                DataTable         dt = new DataTable();
                dt = objDashboard_DBLayer.GetEmployeeRetirement(empType);

                DataTable dtOffices = new DataTable();
                dtOffices = new DataView(dt).ToTable(true, "OfficeType");

                DataTable dtYear = new DataTable();
                dtYear = new DataView(dt).ToTable(true, "RetYear");

                ArrayList arrYear = new ArrayList(dtYear.Rows.Count);

                int      ind        = 1;
                string[] arrYearCol = new string[dtOffices.Rows.Count + 1];
                arrYearCol[0] = "Year";

                //Add Column
                foreach (DataRow dr in dtOffices.Rows)
                {
                    arrYearCol[ind] = dr[0].ToString();
                    ind++;
                }
                arrYear.Add(arrYearCol);

                //Add Rows
                foreach (DataRow Disdr in dtYear.Rows)
                {
                    string[] arrString = new string[dtOffices.Rows.Count + 1];
                    arrString[0] = Disdr[0].ToString();

                    ind = 1;
                    foreach (DataRow dr in dtOffices.Rows)
                    {
                        arrString[ind] = dt.Compute("SUM(RetEmployee)", "OfficeType = '" + dr[0].ToString() + "' And RetYear = " + Disdr[0].ToString() + "").ToString();
                        ind++;
                    }
                    arrYear.Add(arrString);
                }

                string str = JsonConvert.SerializeObject(arrYear) + "E_E" + JsonConvert.SerializeObject(dt);
                return(str);
            }
            catch (Exception ex)
            {
                return("");
            }
        }
コード例 #7
0
        public static string GetEmployeeLocationWise(string empType)
        {
            try
            {
                Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
                DataTable         dt = new DataTable();
                dt = objDashboard_DBLayer.GetEmployeeLocationWise(empType);

                string str = JsonConvert.SerializeObject(dt);
                return(str);
            }
            catch (Exception ex)
            {
                return("");
            }
        }
コード例 #8
0
 public static ICollection <ListItem> GetColumnData(string columnname)
 {
     try
     {
         string tablename = "";
         if (columnname == "OfficeType" || columnname == "OfficeName")
         {
             tablename = "dbo.OfficeMaster";
         }
         else if (columnname == "District")
         {
             columnname = "EnglishName";
             tablename  = "dbo.DistrictMaster";
         }
         else if (columnname == "Designation")
         {
             columnname = "EnglishName";
             tablename  = "dbo.DesignationMaster";
         }
         else if (columnname == "SubDesignation")
         {
             columnname = "EnglishName";
             tablename  = "dbo.SubDesignationMaster";
         }
         else if (columnname == "Gender")
         {
             columnname = "EmpGender";
             tablename  = "dbo.EmployeeMaster";
         }
         else
         {
             tablename = "dbo.EmployeeMaster";
         }
         Dashboard_DBLayer objDashboard_DBLayer = new Dashboard_DBLayer();
         return(objDashboard_DBLayer.GetColumnValues(columnname, tablename));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblCurrDate.Text = "Dated: " + DateTime.Now.Date.ToShortDateString();

                Dashboard_DBLayer db = new Dashboard_DBLayer();
                dsEmp = db.GetEmployeeDetail(Request.QueryString.Get("EK").ToString());
                if (dsEmp.Tables[0].Rows.Count > 0)
                {
                    employeecode.InnerText  = dsEmp.Tables[0].Rows[0]["EmployeeCode"].ToString();
                    employeename2.InnerText = dsEmp.Tables[0].Rows[0]["EmployeeName"].ToString();
                    employeename.InnerText  = "Employee Detail - " + dsEmp.Tables[0].Rows[0]["EmployeeName"].ToString();
                    currposting.InnerText   = dsEmp.Tables[0].Rows[0]["OfficeName"].ToString();

                    designationname.InnerText = dsEmp.Tables[0].Rows[0]["DesignationName"].ToString();
                    empdob.InnerText          = dsEmp.Tables[0].Rows[0]["EmpDOB"].ToString();
                    empdor.InnerText          = dsEmp.Tables[0].Rows[0]["EmpDOR"].ToString();

                    vetanmaan.InnerText  = dsEmp.Tables[0].Rows[0]["Vetanmaan"].ToString();
                    gradevetan.InnerText = dsEmp.Tables[0].Rows[0]["GradeVetan"].ToString();

                    JoiningDate.InnerText       = dsEmp.Tables[0].Rows[0]["EmpDOJ"].ToString();
                    SourceRecruitment.InnerText = dsEmp.Tables[0].Rows[0]["SourceOfAppointment"].ToString();

                    ClassName.InnerText          = dsEmp.Tables[0].Rows[0]["ClassName"].ToString();
                    AppointmentOrderNo.InnerText = dsEmp.Tables[0].Rows[0]["Appointment_Order"].ToString();

                    gender.InnerText = dsEmp.Tables[0].Rows[0]["Gender"].ToString();
                }

                dsTransfer      = db.GetTransferDetail(employeecode.InnerText);
                dsQualification = db.GetQualificationDetail(employeecode.InnerText);
                dsACR           = db.GetACRDetail(employeecode.InnerText);
            }
        }