Exemplo n.º 1
0
    /// <summary>
    /// load grid methods
    /// </summary>
    public void LoadGrid()
    {
        try
        {
            _obj_Smhr_Course = new SMHR_COURSE();
            _obj_Smhr_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);

            DataTable DT = BLL.get_Course(_obj_Smhr_Course);
            if (DT.Rows.Count != 0)
            {
                Rg_Course.DataSource = DT;
            }

            else
            {
                DataTable dt1 = new DataTable();
                Rg_Course.DataSource = dt1;
            }
            clearControls();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Course", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    private void LoadCombos()
    {
        btn_submit.Visible          = false;
        Btn_cancel.Visible          = false;
        RG_TrainingApproval.Visible = false;

        try
        {
            SMHR_COURSE _obj_Course = new SMHR_COURSE();
            _obj_Course.OPERATION     = operation.Select2;
            _obj_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            rc_Course.DataSource      = BLL.get_Course(_obj_Course);
            rc_Course.DataTextField   = "COURSE_NAME";
            rc_Course.DataValueField  = "COURSE_ID";
            rc_Course.DataBind();
            rc_Course.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
            rc_CourseSchedule.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
            rc_Days.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_AttendanceDetails", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// To Load BusinessUnit Details the Dropdown
    /// </summary>



    #endregion

    #region edit command methods
    /// <summary>
    /// to edit particular course based on command argument
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            //lbl_CourseHeader.Visible = false;
            rcmb_CC.Enabled         = false;
            rtxt_CourseName.Enabled = false;
            clearControls();
            LoadCombos();
            //lbl_CourseName.Enabled = false;

            //lbl_labl.Text = Convert.ToString(e.CommandArgument);
            SMHR_COURSE oSMHR_COURSE = new SMHR_COURSE();
            oSMHR_COURSE.OPERATION = operation.Select;
            oSMHR_COURSE.COURSE_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument));
            DataTable dt = BLL.get_Course(oSMHR_COURSE);
            if (dt.Rows.Count != 0)
            {
                lbl_CourseId.Text      = Convert.ToString(dt.Rows[0]["COURSE_ID"]);
                rtxt_CourseName.Text   = Convert.ToString(dt.Rows[0]["COURSE_NAME"]);
                rtxt_CourseDesc.Text   = Convert.ToString(dt.Rows[0]["COURSE_DESC"]);
                rtxt_CDS.Text          = Convert.ToString(dt.Rows[0]["COURSE_DESIGNEDFOR"]);
                radCourseDuration.Text = Convert.ToString(dt.Rows[0]["COURSE_DURATION"]);
                rcmb_CC.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem(Convert.ToString(dt.Rows[0]["HR_MASTER_CODE"]), Convert.ToString(dt.Rows[0]["COURSE_CATEGORYID"])));
                //rcmb_CC.SelectedIndex = rcmb_CC.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["COURSE_CATEGORYID"]));
                rad_IsActive.Checked = Convert.ToBoolean(dt.Rows[0]["COURSE_STATUS"]);
                hdnStatus.Value      = Convert.ToString(dt.Rows[0]["COURSE_STATUS"]);
                if (rad_IsActive.Checked)
                {
                    rtxt_CourseDesc.Enabled   = true;
                    rtxt_CDS.Enabled          = true;
                    radCourseDuration.Enabled = true;
                }
                else
                {
                    rtxt_CourseDesc.Enabled   = false;
                    rtxt_CDS.Enabled          = false;
                    radCourseDuration.Enabled = false;
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    btn_Update.Visible = false;
                }

                else
                {
                    btn_Update.Visible = true;
                }

                Rm_Course_page.SelectedIndex = 1;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Course", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 4
0
 private void LoadCourseName()
 {
     try
     {
         SMHR_COURSE _obj_Course = new SMHR_COURSE();
         _obj_Course.OPERATION          = operation.Select2;
         _obj_Course.COURSE_ORG_ID      = Convert.ToInt32(Session["ORG_ID"].ToString()); //Convert.ToInt32(Session["ORG_ID"]);
         rcmb_CourseName.DataSource     = BLL.get_Course(_obj_Course);
         rcmb_CourseName.DataTextField  = "COURSE_NAME";
         rcmb_CourseName.DataValueField = "COURSE_ID";
         rcmb_CourseName.DataBind();
         rcmb_CourseName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingCosts", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Exemplo n.º 5
0
    private void LoadCombos()
    {
        try
        {
            obj_smhr_Period                 = new SMHR_PERIOD();
            obj_smhr_Period.OPERATION       = operation.Select;
            obj_smhr_Period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Details = BLL.get_PeriodHeaderDetails(obj_smhr_Period);
            //DataTable dt_Details = BLL.get_PeriodHeaderDetails_Calendar(obj_smhr_Period);
            rcmb_Period.DataSource     = dt_Details;
            rcmb_Period.DataValueField = "PERIOD_ID";
            rcmb_Period.DataTextField  = "PERIOD_NAME";
            rcmb_Period.DataBind();
            rcmb_Period.Items.Insert(0, new RadComboBoxItem("Select"));

            _obj_Smhr_Location = new SMHR_TRAINING_LOCATION();
            _obj_Smhr_Location.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Location.OPERATION       = operation.Select1;
            rcmb_Location.DataSource           = BLL.get_TrainingLocation(_obj_Smhr_Location);
            rcmb_Location.DataTextField        = "Location_Name";
            rcmb_Location.DataValueField       = "Location_ID";
            rcmb_Location.DataBind();
            rcmb_Location.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            if (string.Compare(Control, "EmployeeAttendance", true) == 0)
            {
                SMHR_COURSE _obj_Course = new SMHR_COURSE();
                _obj_Course.OPERATION      = operation.Select2;
                _obj_Course.COURSE_ORG_ID  = Convert.ToInt32(Session["ORG_ID"]); //Convert.ToInt32(Session["ORG_ID"]);
                rcmb_Course.DataSource     = BLL.get_Course(_obj_Course);
                rcmb_Course.DataTextField  = "COURSE_NAME";
                rcmb_Course.DataValueField = "COURSE_ID";
                rcmb_Course.DataBind();
                rcmb_Course.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "LocationWiseTrainingProgram", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 6
0
 private void BindCourseCategory()
 {
     try
     {
         SMHR_COURSE _obj_Course = new SMHR_COURSE();
         _obj_Course.OPERATION     = operation.Select;
         _obj_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
         rc_Course.DataSource      = BLL.get_Course(_obj_Course);
         rc_Course.DataTextField   = "COURSE_NAME";
         rc_Course.DataValueField  = "COURSE_ID";
         rc_Course.DataBind();
         rc_Course.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
     }
     catch (Exception ex)
     {
         //Utils.HandleWebException(ex, this);
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Frm_Assessment", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Exemplo n.º 7
0
    private void LoadCombos()
    {
        try
        {
            SMHR_COURSE _obj_Course = new SMHR_COURSE();
            _obj_Course.OPERATION     = operation.Select2;
            _obj_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); //Convert.ToInt32(Session["ORG_ID"]);
            radCourse.DataSource      = BLL.get_Course(_obj_Course);
            radCourse.DataTextField   = "COURSE_NAME";
            radCourse.DataValueField  = "COURSE_ID";
            radCourse.DataBind();
            radCourse.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            _obj_Smhr_Masters                 = new SMHR_MASTERS();
            _obj_Smhr_Masters.MASTER_TYPE     = "COURSETYPE";
            _obj_Smhr_Masters.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            radCourseType.DataSource          = BLL.get_MasterRecords(_obj_Smhr_Masters);
            radCourseType.DataTextField       = "HR_MASTER_CODE";
            radCourseType.DataValueField      = "HR_MASTER_ID";
            radCourseType.DataBind();
            radCourseType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));

            _obj_Smhr_Location = new SMHR_TRAINING_LOCATION();
            _obj_Smhr_Location.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Location.OPERATION       = operation.Select1;
            radLocation.DataSource             = BLL.get_TrainingLocation(_obj_Smhr_Location);
            radLocation.DataTextField          = "Location_Name";
            radLocation.DataValueField         = "Location_ID";
            radLocation.DataBind();
            radLocation.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_CourseSchedule", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 8
0
 protected void rcmb_CC_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
 {
     try
     {
         if (rcmb_CC.SelectedIndex > 0)
         {
             SMHR_COURSE _obj_Smhr_Course = new SMHR_COURSE();
             _obj_Smhr_Course.COURSE_ORG_ID     = Convert.ToInt32(Session["ORG_ID"]);
             _obj_Smhr_Course.COURSE_CATEGORYID = rcmb_CC.SelectedValue;
             _obj_Smhr_Course.OPERATION         = operation.Get;
             DataTable DT = BLL.get_Course(_obj_Smhr_Course);
             rcmb_CourseName.DataSource     = DT;
             rcmb_CourseName.DataValueField = "COURSE_ID";
             rcmb_CourseName.DataTextField  = "COURSE_NAME";
             rcmb_CourseName.DataBind();
             rcmb_CourseName.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0"));
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Exemplo n.º 9
0
    /// <summary>
    /// save click methods
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Smhr_Course                   = new SMHR_COURSE();
            _obj_Smhr_Course.COURSE_NAME       = BLL.ReplaceQuote(rtxt_CourseName.Text);
            _obj_Smhr_Course.COURSE_DESC       = BLL.ReplaceQuote(rtxt_CourseDesc.Text);
            _obj_Smhr_Course.COURSE_CATEGORYID = rcmb_CC.SelectedItem.Value;
            _obj_Smhr_Course.COURSE_DURATION   = Convert.ToInt32(radCourseDuration.Text);
            _obj_Smhr_Course.COURSE_STATUS     = rad_IsActive.Checked;

            _obj_Smhr_Course.CREATEDBY          = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Course.CREATEDDATE        = DateTime.Now;
            _obj_Smhr_Course.COURSE_ORG_ID      = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Course.LASTMDFBY          = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Course.LASTMDFDATE        = DateTime.Now;
            _obj_Smhr_Course.COURSE_DESIGNEDFOR = rtxt_CDS.Text;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                if (rad_IsActive.Checked == false && rad_IsActive.Checked == Convert.ToBoolean(hdnStatus.Value))
                {
                    BLL.ShowMessage(this, "There is no data to update");
                    Rm_Course_page.SelectedIndex = 0;
                    LoadGrid();
                    return;
                }
                if (rad_IsActive.Checked)
                {
                    _obj_Smhr_Course.OPERATION = operation.Select1;
                    if (!Convert.ToBoolean(BLL.get_Course(_obj_Smhr_Course).Rows[0]["HR_MASTER_STATUS"]))
                    {
                        BLL.ShowMessage(this, "Please Change Course Category Status to Active for this Course");
                        Rm_Course_page.SelectedIndex = 0;
                        LoadGrid();
                        return;
                    }
                }
                else
                {
                    SMHR_COURSESCHEDULE _obj_CS = new SMHR_COURSESCHEDULE();
                    _obj_CS.OPERATION = operation.Online;
                    _obj_CS.COURSESCHEDULE_COURSEID = Convert.ToInt32(lbl_CourseId.Text);
                    _obj_CS.ORGANISATION_ID         = Convert.ToInt32(Session["ORG_ID"]);
                    // _obj_CS.COURSESCHEDULE_STATUS=rad_IsActive.Checked;
                    DataTable dtc = BLL.get_CourseSchedule(_obj_CS);
                    if (!Convert.ToBoolean(dtc.Rows[0]["Status"]))
                    {
                        BLL.ShowMessage(this, Convert.ToString(dtc.Rows[0]["ErrorMessage"]));
                        rad_IsActive.Checked         = true;
                        Rm_Course_page.SelectedIndex = 0;
                        LoadGrid();
                        return;
                    }
                }
                //if (Convert.ToBoolean(rad_IsActive.Checked) == false)
                //{
                //    SMHR_TRAINERPROFILE _obj_Trainer = new SMHR_TRAINERPROFILE();
                //    _obj_Trainer.TRAINER_ORGID = Convert.ToInt32(Session["ORG_ID"]);
                //    _obj_Trainer.Trainer_CourseCategory = Convert.ToInt32(lbl_CourseId.Text);
                //    _obj_Trainer.OPERATION = operation.Scale;
                //    DataTable dt = BLL.get_TrainingProfile(_obj_Trainer);
                //    if (!Convert.ToBoolean(dt.Rows[0]["Status"]))
                //    {
                //        BLL.ShowMessage(this, "Cannot make inactive");
                //        rad_IsActive.Checked = true;
                //        return;
                //    }
                //}
                _obj_Smhr_Course.COURSE_ID = Convert.ToInt32(lbl_CourseId.Text);
                _obj_Smhr_Course.OPERATION = operation.Update;
                if (BLL.set_Course(_obj_Smhr_Course))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            case "BTN_SAVE":
                _obj_Smhr_Course.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_Course(_obj_Smhr_Course).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Course with this Name Already Exists");
                    return;
                }
                _obj_Smhr_Course.OPERATION = operation.Insert;
                if (BLL.set_Course(_obj_Smhr_Course))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_Course_page.SelectedIndex = 0;
            LoadGrid();
            Rg_Course.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Course", ex.StackTrace, DateTime.Now);

            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Exemplo n.º 10
0
    /// <summary>
    /// save click methods
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if ((rlb_skills.Items.Count != 0))
            {
                Label                  Label1     = new Label();
                StringBuilder          sb         = new StringBuilder();
                IList <RadListBoxItem> collection = rlb_skills.CheckedItems;
                foreach (RadListBoxItem item in collection)
                {
                    if (sb.Length == 0)
                    {
                        sb.Append(item.Value);
                    }
                    else
                    {
                        sb.Append("," + item.Value);
                    }
                }
                Label1.Text      = sb.ToString();
                _obj_Smhr_Course = new SMHR_COURSE();
                if (Label1.Text == "")
                {
                    _obj_Smhr_Course.COURSE_SKILL_WID = Convert.ToString(0);
                }
                else
                {
                    _obj_Smhr_Course.COURSE_SKILL_WID = Convert.ToString(Label1.Text);
                }

                _obj_Smhr_Course.COURSE_BUSINESSUNIT_ID = Convert.ToInt32(rcmb_BusinessUnitType.SelectedItem.Value);
                _obj_Smhr_Course.COURSE_NAME            = BLL.ReplaceQuote(rtxt_CourseName.Text.ToUpper());
                _obj_Smhr_Course.COURSE_DESC            = BLL.ReplaceQuote(rtxt_CourseDesc.Text);
                _obj_Smhr_Course.COURSE_CATEGORYID      = rcmb_CC.SelectedItem.Value;

                _obj_Smhr_Course.CREATEDBY     = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_Smhr_Course.CREATEDDATE   = DateTime.Now;
                _obj_Smhr_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_Course.LASTMDFBY     = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_Smhr_Course.LASTMDFDATE   = DateTime.Now;

                switch (((Button)sender).ID.ToUpper())
                {
                case "BTN_UPDATE":
                    _obj_Smhr_Course.COURSE_ID     = Convert.ToInt32(lbl_CourseId.Text);
                    _obj_Smhr_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_Smhr_Course.OPERATION     = operation.Check;
                    if (Convert.ToString(BLL.get_Course(_obj_Smhr_Course).Rows[0]["Count"]) != "1")
                    {
                        BLL.ShowMessage(this, "Course with this Name Already Exists");
                        return;
                    }
                    _obj_Smhr_Course.OPERATION = operation.Update;
                    if (BLL.set_Course(_obj_Smhr_Course))
                    {
                        BLL.ShowMessage(this, "Information Updated Successfully");
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Information Not Saved");
                    }
                    break;

                case "BTN_SAVE":
                    _obj_Smhr_Course.OPERATION     = operation.Check;
                    _obj_Smhr_Course.COURSE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    if (Convert.ToString(BLL.get_Course(_obj_Smhr_Course).Rows[0]["Count"]) != "0")
                    {
                        BLL.ShowMessage(this, "Course with this Name Already Exists");
                        return;
                    }
                    _obj_Smhr_Course.OPERATION = operation.Insert;
                    if (BLL.set_Course(_obj_Smhr_Course))
                    {
                        BLL.ShowMessage(this, "Information Saved Successfully");
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Information Not Saved");
                    }
                    break;

                default:
                    break;
                }
                Rm_Course_page.SelectedIndex = 0;
                LoadGrid();
                Rg_Course.DataBind();
            }

            else
            {
                BLL.ShowMessage(this, "Select Skills");
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Course", ex.StackTrace, DateTime.Now);

            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }