Exemplo n.º 1
0
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            BTN_SAVE.Visible   = false;
            btn_Update.Visible = true;
            int recCostID = Convert.ToInt32(e.CommandArgument);
            ViewState["COST_ID"] = recCostID;
            //LoadJobRequisition();
            LoadBusinessUnit();
            LoadTypeCost();

            Rcb_BusinessUnit.Enabled = false;
            rcmb_RscReq.Enabled      = false;
            rad_TypCost.Enabled      = false;

            _obj_smhr_recruitment_cost.COST_ID = recCostID;
            DataTable dt = Recruitment_BLL.get_SMHR_RECRUITMENT_COST(_obj_smhr_recruitment_cost);

            if (dt.Rows.Count > 0)
            {
                Rcb_BusinessUnit.SelectedValue = Convert.ToString(dt.Rows[0]["COST_BU_ID"]);
                LoadJobRequisition();
                rcmb_RscReq.SelectedValue = Convert.ToString(dt.Rows[0]["COST_REQ_ID"]);
                rad_TypCost.SelectedValue = Convert.ToString(dt.Rows[0]["COST_TYPE_ID"]);
                rdtp_Date.SelectedDate    = Convert.ToDateTime(dt.Rows[0]["COST_DATE"]);
                rad_Amount.Text           = Convert.ToString(dt.Rows[0]["COST_AMOUNT"]);
                if (Convert.ToString(dt.Rows[0]["COST_FILEPATH"]) != string.Empty)
                {
                    lblMsg.Text = Convert.ToString(dt.Rows[0]["COST_FILEPATH"]);
                }
                else
                {
                    lblMsg.Text = string.Empty;
                }
            }
            else
            {
                BLL.ShowMessage(this, "No records to display");
                Rm_HDPT_page.SelectedIndex = 0;
            }
            Rm_HDPT_page.SelectedIndex = 1;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_RecruitmentCost", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }