示例#1
0
 public void getDoj()
 {
     try
     {
         string strYear = string.Empty;
         string year    = string.Empty;
         _obj_smhr_Dashboard                 = new SMHR_DAHSBOARD();
         _obj_smhr_Dashboard.OPERATION       = operation.Count;
         _obj_smhr_Dashboard.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dtCount = BLL.get_EMP_ID(_obj_smhr_Dashboard);
         if (dtCount.Rows.Count > 0)
         {
             if (Convert.ToString(dtCount.Rows[0][0]) == "0")
             {
                 // tr_Wishes.Visible = false;
             }
             else
             {
                 // tr_Wishes.Visible = true;
                 _obj_smhr_Dashboard.OPERATION = operation.Select_Doj;
                 DataTable  dtEmpDesc = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                 DataColumn dc        = new DataColumn();
                 dtEmpDesc.Columns.Add(dc);
                 if (Convert.ToString(dtEmpDesc.Rows.Count) == "1")
                 {
                     DataRow dr;
                     dr = dtEmpDesc.NewRow();
                     dtEmpDesc.Rows.Add(dr);
                 }
                 if (dtEmpDesc.Rows.Count > 0)
                 {
                     for (int i = 0; i < dtEmpDesc.Rows.Count; i++)
                     {
                         if (!(Convert.ToString(dtEmpDesc.Rows[i]["EMP_ID"]) == string.Empty))
                         {
                             if (Convert.ToString(dtEmpDesc.Rows[i]["EMP_PICTURE"]) == string.Empty)
                             {
                                 dtEmpDesc.Rows[i]["EMP_PICTURE"] = "~/Images/nophoto.jpg";
                             }
                             if (Convert.ToString(dtEmpDesc.Rows[i]["DIFFERENCE"]) == "1")
                             {
                                 strYear = "Year";
                                 year    = Convert.ToString(dtEmpDesc.Rows[i]["DIFFERENCE"]);
                                 dtEmpDesc.Rows[i]["Column1"] = "On Successful Completion Of " + year + " " + strYear + " with Dhanush. And We look forword to go a long way together....Cheers.";
                             }
                             else if (Convert.ToString(dtEmpDesc.Rows[i]["DIFFERENCE"]) == "0")
                             {
                                 dtEmpDesc.Rows[i]["Column1"] = "We take this opportunity to join you in extending a warm welcome to the above employees, who have joined Dhanush InfoTech Family.";
                             }
                             else
                             {
                                 strYear = "Years";
                                 year    = Convert.ToString(dtEmpDesc.Rows[i]["DIFFERENCE"]);
                                 dtEmpDesc.Rows[i]["Column1"] = "On Successful Completion Of " + year + " " + strYear + " with Dhanush. And We look forword to go a long way together....Cheers.";
                             }
                         }
                         else
                         {
                         }
                     }
                     //radRotate.DataSource = dtEmpDesc;
                     //radRotate.DataBind();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Dashboradmngr", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                loadPeriod();
                SMHR_PERIOD _obj_smhr_Period = new SMHR_PERIOD();
                _obj_smhr_Period.OPERATION       = operation.Empty;
                _obj_smhr_Period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dt_DetailsLoad = BLL.get_PeriodHeaderDetails(_obj_smhr_Period);
                if (dt_DetailsLoad.Rows.Count > 0)
                {
                    rcmbPeriod.SelectedIndex = rcmbPeriod.Items.FindItemIndexByValue(Convert.ToString(dt_DetailsLoad.Rows[0][0]));
                }
                loadPeriodElement();
                SMHR_PERIODDTL obj_smhr_Prddtl = new SMHR_PERIODDTL();
                obj_smhr_Prddtl.OPERATION        = operation.Empty;
                obj_smhr_Prddtl.PRDDTL_PERIOD_ID = Convert.ToInt32(dt_DetailsLoad.Rows[0][0]);
                DataTable dtPrddtl = BLL.get_PeriodDetails(obj_smhr_Prddtl);
                if (dtPrddtl.Rows.Count > 0)
                {
                    rcmbPeriodElement.SelectedIndex = rcmbPeriodElement.Items.FindItemIndexByValue(Convert.ToString(dtPrddtl.Rows[0][0]));
                }
            }

            #region Display Leave-Balance in Pie-Chart
            if (!Page.IsPostBack)
            {
                bool status = false;

                Color[] barColors = new Color[8] {
                    Color.Purple,
                    Color.SteelBlue,
                    Color.Aqua,
                    Color.Yellow,
                    Color.Navy,
                    Color.Green,
                    Color.Blue,
                    Color.Red
                };


                SMHR_PERIOD obj_smhr_Period = new SMHR_PERIOD();
                obj_smhr_Period.OPERATION       = operation.Empty;
                obj_smhr_Period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dt_Details = BLL.get_PeriodHeaderDetails(obj_smhr_Period);
                if (dt_Details.Rows.Count != 0)
                {
                    _obj_smhr_Dashboard           = new SMHR_DAHSBOARD();
                    _obj_smhr_Dashboard.OPERATION = operation.Select_New;
                    _obj_smhr_Dashboard.SMHR_DASHBOARD_PERIODID = Convert.ToInt32(dt_Details.Rows[0][0]);
                    _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID   = Convert.ToInt32(Session["EMP_ID"]);
                    DataTable dt_LeaveBalance = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                    if (dt_LeaveBalance.Rows.Count != 0)
                    {
                        for (int dt_rowcount = 0; dt_rowcount < dt_LeaveBalance.Rows.Count; dt_rowcount++)
                        {
                            if (dt_LeaveBalance.Rows.Count == 1)
                            {
                                if (Convert.ToDouble(dt_LeaveBalance.Rows[dt_rowcount]["LT_CURRENTBALANCE"]) == 0.00)
                                {
                                    lbl_ZeroLeaves.Visible = true;
                                    lbl_ZeroLeaves.Text    = "No leaves available";
                                    status = true;
                                }
                            }
                        }
                        if (status == false)
                        {
                            int i = 0;
                            RadChart2.Visible    = true;
                            RadChart2.DataSource = dt_LeaveBalance;
                            RadChart2.DataBind();
                            foreach (var item in RadChart2.Series[0].Items)
                            {
                                item.Appearance.FillStyle.MainColor = barColors[i++];
                            }
                        }
                    }
                    else
                    {
                        lbl_ZeroLeaves.Visible = true;
                        lbl_ZeroLeaves.Text    = "No leaves available";
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "Current Period does not contains Leave Balances");
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LeaveChart", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
        #endregion
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session["DASHBOARD"] = "true";
            }

            if (Convert.ToString(Session["EMP_ID"]) == "")
            {
                Response.Redirect("Login.aspx", false);
            }
            if (!Page.IsPostBack)
            {
                lbl_Birthday.Text = "BIRTHDAY REMINDERS - " + DateTime.Now.ToLongDateString().ToUpper();
                getBirthday();

                string str_Loginid = Convert.ToString(Session["USER_ID"]);

                _obj_smhr_Dashboard = new SMHR_DAHSBOARD();

                //CODE FOR FETCHING EMPLOYEE NAME
                _obj_smhr_Dashboard.OPERATION             = operation.Select;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID = Convert.ToInt32(str_Loginid);
                DataTable dt_getEMP_NAME = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dt_getEMP_NAME.Rows.Count != 0)
                {
                    lbl_EmpName.Text       = Convert.ToString(dt_getEMP_NAME.Rows[0][0]);
                    lbl_EmpBloodGroup.Text = Convert.ToString(dt_getEMP_NAME.Rows[0][1]);
                }
                else
                {
                    BLL.ShowMessage(this, "No employee name exists for this login id");
                    //Response.Redirect("~/Login.aspx");
                }

                //CODE FOR FETCHING EMPLOYEE ID
                _obj_smhr_Dashboard.OPERATION = operation.Select_Emp;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_LOGIN_ID = Convert.ToInt32(str_Loginid);
                DataTable dt_getEMP_ID = BLL.get_EMP_ID(_obj_smhr_Dashboard);

                string STR_EMP_ID = Convert.ToString(dt_getEMP_ID.Rows[0][0]);
                lbl_EmpId.Text = STR_EMP_ID;

                //CODE FOR FETCHING EMPLOYEE DESIGNATION
                _obj_smhr_Dashboard.OPERATION             = operation.Select_Pos;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_getEMP_DESG = BLL.get_EMP_ID(_obj_smhr_Dashboard);

                lbl_EmpDesignation.Text = Convert.ToString(dt_getEMP_DESG.Rows[0][0]);

                //CODE FOR FETCHING EMPLOYEE DEPARTMENT
                _obj_smhr_Dashboard.OPERATION             = operation.Select_Dept;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_getEMP_DEPT = BLL.get_EMP_ID(_obj_smhr_Dashboard);

                lbl_EmpDepartment.Text = Convert.ToString(dt_getEMP_DEPT.Rows[0][0]);


                //NO of Pending Leave Applications
                _obj_smhr_Leaveapp                     = new SMHR_LEAVEAPP();
                _obj_smhr_Leaveapp.OPERATION           = operation.Check_New;
                _obj_smhr_Leaveapp.LEAVEAPP_STATUS     = Convert.ToInt32(0);
                _obj_smhr_Leaveapp.LEAVEAPP_APPROVEDBY = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_NoOfPendingLeave = BLL.get_LeaveApp(_obj_smhr_Leaveapp);
                lbl_pendingleave.Text = Convert.ToString(dt_NoOfPendingLeave.Rows[0][0]);


                //No of Pending Comp-Off Application
                _obj_smhr_Compoff                       = new SMHR_EMPCOMOFF();
                _obj_smhr_Compoff.OPERATION             = operation.Check_New;
                _obj_smhr_Compoff.EMPCOMPOFF_STATUS     = Convert.ToInt32(0);
                _obj_smhr_Compoff.EMPCOMPOFF_APPROVEDBY = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_NoOfPendingCOMPOFF = BLL.get_empcompffs(_obj_smhr_Compoff);
                lbl_pendingcompoff.Text = Convert.ToString(dt_NoOfPendingCOMPOFF.Rows[0][0]);

                //No of Pending Expense Applications
                _obj_smhr_Expense                    = new SMHR_EXPENSE();
                _obj_smhr_Expense.OPERATION          = operation.Check_New;
                _obj_smhr_Expense.EXPENSE_STATUS     = Convert.ToInt32(0);
                _obj_smhr_Expense.EXPENSE_APPROVEDBY = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_NoOfPendingExpense = BLL.get_Expense(_obj_smhr_Expense);
                lbl_pendingexpense.Text = Convert.ToString(dt_NoOfPendingExpense.Rows[0][0]);


                //No of Pending Loan Applications


                //EMPLOYEE LEAVE APPLICATION STATUS
                _obj_smhr_Leaveapp           = new SMHR_LEAVEAPP();
                _obj_smhr_Leaveapp.OPERATION = operation.Select_New;

                _obj_smhr_Leaveapp.EMP_ID = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_leavestatus = BLL.get_LeaveApp(_obj_smhr_Leaveapp);
                int       int_NoOfLeaves = dt_leavestatus.Rows.Count;
                if (int_NoOfLeaves == 0)
                {
                    lbl_MgrLeaveAppStatus.Text = "No leave application status available";
                    //BLL.ShowMessage(this, "No data available");
                }
                else
                {
                    int lastLeaveStatus = Convert.ToInt32(dt_leavestatus.Rows[int_NoOfLeaves - 1][0]);
                    if (lastLeaveStatus == 0)
                    {
                        lbl_MgrLeaveAppStatus.Text = "Leave Application Pending";
                    }
                    else if (lastLeaveStatus == 1)
                    {
                        lbl_MgrLeaveAppStatus.Text = "Leave Application Approved";
                    }
                    else if (lastLeaveStatus == 2)
                    {
                        lbl_MgrLeaveAppStatus.Text = "Leave Application Rejected";
                    }
                    else if (lastLeaveStatus == 3)
                    {
                        lbl_MgrLeaveAppStatus.Text = "Leave Application Cancelled";
                    }
                    else
                    {
                        lbl_MgrLeaveAppStatus.Text = "Leave Application Not Found";
                    }
                }

                //EMPLOYEE COMP-OFF APPLICATION STATUS
                _obj_smhr_Compoff           = new SMHR_EMPCOMOFF();
                _obj_smhr_Compoff.OPERATION = operation.Select_New;
                _obj_smhr_Compoff.EMP_ID    = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_compoff      = BLL.get_empcompffs(_obj_smhr_Compoff);
                int       int_NoOfCompOff = dt_compoff.Rows.Count;
                if (int_NoOfCompOff == 0)
                {
                    lbl_MgrCompOffAppStatus.Text = "No comp-off application status available";
                    // BLL.ShowMessage(this, "No data available");
                }
                else
                {
                    int lastCompOffStatus = Convert.ToInt32(dt_compoff.Rows[(int_NoOfCompOff) - 1][0]);
                    if (lastCompOffStatus == 0)
                    {
                        lbl_MgrCompOffAppStatus.Text = "Comp-Off Application Pending";
                    }
                    else if (lastCompOffStatus == 1)
                    {
                        lbl_MgrCompOffAppStatus.Text = "Comp-Off Application Approved";
                    }
                    else if (lastCompOffStatus == 2)
                    {
                        lbl_MgrCompOffAppStatus.Text = "Comp-Off Applicaiton Rejected";
                    }
                    else if (lastCompOffStatus == 3)
                    {
                        lbl_MgrCompOffAppStatus.Text = "Comp-Off Application Cancelled";
                    }
                    else
                    {
                        lbl_MgrCompOffAppStatus.Text = "Comp-Off Application Not Found";
                    }
                }


                //EMPLOYEE EXPENSE APPLICATION STATUS
                _obj_smhr_Expense           = new SMHR_EXPENSE();
                _obj_smhr_Expense.OPERATION = operation.Select_New;
                _obj_smhr_Expense.EMP_ID    = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_expense = BLL.get_Expense(_obj_smhr_Expense);

                int int_NoOfExpense = dt_compoff.Rows.Count;
                if (int_NoOfExpense == 0)
                {
                    lbl_MgrExpenseAppStatus.Text = "No expense application status available";
                }
                else
                {
                    int lastExpenseStatus = Convert.ToInt32(dt_compoff.Rows[(int_NoOfExpense) - 1][0]);
                    if (lastExpenseStatus == 0)
                    {
                        lbl_MgrExpenseAppStatus.Text = "Expense Application Pending";
                    }
                    else if (lastExpenseStatus == 1)
                    {
                        lbl_MgrExpenseAppStatus.Text = "Expense Application Approved";
                    }
                    else if (lastExpenseStatus == 2)
                    {
                        lbl_MgrExpenseAppStatus.Text = "Expense Application Rejected";
                    }
                    else if (lastExpenseStatus == 3)
                    {
                        lbl_MgrExpenseAppStatus.Text = "Expense Application Cancelled";
                    }
                    else
                    {
                        lbl_MgrExpenseAppStatus.Text = "Expense Application Not Found";
                    }
                }



                //Modified
                #region Pie-Chart for Ytd Balances
                _obj_smhr_Dashboard = new SMHR_DAHSBOARD();

                string str_MonthNo = DateTime.Now.Month.ToString();
                System.Globalization.DateTimeFormatInfo mfi = new System.Globalization.DateTimeFormatInfo();
                string str_Period_Month = mfi.GetMonthName(Convert.ToInt32(str_MonthNo));

                string str_Period_Year = DateTime.Now.Year.ToString();
                string str_PeriodName  = str_Period_Month.ToUpper() + " " + str_Period_Year;
                _obj_smhr_Dashboard.OPERATION = operation.Check_New;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_PERIODNAME = str_PeriodName;
                DataTable dt_PeriodID = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dt_PeriodID.Rows.Count == 0)
                {
                    //DataTable dt_ZeroYtdBalance = new DataTable();

                    //BLL.ShowMessage(this, "No data available");
                }
                string str_PeriodId = Convert.ToString(dt_PeriodID.Rows[0][0]);
                _obj_smhr_Dashboard.OPERATION               = operation.Check1;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID   = Convert.ToInt32(STR_EMP_ID);
                _obj_smhr_Dashboard.SMHR_DASHBOARD_PERIODID = Convert.ToInt32(str_PeriodId);
                DataTable dt_YtdBalance = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dt_YtdBalance.Rows.Count == 0)
                {
                    DataTable  dt_ZeroYtdBalance      = new DataTable();
                    DataRow    dr_ZeroYtdBalance      = dt_ZeroYtdBalance.NewRow();
                    DataColumn dc_ZeroYtdBalance      = new DataColumn();
                    DataColumn dc_ZeroPayItem_PayDesc = new DataColumn();
                    dc_ZeroYtdBalance.ColumnName      = "YtdBalance";
                    dc_ZeroPayItem_PayDesc.ColumnName = "payitem_paydesc";
                    dt_ZeroYtdBalance.Columns.Add(dc_ZeroYtdBalance);
                    dt_ZeroYtdBalance.Columns.Add(dc_ZeroPayItem_PayDesc);
                    dr_ZeroYtdBalance["YtdBalance"]      = "0.00";
                    dr_ZeroYtdBalance["payitem_paydesc"] = "Ytd Balances";
                    dt_ZeroYtdBalance.Rows.Add(dr_ZeroYtdBalance);
                    RadChart_YtdBalances.DataSource = dt_ZeroYtdBalance;
                    RadChart_YtdBalances.DataBind();

                    //RadChart_YtdBalances.Visible = false;
                    //BLL.ShowMessage(this, "No data  available for ytd balances");
                }
                else
                {
                    RadChart_YtdBalances.DataSource = dt_YtdBalance;
                    RadChart_YtdBalances.DataBind();
                }

                #endregion

                //Pie-chart
                #region Pie-Chart for Leave Balance
                bool status = false;
                _obj_smhr_Dashboard = new SMHR_DAHSBOARD();
                string str_Current_Year = DateTime.Now.Year.ToString();
                _obj_smhr_Dashboard.SMHR_DASHBOARD_PERIODNAME = str_Current_Year;
                _obj_smhr_Dashboard.OPERATION = operation.Select_Period;
                DataTable dt_Period_ID    = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                string    str_Period_Name = Convert.ToString(dt_Period_ID.Rows[0][0]);
                _obj_smhr_Dashboard.OPERATION = operation.Select_New;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_PERIODNAME = str_Period_Name;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID     = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_LeaveBalance = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dt_LeaveBalance.Rows.Count != 0)
                {
                    for (int int_rowcount = 0; int_rowcount < dt_LeaveBalance.Rows.Count; int_rowcount++)
                    {
                        if (Convert.ToDouble(dt_LeaveBalance.Rows[int_rowcount]["LT_CURRENTBALANCE"]) == 0.00)
                        {
                            //BLL.ShowMessage(this, "No leaves to have fun");
                            lbl_zeroleave.Visible = true;
                            lbl_zeroleave.Text    = "No leaves available";
                            status = true;
                        }
                    }
                    if (status == false)
                    {
                        RadChart2.Visible    = true;
                        RadChart2.DataSource = dt_LeaveBalance;
                        RadChart2.DataBind();
                    }
                }
                else
                {
                    lbl_zeroleave.Visible = true;
                    lbl_zeroleave.Text    = "No leaves available";
                    //BLL.ShowMessage(this, "No data available for leave balances");
                }
                #endregion

                #region Pie-Chart for Performance Hikes
                _obj_smhr_Dashboard                       = new SMHR_DAHSBOARD();
                _obj_smhr_Dashboard.OPERATION             = operation.Select_Hike;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID = Convert.ToInt32(STR_EMP_ID);
                DataTable dt_Hike = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dt_Hike.Rows.Count != 0)
                {
                    for (int int_rowcount = 0; int_rowcount < dt_Hike.Rows.Count; int_rowcount++)
                    {
                        if (Convert.ToDouble(dt_Hike.Rows[int_rowcount]["Hike"]) == 0.00)
                        {
                            //BLL.ShowMessage(this, "No leaves to have fun");
                            lbl_zerohike.Visible = true;
                            lbl_zerohike.Text    = "No leaves available";
                            status = true;
                        }
                    }
                    if (status == false)
                    {
                        RadChart_Performance.Visible    = true;
                        RadChart_Performance.DataSource = dt_Hike;
                        RadChart_Performance.DataBind();
                    }
                }
                else
                {
                    lbl_zerohike.Visible = true;
                    lbl_zerohike.Text    = "No leaves to have fun";
                    //BLL.ShowMessage(this, "No data available for leave balances");
                }
                #endregion

                //Code For scrolling text
                //_obj_smhr_Recruitmentupdates = new SMHR_RECRUITMENTUPDATES();
                //_obj_smhr_Recruitmentupdates.OPERATION = operation.Select_New;
                //_obj_smhr_Recruitmentupdates.SMHR_CURRENTDATE = DateTime.Now;
                //DataTable dt_RecruitmentUpdates = BLL.get_RecruitmentUpdates(_obj_smhr_Recruitmentupdates);
                //if (dt_RecruitmentUpdates.Rows.Count != 0)
                //{
                //    //string str_ReqName = dt_RecruitmentUpdates.Rows[0]["JOBREQ_REQNAME"].ToString();
                //    Radticker1.DataSource = dt_RecruitmentUpdates;// dt_RecruitmentUpdates;
                //    Radticker1.DataTextField = "JOBREQ_UPDATE";
                //    //Radticker1.DataMember = str_ReqName;
                //    Radticker1.DataBind();
                //}
                //else
                //{
                //    BLL.ShowMessage(this, "Recruitment are closed now");
                //}
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Dashboard1", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void rcmbPeriodElement_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        try
        {
            if (rcmbPeriodElement.SelectedIndex > 0)
            {
                trLeaveBalance.Visible = true;
                bool status = false;

                Color[] barColors = new Color[8] {
                    Color.Purple,
                    Color.SteelBlue,
                    Color.Aqua,
                    Color.Yellow,
                    Color.Navy,
                    Color.Green,
                    Color.Blue,
                    Color.Red
                };
                _obj_smhr_Dashboard           = new SMHR_DAHSBOARD();
                _obj_smhr_Dashboard.OPERATION = operation.Empty;
                _obj_smhr_Dashboard.SMHR_DASHBOARD_PRDDTL_ID = Convert.ToInt32(rcmbPeriodElement.SelectedValue);
                _obj_smhr_Dashboard.SMHR_DASHBOARD_EMP_ID    = Convert.ToInt32(Session["EMP_ID"]);
                DataTable dtLeaveDtl = BLL.get_EMP_ID(_obj_smhr_Dashboard);
                if (dtLeaveDtl.Rows.Count > 0)
                {
                    lbl_ZeroLeaves.Visible = false;
                    for (int dt_rowcount = 0; dt_rowcount < dtLeaveDtl.Rows.Count; dt_rowcount++)
                    {
                        if (dtLeaveDtl.Rows.Count == 1)
                        {
                            if (Convert.ToDouble(dtLeaveDtl.Rows[dt_rowcount]["LT_CURRENTBALANCE"]) == 0.00)
                            {
                                lbl_ZeroLeaves.Visible = true;
                                lbl_ZeroLeaves.Text    = "No leaves available";
                                trLeaveBalance.Visible = false;
                                status = true;
                            }
                        }
                    }
                    if (status == false)
                    {
                        int i = 0;
                        RadChart2.Visible    = true;
                        RadChart2.DataSource = dtLeaveDtl;
                        RadChart2.DataBind();
                        foreach (var item in RadChart2.Series[0].Items)
                        {
                            item.Appearance.FillStyle.MainColor = barColors[i++];
                        }
                    }
                }
                else
                {
                    lbl_ZeroLeaves.Visible = true;
                    lbl_ZeroLeaves.Text    = "No leaves available";
                    trLeaveBalance.Visible = false;
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LeaveChart", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }