Exemplo n.º 1
0
 public static HR_BankAccount GetHR_BankAccountByEmployeeID(string EmployeeID)
 {
     HR_BankAccount hR_BankAccount = new HR_BankAccount();
     SqlHR_BankAccountProvider sqlHR_BankAccountProvider = new SqlHR_BankAccountProvider();
     hR_BankAccount = sqlHR_BankAccountProvider.GetHR_BankAccountByEmployeeID(EmployeeID);
     return hR_BankAccount;
 }
Exemplo n.º 2
0
 public static HR_BankAccount GetHR_BankAccountByBankAccountNoID(int BankAccountNoID)
 {
     HR_BankAccount hR_BankAccount = new HR_BankAccount();
     SqlHR_BankAccountProvider sqlHR_BankAccountProvider = new SqlHR_BankAccountProvider();
     hR_BankAccount = sqlHR_BankAccountProvider.GetHR_BankAccountByBankAccountNoID(BankAccountNoID);
     return hR_BankAccount;
 }
Exemplo n.º 3
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     HR_BankAccount hR_Bank = new HR_BankAccount ();
     hR_Bank.BankAccountNoID = int.Parse(Request.QueryString["ID"].ToString());
     hR_Bank.EmployeeID=  ddlEmployeeID.SelectedValue;
     hR_Bank.AccountName=  txtBankAccountName.Text;
     hR_Bank.BankName=  txtBankName.Text;
     hR_Bank.BankAddress=  txtBankAddress.Text;
     hR_Bank.ContactPerson = txtBankTelephone.Text;
     hR_Bank.AddedBy=  Profile.card_id;
     hR_Bank.AddedDate=  DateTime.Now;
     hR_Bank.ModifiedBy=  Profile.card_id;
     hR_Bank.ModifiedDate=  DateTime.Now;
     bool  resutl =HR_BankAccountManager.UpdateHR_BankAccount(hR_Bank);
     Response.Redirect("AdminDisplayHR_Bank.aspx");
 }
Exemplo n.º 4
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     HR_BankAccount hR_Bank = new HR_BankAccount();
     //hR_Bank.BankAccountNoID = int.Parse(ddlBankAccountNoID.SelectedValue);
     hR_Bank.EmployeeID=  ddlEmployeeID.SelectedValue;
     hR_Bank.AccountName=  txtBankAccountName.Text;
     hR_Bank.BankName=  txtBankName.Text;
     hR_Bank.BankAddress=  txtBankAddress.Text;
     hR_Bank.ContactPerson = txtBankTelephone.Text;
     hR_Bank.AddedBy=  Profile.card_id;
     hR_Bank.AddedDate=  DateTime.Now;
     hR_Bank.ModifiedBy=  Profile.card_id;
     hR_Bank.ModifiedDate=  DateTime.Now;
     int resutl =HR_BankAccountManager.InsertHR_BankAccount(hR_Bank);
     Response.Redirect("AdminDisplayHR_Bank.aspx");
 }
Exemplo n.º 5
0
 public static int InsertHR_BankAccount(HR_BankAccount hR_BankAccount)
 {
     SqlHR_BankAccountProvider sqlHR_BankAccountProvider = new SqlHR_BankAccountProvider();
     return sqlHR_BankAccountProvider.InsertHR_BankAccount(hR_BankAccount);
 }
Exemplo n.º 6
0
 public static bool UpdateHR_BankAccount(HR_BankAccount hR_BankAccount)
 {
     SqlHR_BankAccountProvider sqlHR_BankAccountProvider = new SqlHR_BankAccountProvider();
     return sqlHR_BankAccountProvider.UpdateHR_BankAccount(hR_BankAccount);
 }
Exemplo n.º 7
0
 private void showHR_BankData()
 {
     HR_BankAccount hR_Bank = new HR_BankAccount();
     hR_Bank = HR_BankAccountManager.GetHR_BankAccountByBankAccountNoID(Int32.Parse(Request.QueryString["ID"]));
      	ddlEmployeeID.SelectedValue  =hR_Bank.EmployeeID.ToString();
      	txtBankAccountName.Text =hR_Bank.AccountName.ToString();
      	txtBankName.Text =hR_Bank.BankName.ToString();
      	txtBankAddress.Text =hR_Bank.BankAddress.ToString();
     txtBankTelephone.Text = hR_Bank.ContactPerson.ToString();
 }
Exemplo n.º 8
0
 private void RefreshBankAccount()
 {
     HR_BankAccount hR_Bank = new HR_BankAccount();
     hR_Bank = HR_BankAccountManager.GetHR_BankAccountByEmployeeID(hfEmployeeID.Value.ToString());
     if (hR_Bank != null)
     {
         hdnBankID.Value = hR_Bank.BankAccountNoID.ToString();
         txtBankAccountName.Text = hR_Bank.AccountName;
         txtBankAccountNo.Text = hR_Bank.AccountNo;
         txtBankName.Text = hR_Bank.BankName;
         txtBankAddress.Text = hR_Bank.BankAddress;
         txtBankTelephone.Text = hR_Bank.ContactPerson;
     }
 }
Exemplo n.º 9
0
 protected void btnAddBank_Click(object sender, EventArgs e)
 {
     if (hfEmployeeID.Value != null)
     {
         HR_BankAccount hR_Bank = new HR_BankAccount();
         hR_Bank.EmployeeID = hfEmployeeID.Value.ToString();
         hR_Bank.AccountName = txtBankAccountName.Text;
         hR_Bank.AccountNo = txtBankAccountNo.Text;
         hR_Bank.BankName = txtBankName.Text;
         hR_Bank.BankAddress = txtBankAddress.Text;
         hR_Bank.ContactPerson = txtBankTelephone.Text;
         string userID = Profile.card_id;
         hR_Bank.AddedBy = userID;
         hR_Bank.AddedDate = DateTime.Now;
         hR_Bank.ModifiedBy = userID;
         hR_Bank.ModifiedDate = DateTime.Now;
         int resutl = HR_BankAccountManager.InsertHR_BankAccount(hR_Bank);
         hdnBankID.Value = resutl.ToString();
         lblBankMsg.Text = "Bank Information is saved";
         lblBankMsg.ForeColor = System.Drawing.Color.Green;
     }
     else
     {
         lblBankMsg.Text = "Employee is not specified.";
         lblBankMsg.ForeColor = System.Drawing.Color.Red;
     }
 }
Exemplo n.º 10
0
    protected void btnUpdateBank_Click(object sender, EventArgs e)
    {
        HR_BankAccount hR_Bank = new HR_BankAccount();
        hR_Bank.EmployeeID = hfEmployeeID.Value.ToString();
        hR_Bank.AccountName = txtBankAccountName.Text;
        hR_Bank.AccountNo = txtBankAccountNo.Text;
        hR_Bank.BankName = txtBankName.Text;
        hR_Bank.BankAddress = txtBankAddress.Text;
        hR_Bank.ContactPerson = txtBankTelephone.Text;
        string userID = Profile.card_id;
        hR_Bank.AddedBy = userID;
        hR_Bank.AddedDate = DateTime.Now;
        hR_Bank.ModifiedBy = userID;
        hR_Bank.ModifiedDate = DateTime.Now;
        if (hdnBankID.Value == string.Empty)
        {
            int resutl = HR_BankAccountManager.InsertHR_BankAccount(hR_Bank);
            hdnBankID.Value = resutl.ToString();
        }
        else
        {
            hR_Bank.BankAccountNoID = int.Parse(hdnBankID.Value);
            bool resutl = HR_BankAccountManager.UpdateHR_BankAccount(hR_Bank);
        }

        lblBankMsg.Text = "Bank Information is updated successfully";
        lblBankMsg.ForeColor = System.Drawing.Color.Green;
    }
Exemplo n.º 11
0
    public bool UpdateHR_BankAccount(HR_BankAccount hR_Bank)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateHR_BankAccount", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@BankAccountNoID", SqlDbType.Int).Value = hR_Bank.BankAccountNoID;
            cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar).Value = hR_Bank.EmployeeID;
            cmd.Parameters.Add("@AccountName", SqlDbType.NVarChar).Value = hR_Bank.AccountName;
            cmd.Parameters.Add("@BankName", SqlDbType.NVarChar).Value = hR_Bank.BankName;
            cmd.Parameters.Add("@BankAddress", SqlDbType.NVarChar).Value = hR_Bank.BankAddress;
            cmd.Parameters.Add("@ContactPerson", SqlDbType.NVarChar).Value = hR_Bank.ContactPerson;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_Bank.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_Bank.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Exemplo n.º 12
0
    public HR_BankAccount GetHR_BankAccountFromReader(IDataReader reader)
    {
        try
        {
            HR_BankAccount hR_Bank = new HR_BankAccount
                (

                     DataAccessObject.IsNULL<int>(reader["BankAccountNoID"]),
                     DataAccessObject.IsNULL<string>(reader["EmployeeID"].ToString()),
                     DataAccessObject.IsNULL<string>(reader["AccountName"]),
                     DataAccessObject.IsNULL<string>(reader["AccountNo"]),
                     DataAccessObject.IsNULL<string>(reader["BankName"]),
                     DataAccessObject.IsNULL<string>(reader["BankAddress"]),
                     DataAccessObject.IsNULL<string>(reader["ContactPerson"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"])
                );
             return hR_Bank;
        }
        catch(Exception ex)
        {
            return null;
        }
    }
Exemplo n.º 13
0
    public int InsertHR_BankAccount(HR_BankAccount hR_BankAccount)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertHR_BankAccount", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@BankAccountNoID", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@EmployeeID", SqlDbType.NVarChar).Value = hR_BankAccount.EmployeeID;

            cmd.Parameters.Add("@AccountName", SqlDbType.NVarChar).Value = hR_BankAccount.AccountName;
            cmd.Parameters.Add("@AccountNo", SqlDbType.NVarChar).Value = hR_BankAccount.AccountNo;

            cmd.Parameters.Add("@BankName", SqlDbType.NVarChar).Value = hR_BankAccount.BankName;
            cmd.Parameters.Add("@ContactPerson", SqlDbType.NVarChar).Value = hR_BankAccount.ContactPerson;
            cmd.Parameters.Add("@BankAddress", SqlDbType.NVarChar).Value = hR_BankAccount.BankAddress;
            cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = hR_BankAccount.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = hR_BankAccount.AddedDate;
            cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = hR_BankAccount.ModifiedBy;
            cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = hR_BankAccount.ModifiedDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@BankAccountNoID"].Value;
        }
    }