Esempio n. 1
0
 protected void rcmb_CourseSchedule_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
 {
     try
     {
         if (rcmb_CourseSchedule.SelectedIndex > 0)
         {
             _obj_smhr_Cost                 = new SMHR_TRAININGCOST();
             _obj_smhr_Cost.OPERATION       = operation.Select1;
             _obj_smhr_Cost.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
             DataTable dt = BLL.get_CostType(_obj_smhr_Cost);
             Rg_Costs.DataSource = dt;
             Rg_Costs.DataBind();
             Rg_Costs.Visible = true;
             btn_Save.Visible = true;
         }
         else
         {
             Rg_Costs.Visible = false;
             btn_Save.Visible = false;
         }
     }
     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");
     }
 }
Esempio n. 2
0
 protected void lnk_Edit_Command(object sender, CommandEventArgs e)
 {
     try
     {
         Rm_CY_page.SelectedIndex = 1;
         _obj_smhr_Cost           = new SMHR_TRAININGCOST();
         _obj_smhr_Cost.OPERATION = operation.Get;
         _obj_smhr_Cost.TRAININGCOST_COURSESCHEDULE_ID = Convert.ToInt32(e.CommandArgument);
         lblID.Text = _obj_smhr_Cost.TRAININGCOST_ID.ToString();
         _obj_smhr_Cost.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt = BLL.get_CostType(_obj_smhr_Cost);
         Rg_Costs.DataSource = dt;
         Rg_Costs.DataBind();
         rcmb_CourseName.DataSource     = dt;
         rcmb_CourseName.DataTextField  = "COURSE_NAME";
         rcmb_CourseName.DataValueField = "COURSE_ID";
         rcmb_CourseName.DataBind();
         rcmb_CourseSchedule.DataSource     = dt;
         rcmb_CourseSchedule.DataTextField  = "CourseSchedule_Name";
         rcmb_CourseSchedule.DataValueField = "CourseSchedule_ID";
         rcmb_CourseSchedule.DataBind();
         rcmb_CourseName.Enabled     = false;
         rcmb_CourseSchedule.Enabled = false;
         Rg_Costs.Visible            = true;
         btn_Save.Visible            = false;
         btn_Update.Visible          = true;
     }
     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");
     }
 }
Esempio n. 3
0
 private void LoadGrid()
 {
     try
     {
         _obj_smhr_Cost                 = new SMHR_TRAININGCOST();
         _obj_smhr_Cost.OPERATION       = operation.Select;
         _obj_smhr_Cost.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable DT = BLL.get_CostType(_obj_smhr_Cost);
         Rg_InteretsQuarters.DataSource = DT;
         //Rg_InteretsQuarters.DataBind();
     }
     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");
     }
 }
Esempio n. 4
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_TRAININGCOST _obj_smhr_Cost = new SMHR_TRAININGCOST();
            _obj_smhr_Cost.TRAININGCOST_COURSESCHEDULE_ID = Convert.ToInt32(rcmb_CourseSchedule.SelectedItem.Value);
            DataTable         dt = CreateGridDataTable();
            RadNumericTextBox r;
            foreach (GridDataItem g in Rg_Costs.Items)
            {
                r = new RadNumericTextBox();
                r = g.FindControl("txt_Amount") as RadNumericTextBox;
                dt.Rows.Add(Convert.ToInt32(g.Cells[2].Text), Convert.ToInt32(r.Text));
            }
            _obj_smhr_Cost.TRAININGCOST    = dt;
            _obj_smhr_Cost.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_smhr_Cost.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]);
            _obj_smhr_Cost.CREATEDDATE     = DateTime.Now;
            _obj_smhr_Cost.LASTMDFDATE     = DateTime.Now;
            _obj_smhr_Cost.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]);
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":

                //  _obj_Smhr_Masters.QRTR_ID = Convert.ToInt32(lblID.Text);
                _obj_smhr_Cost.OPERATION = operation.Insert;
                if (BLL.set_CostType(_obj_smhr_Cost))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Updated");
                }

                break;

            case "BTN_SAVE":
                _obj_smhr_Cost.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_smhr_Cost.OPERATION       = operation.Insert;
                if (BLL.set_CostType(_obj_smhr_Cost))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_CY_page.SelectedIndex = 0;
            LoadGrid();
            Rg_InteretsQuarters.DataBind();
        }
        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");
        }
    }