Beispiel #1
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Smhr_Country = new SMHR_COUNTRY();
            _obj_Smhr_Country.COUNTRY_CODE    = BLL.ReplaceQuote(rtxt_CountryCode.Text);
            _obj_Smhr_Country.COUNTRY_NAME    = BLL.ReplaceQuote(rtxt_CountryName.Text);
            _obj_Smhr_Country.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Country.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Country.CREATEDDATE     = DateTime.Now;

            _obj_Smhr_Country.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Country.LASTMDFDATE = DateTime.Now;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                _obj_Smhr_Country.COUNTRY_ID = Convert.ToInt32(lbl_CountryID.Text);
                _obj_Smhr_Country.OPERATION  = operation.Update;
                if (BLL.set_Country(_obj_Smhr_Country))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Updated");
                }

                break;

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

            default:
                break;
            }
            Rm_CY_page.SelectedIndex = 0;
            LoadGrid();
            Rg_Countries.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Country", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_TRAINING_FEEDBACKQUESTION _obj_FeedbackQuestion = new SMHR_TRAINING_FEEDBACKQUESTION();
            _obj_FeedbackQuestion.FEEDBACKQUESTION_ORGID         = Convert.ToInt32(Session["ORG_ID"]);
            _obj_FeedbackQuestion.FEEDBACKQUESTION_TYPE          = Convert.ToString(rc_type.SelectedValue);
            _obj_FeedbackQuestion.FEEDBACKQUESTION_QUESTION      = rtxt_Question.Text;
            _obj_FeedbackQuestion.FEEDBACKQUESTION_QUESTION_DESC = rtxt_Description.Text;
            _obj_FeedbackQuestion.FEEDBACKQUESTION_CREATEDBY     = Convert.ToInt32(Session["USER_ID"]);
            _obj_FeedbackQuestion.FEEDBACKQUESTION_CREATEDDATE   = DateTime.Now;
            _obj_FeedbackQuestion.FEEDBACKQUESTION_LASTMDFBY     = Convert.ToInt32(Session["USER_ID"]);
            _obj_FeedbackQuestion.FEEDBACKQUESTION_LASTMDFDATE   = DateTime.Now;
            _obj_FeedbackQuestion.FEEDBACKQUESTION_STATUS        = rad_IsActive.Checked;



            switch (((Button)sender).ID.ToString())
            {
            case "btn_Save":

                _obj_FeedbackQuestion.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_FeedbackQuestion(_obj_FeedbackQuestion).Rows[0]["Count"]) != "1")
                {
                    _obj_FeedbackQuestion.OPERATION = operation.Get;

                    if (BLL.get_FeedbackQuestion(_obj_FeedbackQuestion).Rows.Count != 0)
                    {
                        BLL.ShowMessage(this, "This Question already exist");
                        return;
                    }
                    _obj_FeedbackQuestion.FEEDBACKQUESTION_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_FeedbackQuestion.FEEDBACKQUESTION_CREATEDDATE = DateTime.Now;
                    _obj_FeedbackQuestion.OPERATION = operation.Insert;
                    if (BLL.set_FeedBackQuestion(_obj_FeedbackQuestion))
                    {
                        BLL.ShowMessage(this, "Information Saved Successfully ");
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Information Not Saved");
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "Question Already Exists");
                    return;
                }


                break;

            case "btn_Update":
                _obj_FeedbackQuestion.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_FeedbackQuestion(_obj_FeedbackQuestion).Rows[0]["Count"]) != "1")
                {
                    BLL.ShowMessage(this, "FeedBack Question with this Name Already Exists");
                    return;
                }
                _obj_FeedbackQuestion.OPERATION                    = operation.Update;
                _obj_FeedbackQuestion.FEEDBACKQUESTION_ID          = Convert.ToInt32(lbl_FeedBackID.Text);
                _obj_FeedbackQuestion.FEEDBACKQUESTION_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                _obj_FeedbackQuestion.FEEDBACKQUESTION_LASTMDFDATE = DateTime.Now;


                if (BLL.set_FeedBackQuestion(_obj_FeedbackQuestion))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully ");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Updated");
                }

                break;
            }
            Rm_CY_page.SelectedIndex = 0;
            LoadGrid();
            Rg_Countries.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_FeedBackQuestion", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Beispiel #3
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            string ErrorMesage = string.Empty;
            if (ValiadteQualification(out ErrorMesage))
            {
                SMHR_TRAINERPROFILE _obj_smhr_Trainerprofile = new SMHR_TRAINERPROFILE();


                _obj_smhr_Trainerprofile.Trainer_ServiceProvider = Convert.ToInt32(rc_ServiceProvider.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_CourseCategory  = Convert.ToInt32(rc_CourseCategory.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_FirstName       = txt_FirstName.Text;
                _obj_smhr_Trainerprofile.Trainer_MiddleName      = txt_MiddleName.Text;
                _obj_smhr_Trainerprofile.Trainer_LastName        = txt_LastName.Text;
                _obj_smhr_Trainerprofile.Trainer_Address1        = txt_Address1.Text;
                _obj_smhr_Trainerprofile.Trainer_Address2        = txt_Address2.Text;
                _obj_smhr_Trainerprofile.Trainer_Age             = Convert.ToInt32(txt_Age.Text);
                _obj_smhr_Trainerprofile.Trainer_CountryID       = Convert.ToInt32(rc_Country.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_CountyID        = Convert.ToInt32(rc_County.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_TownID          = Convert.ToInt32(rc_Town.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_MoblieNo        = Convert.ToString(txt_mobileNo.Text);
                _obj_smhr_Trainerprofile.Trainer_LandlineNo      = Convert.ToString(txt_LandLineNo.Text);
                _obj_smhr_Trainerprofile.Trainer_EmailID         = Convert.ToString(txt_Email.Text);
                _obj_smhr_Trainerprofile.Trainer_DOB             = txt_DOB.SelectedDate.Value;
                _obj_smhr_Trainerprofile.Trainer_Status          = rad_IsActive.Checked;
                _obj_smhr_Trainerprofile.Trainer_Qualification   = Convert.ToInt32(rc_Qualification.SelectedItem.Value);
                _obj_smhr_Trainerprofile.Trainer_Institute       = Convert.ToString(txt_Institute.Text);
                _obj_smhr_Trainerprofile.Trainer_Percentage      = Convert.ToString(txt_Percentage.Text);
                _obj_smhr_Trainerprofile.Trainer_YearOfPass      = Convert.ToString(txt_YeaofPass.Text);
                _obj_smhr_Trainerprofile.TRAINER_CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_smhr_Trainerprofile.TRAINER_CREATEDDATE     = DateTime.Now;
                _obj_smhr_Trainerprofile.TRAINER_ORGID           = Convert.ToInt32(Session["ORG_ID"]);
                _obj_smhr_Trainerprofile.TRAINER_MODIFYEDBY      = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
                _obj_smhr_Trainerprofile.TRAINER_MODIIFYEDDATE   = DateTime.Now;
                _obj_smhr_Trainerprofile.Trainer_ZipCode         = Convert.ToString(txt_ZipCode.Text);

                switch (((Button)sender).ID.ToUpper())
                {
                case "BTN_UPDATE":

                    if (Convert.ToBoolean(rad_IsActive.Checked) == false)
                    {
                        SMHR_COURSESCHEDULE _obj_CS = new SMHR_COURSESCHEDULE();
                        _obj_CS.OPERATION = operation.Offline;
                        _obj_CS.COURSESCHEDULE_TRAINERID = Convert.ToInt32(ld_ID.Text);
                        _obj_CS.ORGANISATION_ID          = Convert.ToInt32(Session["ORG_ID"]);
                        DataTable dtc = BLL.get_CourseSchedule(_obj_CS);
                        if (!Convert.ToBoolean(dtc.Rows[0]["Status"]))
                        {
                            BLL.ShowMessage(this, "Cannot make inactive");
                            rad_IsActive.Checked = true;
                            return;
                        }
                    }
                    _obj_smhr_Trainerprofile.Trainer_TrainerProfile_ID = Convert.ToInt32(ld_ID.Text);
                    _obj_smhr_Trainerprofile.OPERATION = operation.Update;
                    if (BLL.set_TrainingProfile(_obj_smhr_Trainerprofile))
                    {
                        BLL.ShowMessage(this, "Information Updated Successfully");
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Information Not Saved");
                    }
                    break;

                case "BTN_SAVE":

                    _obj_smhr_Trainerprofile.OPERATION = operation.CountEmailID;
                    if (Convert.ToInt32(BLL.get_TrainingProfile(_obj_smhr_Trainerprofile).Rows[0][0]) > 0)
                    {
                        BLL.ShowMessage(this, "Email ID Already Exists.Please Enter another Email ID");
                        return;
                    }
                    else
                    {
                        _obj_smhr_Trainerprofile.OPERATION = operation.Insert;
                        if (BLL.set_TrainingProfile(_obj_smhr_Trainerprofile))
                        {
                            BLL.ShowMessage(this, "Information Saved Successfully");
                        }
                        else
                        {
                            BLL.ShowMessage(this, "Information Not Saved");
                        }
                        break;
                    }

                default:
                    break;
                }
                LoadGrid();
                Rm_CY_page.SelectedIndex = 0;
                Rg_Countries.DataBind();
            }
            else
            {
                BLL.ShowMessage(this, ErrorMesage);
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "TrainerProfile", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }