예제 #1
0
    protected void rcmbLeaveStruct_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        try
        {
            //if (rcmb_BUID.SelectedItem.Value != "0")
            if (rcmb_BUID.SelectedIndex > 0)
            {
                //if (rcmb_Period.SelectedItem.Value != "0")
                if (rcmb_Period.SelectedIndex > 0)
                {
                    if (period == 0)
                    {
                        period = Convert.ToInt32(rcmb_Period.SelectedItem.Value);
                    }
                    getData();

                    RG_Details.DataBind();
                    RG_Details.Visible = true;
                    btn_Save.Visible   = true;
                    btn_Save.Enabled   = true;
                    if (RG_Details.Items.Count > 0)
                    {
                        btn_Save.Visible = true;
                    }
                    else
                    {
                        btn_Save.Visible = false;
                    }
                    btn_Update.Visible   = false;
                    btn_Finalise.Visible = false;
                }
                else
                {
                    //getData();
                    //Rg_Details.DataBind();
                    RG_Details.Visible = false;
                    btn_Save.Visible   = false;
                    //BLL.ShowMessage(this, "Select Period ");
                }
            }
            else
            {
                BLL.ShowMessage(this, "Select BusinessUnit");
            }
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                RG_Details.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_Save.Visible   = false;
                RG_Details.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Default", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            return;
        }
    }
예제 #2
0
    protected void btn_Submit_Click1(object sender, EventArgs e)
    {
        try
        {
            Load_Details();
            RG_Details.DataBind();

            btn_Generate.Visible = true;
            RG_Details.Visible   = true;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Postings", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
예제 #3
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_LOB _obj_smhr_lob = new SMHR_LOB();
            btn_Finalise.Enabled = true;
            StringBuilder strQry = new StringBuilder();

            for (int i = 0; i < RG_Details.Items.Count; i++)
            {
                _obj_smhr_lob.LOB_EMPID = null;

                for (int j = 0; j < RG_Details.MasterTableView.AutoGeneratedColumns.Count() - 4; j++)
                {
                    strQry.Append("EXEC USP_SMHR_LEAVEOPENINGBALANCES ");
                    _obj_smhr_lob.LOB_EMPID = Convert.ToInt32(RG_Details.Items[i]["EMP_ID"].Text);
                    string   LT = Convert.ToString(RG_Details.MasterTableView.AutoGeneratedColumns[j + 4].UniqueName);
                    string[] T  = LT.Split(new char[] { '-' });
                    _obj_smhr_lob.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_smhr_lob.LOB_PERIODID    = Convert.ToInt32(rcmb_Period.SelectedItem.Value);
                    _obj_smhr_lob.LOB_LEAVETYPEID = Convert.ToInt32(T[0]);
                    _obj_smhr_lob.LOB_NOOFDAYS    = Convert.ToInt32(RG_Details.Items[i][LT].Text);
                    _obj_smhr_lob.LOB_FINALISE    = 0;
                    _obj_smhr_lob.LOB_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_lob.LOB_CREATEDDATE = System.DateTime.Now;
                    _obj_smhr_lob.LOB_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_lob.LOB_LASTMDFDATE = System.DateTime.Now;
                    _obj_smhr_lob.OPERATION       = operation.Insert;
                    string str = "@Operation = 'Insert'" +
                                 ",@LOB_EMPID = '" + _obj_smhr_lob.LOB_EMPID + "'" +
                                 ",@LOB_ORGANISATIONID='" + _obj_smhr_lob.ORGANISATION_ID + "'" +
                                 ",@LOB_PERIODID='" + _obj_smhr_lob.LOB_PERIODID + "'" +
                                 ",@LOB_LEAVETYPEID = '" + _obj_smhr_lob.LOB_LEAVETYPEID + "'" +
                                 ",@LOB_NOOFDAYS = '" + _obj_smhr_lob.LOB_NOOFDAYS + "'" +
                                 ",@LOB_FINALISE = '" + _obj_smhr_lob.LOB_FINALISE + "'" +
                                 ",@LOB_CREATEDBY = '" + _obj_smhr_lob.LOB_CREATEDBY + "'" +
                                 ",@LOB_CREATEDDATE = '" + _obj_smhr_lob.LOB_CREATEDDATE + "'" +
                                 ",@LOB_LASTMDFBY = '" + _obj_smhr_lob.LOB_LASTMDFBY + "'" +
                                 ",@LOB_LASTMDFDATE = '" + _obj_smhr_lob.LOB_LASTMDFDATE + "'";
                    strQry.Append(str);
                }
            }
            bool rs = BLL.set_EMpLOB(_obj_smhr_lob, strQry.ToString());
            if (rs == true)
            {
                BLL.ShowMessage(this, "Leave Opening Balances inserted Successfully");
            }
            else
            {
                BLL.ShowMessage(this, "Error found");
            }

            getData();
            RG_Details.DataBind();
            btn_Finalise.Visible = true;
            btn_Save.Visible     = false;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Default", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            return;
        }
    }