Пример #1
0
    private void getDetails(string ID)
    {
        try
        {
            _obj_smhr_Directpmts      = new SMHR_DIRECTPAYMENTS();
            _obj_smhr_Directpmts.Mode = 2;
            _obj_smhr_Directpmts.SMHR_DIRECTPMT_ID = Convert.ToInt32(ID);
            DataTable dt = BLL.get_DirectPayments(_obj_smhr_Directpmts);
            if (dt.Rows.Count != 0)
            {
                ddl_BusinessUnit.SelectedIndex = ddl_BusinessUnit.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_BUID"]));
                LoadPaymentType();
                if ((Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 0) || (Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 1))
                {
                    LoadEmployee(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_BUID"]));
                    ddl_Employee.SelectedIndex = ddl_Employee.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_EMPID"]));
                }
                else if ((Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 2) || (Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 3))
                {
                    _obj_smhr_emp_payitems                 = new SMHR_EMP_PAYITEMS();
                    _obj_smhr_emp_payitems.OPERATION       = operation.EMPTY_R;
                    _obj_smhr_emp_payitems.SMHR_BUSUNIT    = Convert.ToInt32(ID);
                    _obj_smhr_emp_payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                    DataTable dt_Details = BLL.get_EmpDetails(_obj_smhr_emp_payitems);
                    if (dt_Details.Rows.Count != 0)
                    {
                        ddl_Employee.Items.Clear();
                        ddl_Employee.DataSource     = dt_Details;
                        ddl_Employee.DataTextField  = "Empname";
                        ddl_Employee.DataValueField = "EMP_ID";
                        ddl_Employee.DataBind();
                        ddl_Employee.Items.Insert(0, new RadComboBoxItem("Select"));
                        rdp_Issuedate.SelectedDate = DateTime.Now;
                    }
                    ddl_Employee.SelectedIndex = ddl_Employee.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_EMPID"]));
                }

                rdp_Issuedate.SelectedDate    = Convert.ToDateTime(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_ISSUEDT"]));
                rntxt_Amount.Value            = Convert.ToDouble(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_AMOUNT"]));
                txt_Remarks.Text              = Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_REMARKS"]);
                ddl_paymentType.SelectedIndex = ddl_paymentType.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["SMHR_DIRECTPMT_TYPE"]));
                if (dt.Rows[0]["SMHR_DIRECTPMT_CHEQUE"] != null)
                {
                    txt_ChequeNumber.Value = Convert.ToDouble(dt.Rows[0]["SMHR_DIRECTPMT_CHEQUE"]);
                    cheque.Visible         = true;
                }
                ddl_Employee.Enabled     = false;
                ddl_BusinessUnit.Enabled = false;
                rntxt_Amount.Enabled     = false;
                rdp_Issuedate.Enabled    = false;
                ddl_paymentType.Enabled  = false;
                txt_ChequeNumber.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_DirectPay", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #2
0
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            ClearFields();
            RMP_DirectPayments.SelectedIndex = 1;

            _lbl_ID = Convert.ToString(e.CommandArgument);
            LoadCombos();
            getDetails(_lbl_ID);
            if (ddl_paymentType.SelectedItem.Text.ToUpper() != "CHEQUE")
            {
                cheque.Visible = false;
            }

            _obj_smhr_Directpmts      = new SMHR_DIRECTPAYMENTS();
            _obj_smhr_Directpmts.Mode = 2;
            _obj_smhr_Directpmts.SMHR_DIRECTPMT_ID = Convert.ToInt32(_lbl_ID);
            DataTable dt = BLL.get_DirectPayments(_obj_smhr_Directpmts);
            //code for security
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                btn_Correct.Visible = false;
            }

            else
            {
                if ((Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 2) || (Convert.ToInt32(dt.Rows[0]["EMP_STATUS"]) == 3))
                {
                    btn_Correct.Visible = false;
                }
                else
                {
                    btn_Correct.Visible = true;
                }
            }
            if (ddl_Employee.SelectedItem.Text == "Select")
            {
                BLL.ShowMessage(this, "You Cannot Update Resigned Employee");
                btn_Correct.Visible = false;
            }

            btn_Save.Visible = false;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_DirectPay", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #3
0
 private void LoadDetails()
 {
     try
     {
         _obj_smhr_Directpmts                 = new SMHR_DIRECTPAYMENTS();
         _obj_smhr_Directpmts.Mode            = 1;
         _obj_smhr_Directpmts.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt = BLL.get_DirectPayments(_obj_smhr_Directpmts);
         RG_DirectPayments.DataSource = dt;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_DirectPay", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
Пример #4
0
 protected void btn_Correct_Click(object sender, EventArgs e)
 {
     try
     {
         _obj_smhr_Directpmts      = new SMHR_DIRECTPAYMENTS();
         _obj_smhr_Directpmts.Mode = 4;
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_ID      = Convert.ToInt32(_lbl_ID);
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_BUID    = Convert.ToInt32(ddl_BusinessUnit.SelectedValue);
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_EMPID   = Convert.ToInt32(ddl_Employee.SelectedValue);
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_ISSUEDT = Convert.ToDateTime(rdp_Issuedate.SelectedDate.Value);
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_AMOUNT  = Convert.ToDouble(rntxt_Amount.Value);
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_REMARKS = Convert.ToString(txt_Remarks.Text.Replace("'", "''"));
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_TYPE    = Convert.ToInt32(ddl_paymentType.SelectedValue);
         if (txt_ChequeNumber.Value != null)
         {
             _obj_smhr_Directpmts.SMHR_CHEQUENUMBER = Convert.ToDouble(txt_ChequeNumber.Value);
         }
         else
         {
             _obj_smhr_Directpmts.SMHR_CHEQUENUMBER = 0;
         }
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_LASTMDFBY   = Convert.ToInt32(Convert.ToString(Session["USER_ID"]));
         _obj_smhr_Directpmts.SMHR_DIRECTPMT_LASTMDFDATE = DateTime.Now;
         bool status = BLL.set_DirectPayments(_obj_smhr_Directpmts);
         if (status == true)
         {
             BLL.ShowMessage(this, "Information Updated Successfully");
             RMP_DirectPayments.SelectedIndex = 0;
             LoadDetails();
             RG_DirectPayments.DataBind();
             ClearFields();
             return;
         }
         else
         {
             BLL.ShowMessage(this, "An Error Occured while doing the process");
             return;
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_DirectPay", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }