/// <summary>
    ///In This Data Binding From Database To Datatable Binding to Radgrid
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>

    protected void LoadGrid()
    {
        try
        {
            _obj_Pms_Task             = new SPMS_TASK();
            _obj_Pms_Task.Mode        = 1;
            _obj_Pms_Task.TASK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt = Pms_Bll.get_Task(_obj_Pms_Task);
            if (dt.Rows.Count != 0)
            {
                Rg_Task.DataSource = dt;
                Rg_Task.DataBind();
            }
            else
            {
                DataTable dt1 = new DataTable();
                Rg_Task.DataSource = dt1;
                Rg_Task.DataBind();
            }
        }
        catch (Exception ex)
        {
            //Pms_Bll.ShowMessage(this, ex.Message.ToString());
            //return;
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemple #2
0
    /// <summary>
    ///In This Data Binding From Database To Datatable Binding to Radgrid
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>

    protected void LoadGrid()
    {
        try
        {
            _obj_Pms_Task      = new SPMS_TASK();
            _obj_Pms_Task.Mode = 1;
            DataTable dt = Pms_Bll.get_Task(_obj_Pms_Task);
            if (dt.Rows.Count != 0)
            {
                Rg_Task.DataSource = dt;
                Rg_Task.DataBind();
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Task", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    /// <summary>
    /// WHILE INSERTING THERE IS NO NEED TO ADD LAST MDF BY,LAST MDF DATE,BASED ON LABEL _KRAID IF IT IS NULL THEN PERFORM INSERTION
    /// IF END DATE IS NULL THEN WE HAVE TO USE THIS AND IT IS TO BE DEFINED IN TRANSLAYER
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>


    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (lbl_Task_Id.Text == "")
            {
                _obj_Pms_Task              = new SPMS_TASK();
                _obj_Pms_Task.Mode         = 8;
                _obj_Pms_Task.TASK_NAME    = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));
                _obj_Pms_Task.TASK_EMP_ID  = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value);
                _obj_Pms_Task.TASK_GOAL_ID = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value);
                _obj_Pms_Task.TASK_ORG_ID  = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dt = Pms_Bll.get_Task(_obj_Pms_Task);
                if (dt.Rows.Count != 0)
                {
                    Pms_Bll.ShowMessage(this, "Task Name Already Exist");
                    return;
                }
                else
                {
                    if (rdtp_DATE.SelectedDate < DateTime.Now)
                    {
                        rdtp_DATE.Clear();

                        Pms_Bll.ShowMessage(this, "TaskDate Should Be Greater Than Current Date");
                        return;
                    }

                    _obj_Pms_Appraisalcycle                  = new PMS_Appraisalcycle();
                    _obj_Pms_Appraisalcycle.MODE             = 11;
                    _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_Pms_Appraisalcycle.APPRCYCLE_ID     = Convert.ToInt32(Session["EMP_ID"]);//where i am passing employee to get bunit
                    DataTable dtem = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle);

                    if (dtem.Rows.Count != 0)
                    {
                        _obj_Pms_Appraisalcycle.MODE            = 7;
                        _obj_Pms_Appraisalcycle.APPRCYCLE_BU_ID = Convert.ToInt32(dtem.Rows[0]["EMP_BUSINESSUNIT_ID"]);

                        _obj_Pms_Appraisalcycle.APPRCYCLE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);


                        DataTable dt22 = Pms_Bll.get_Appraisalcycle(_obj_Pms_Appraisalcycle);
                        if (dt22.Rows.Count != 0)
                        {
                            DateTime dt_st = Convert.ToDateTime(dt22.Rows[0]["APPCYCLE_STARTDATE"]);
                            DateTime dt_et = Convert.ToDateTime(dt22.Rows[0]["APPCYCLE_ENDDATE"]);


                            if ((rdtp_DATE.SelectedDate.Value > dt_et) || (rdtp_DATE.SelectedDate.Value < dt_st))
                            {
                                BLL.ShowMessage(this, "Date Should Validate With Appraisal Cycle Date");
                                return;
                            }
                        }

                        else
                        {
                            BLL.ShowMessage(this, "Error Occured");
                            return;
                        }
                    }
                    else
                    {
                        Pms_Bll.ShowMessage(this, "Employee Is In Active");
                        return;
                    }
                    _obj_Pms_Task = new SPMS_TASK();


                    _obj_Pms_Task.TASK_EMP_ID          = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value);
                    _obj_Pms_Task.TASK_NAME            = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));
                    _obj_Pms_Task.TASK_DESCRIPTION     = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text));
                    _obj_Pms_Task.TASK_DATE            = rdtp_DATE.SelectedDate.Value;
                    _obj_Pms_Task.TASK_ORG_ID          = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_Pms_Task.TASK_GOAL_ID         = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value);
                    _obj_Pms_Task.TASK_CREATEDBY       = Convert.ToInt32(Session["USER_ID"]);
                    _obj_Pms_Task.TASK_CREATEDDATE     = DateTime.Now;
                    _obj_Pms_Task.TASK_APPRAISAL_CYCLE = Convert.ToInt32(rcm_apprcycle.SelectedItem.Value);
                    _obj_Pms_Task.Mode = 4;
                    bool status = Pms_Bll.set_Task(_obj_Pms_Task);
                    if (status == true)
                    {
                        LoadGrid();
                        Rg_Task.DataBind();
                        btn_Save.Visible            = true;
                        Rm_TASK_PAGE.SelectedIndex  = 0;
                        Rp_TASK_VIEWDETAILS.Visible = false;
                        Rp_TASK_VIEWMAIN.Visible    = true;
                        Pms_Bll.ShowMessage(this, "Task Inserted Successfully");

                        return;
                    }
                }
            }
            else
            {
                _obj_Pms_Task                      = new SPMS_TASK();
                _obj_Pms_Task.TASK_ID              = Convert.ToInt32(lbl_Task_Id.Text);
                _obj_Pms_Task.TASK_EMP_ID          = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value);
                _obj_Pms_Task.TASK_NAME            = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));
                _obj_Pms_Task.TASK_DESCRIPTION     = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text));
                _obj_Pms_Task.TASK_DATE            = rdtp_DATE.SelectedDate.Value;
                _obj_Pms_Task.TASK_GOAL_ID         = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value);
                _obj_Pms_Task.TASK_LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]);
                _obj_Pms_Task.TASK_LASTMDFDATE     = DateTime.Now;
                _obj_Pms_Task.TASK_APPRAISAL_CYCLE = Convert.ToInt32(rcm_apprcycle.SelectedItem.Value);
                _obj_Pms_Task.Mode                 = 5;
                bool status = Pms_Bll.set_Task(_obj_Pms_Task);
                if (status == true)
                {
                    LoadGrid();
                    Rg_Task.DataBind();
                    btn_Save.Visible            = true;
                    Rm_TASK_PAGE.SelectedIndex  = 0;
                    Rp_TASK_VIEWDETAILS.Visible = false;
                    Rp_TASK_VIEWMAIN.Visible    = true;
                }
                if (status == true)
                {
                    Pms_Bll.ShowMessage(this, "Task Updated Successfully");
                    // return;
                }
            }
        }
        catch (Exception ex)
        {
            //Pms_Bll.ShowMessage(this, ex.Message.ToString());
            //return;
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PmsTask", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemple #4
0
    /// <summary>
    /// WHILE INSERTING THERE IS NO NEED TO ADD LAST MDF BY,LAST MDF DATE,BASED ON LABEL _KRAID IF IT IS NULL THEN PERFORM INSERTION
    /// IF END DATE IS NULL THEN WE HAVE TO USE THIS AND IT IS TO BE DEFINED IN TRANSLAYER
    /// </summary>
    /// <param name="sender"></param>
    ///  <param name="e"></param>


    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (lbl_Task_Id.Text == "")
            {
                _obj_Pms_Task           = new SPMS_TASK();
                _obj_Pms_Task.Mode      = 8;
                _obj_Pms_Task.TASK_NAME = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));

                DataTable dt = Pms_Bll.get_Task(_obj_Pms_Task);
                if (dt.Rows.Count != 0)
                {
                    Pms_Bll.ShowMessage(this, "Task Name Already Exist");
                    return;
                }
                else
                {
                    _obj_Pms_Task = new SPMS_TASK();


                    _obj_Pms_Task.TASK_EMP_ID      = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value);
                    _obj_Pms_Task.TASK_NAME        = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));
                    _obj_Pms_Task.TASK_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text));
                    _obj_Pms_Task.TASK_DATE        = rdtp_DATE.SelectedDate.Value;
                    _obj_Pms_Task.TASK_GOAL_ID     = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value);
                    _obj_Pms_Task.TASK_CREATEDBY   = 1; // ### Need to Get the Session
                    _obj_Pms_Task.TASK_CREATEDDATE = DateTime.Now;
                    _obj_Pms_Task.Mode             = 4;
                    bool status = Pms_Bll.set_Task(_obj_Pms_Task);
                    if (status == true)
                    {
                        Pms_Bll.ShowMessage(this, "Task Inserted Successfully");
                        LoadGrid();
                        Rg_Task.DataBind();
                        btn_Save.Visible           = true;
                        Rm_TASK_PAGE.SelectedIndex = 0;
                        return;
                    }
                }
            }
            else
            {
                _obj_Pms_Task                  = new SPMS_TASK();
                _obj_Pms_Task.TASK_ID          = Convert.ToInt32(lbl_Task_Id.Text);
                _obj_Pms_Task.TASK_EMP_ID      = Convert.ToInt32(rcmb_EmployeeType.SelectedItem.Value);
                _obj_Pms_Task.TASK_NAME        = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskName.Text));
                _obj_Pms_Task.TASK_DESCRIPTION = Pms_Bll.ReplaceQuote(Convert.ToString(rtxt_TaskDescription.Text));
                _obj_Pms_Task.TASK_DATE        = rdtp_DATE.SelectedDate.Value;
                _obj_Pms_Task.TASK_GOAL_ID     = Convert.ToInt32(rcmb_GoalType.SelectedItem.Value);
                _obj_Pms_Task.TASK_LASTMDFBY   = 1; // ### Need to Get the Session
                _obj_Pms_Task.TASK_LASTMDFDATE = DateTime.Now;
                _obj_Pms_Task.Mode             = 5;
                bool status = Pms_Bll.set_Task(_obj_Pms_Task);
                if (status == true)
                {
                    Pms_Bll.ShowMessage(this, "Task Updated Successfully");
                    LoadGrid();
                    Rg_Task.DataBind();
                    btn_Save.Visible           = true;
                    Rm_TASK_PAGE.SelectedIndex = 0;
                    return;
                }
            }
        }

        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Pms_Task", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }