Exemplo n.º 1
0
    protected override void Page_Load(object sender, EventArgs e)
    {
        EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI = new EmployeeAndGroupAccountFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["EmployeeAndGroupAccountId"] != null)
            {
                employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId = Request.QueryString["EmployeeAndGroupAccountId"];

                BindOptionAccountTypeDropDown();
                FillForm(employeeAndGroupAccountFormUI);

                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update Employee And GroupAccount";
            }
            else
            {
                BindOptionAccountTypeDropDown();
                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New Employee And GroupAccount";
            }
        }
    }
    public int DeleteEmployeeAndGroupAccount(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        int resutl = 0;

        resutl = employeeAndGroupAccountFormDAL.DeleteEmployeeAndGroupAccount(employeeAndGroupAccountFormUI);
        return(resutl);
    }
    public DataTable GetEmployeeAndGroupAccountListById(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = employeeAndGroupAccountFormDAL.GetEmployeeAndGroupAccountListById(employeeAndGroupAccountFormUI);
        return(dtb);
    }
Exemplo n.º 4
0
    private void FillForm(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        try
        {
            DataTable dtb = employeeAndGroupAccountFormBAL.GetEmployeeAndGroupAccountListById(employeeAndGroupAccountFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtEmployeeGroupGuid.Text = dtb.Rows[0]["tbl_EmployeeGroupId"].ToString();

                txtEmployeeGroup.Text            = dtb.Rows[0]["tbl_EmployeeGroup"].ToString();
                ddlOpt_AccountType.SelectedValue = dtb.Rows[0]["Opt_AccountType"].ToString();
                if (Convert.ToBoolean(dtb.Rows[0]["PaymentMode"]) == true)
                {
                    chkPaymentMode.Checked = true;
                }
                else
                {
                    chkPaymentMode.Checked = false;
                }
                txtGLAccountId_CashGuid.Text = dtb.Rows[0]["tbl_GLAccountId_Cash"].ToString();
                txtGLAccountId_Cash.Text     = dtb.Rows[0]["Cash"].ToString();
                txtAccountPayable.Text       = dtb.Rows[0]["AccountPayable"].ToString();
                txtAccountPayableGuid.Text   = dtb.Rows[0]["tbl_GLAccountId_AccountPayable"].ToString();
                txtPurchase.Text             = dtb.Rows[0]["Purchase"].ToString();
                txtPurchaseGuid.Text         = dtb.Rows[0]["tbl_GLAccountId_Purchase"].ToString();
                txtTradeDiscount.Text        = dtb.Rows[0]["TradeDiscount"].ToString();
                txtTradeDiscountGuid.Text    = dtb.Rows[0]["tbl_GLAccountId_TradeDiscount"].ToString();
                txtFeight.Text              = dtb.Rows[0]["Freight"].ToString();
                txtFreightGuid.Text         = dtb.Rows[0]["tbl_GLAccountId_Freight"].ToString();
                txtAccruedPurchase.Text     = dtb.Rows[0]["AccruedPurchase"].ToString();
                txtAccruedPurchaseguid.Text = dtb.Rows[0]["tbl_GLAccountId_AccruedPurchase"].ToString();
            }

            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "Finance_Accounts_Payable_Employee_Supplier_Master_Creation_EmployeeAndGroupAccountList.CS";
            logExcpUIobj.RecordId         = employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Finance_Accounts_Payable_Employee_Supplier_Master_Creation_EmployeeAndGroupAccountList : FillForm] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
        }
    }
Exemplo n.º 5
0
    public DataTable GetEmployeeAndGroupAccountListById(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_EmployeeAndGroupAccount_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_EmployeeAndGroupAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_EmployeeAndGroupAccountId"].Value = employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId;

                using (SqlDataAdapter adapter = new SqlDataAdapter(sqlCmd))
                {
                    adapter.Fill(ds);
                }
            }
            if (ds.Tables.Count > 0)
            {
                dtbl = ds.Tables[0];
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "GetEmployeeAndGroupAccountListById()";
            logExcpUIobj.ResourceName     = "EmployeeAndGroupAccountFormDAL.CS";
            logExcpUIobj.RecordId         = employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[EmployeeAndGroupAccountFormDAL : GetEmployeeAndGroupAccountListById] An error occured in the processing of Record Id : " + employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Exemplo n.º 6
0
    public int DeleteEmployeeAndGroupAccount(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_EmployeeAndGroupAccount_Delete", SupportCon);

                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_EmployeeAndGroupAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_EmployeeAndGroupAccountId"].Value = employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId;

                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "DeleteEmployeeAndGroupAccount()";
            logExcpUIobj.ResourceName     = "EmployeeAndGroupAccountFormDAL.CS";
            logExcpUIobj.RecordId         = employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[EmployeeAndGroupAccountFormDAL : DeleteEmployeeAndGroupAccount] An error occured in the processing of Record Id : " + employeeAndGroupAccountFormUI.Tbl_EmployeeAndGroupAccountId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
Exemplo n.º 7
0
    public int AddEmployeeAndGroupAccount(EmployeeAndGroupAccountFormUI employeeAndGroupAccountFormUI)
    {
        int result = 0;

        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SupportCon.Open();
                SqlCommand sqlCmd = new SqlCommand("SP_EmployeeAndGroupAccount_Insert", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar);
                sqlCmd.Parameters["@CreatedBy"].Value = employeeAndGroupAccountFormUI.CreatedBy;

                sqlCmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar);
                sqlCmd.Parameters["@ModifiedBy"].Value = employeeAndGroupAccountFormUI.ModifiedBy;

                sqlCmd.Parameters.Add("@tbl_OrganizationId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_OrganizationId"].Value = employeeAndGroupAccountFormUI.Tbl_OrganizationId;

                sqlCmd.Parameters.Add("@tbl_EmployeeGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_EmployeeGroupId"].Value = employeeAndGroupAccountFormUI.Tbl_EmployeeGroupId;

                sqlCmd.Parameters.Add("@AccountType", SqlDbType.TinyInt);
                sqlCmd.Parameters["@AccountType"].Value = employeeAndGroupAccountFormUI.Opt_AccountType;

                sqlCmd.Parameters.Add("@PaymentMode", SqlDbType.Bit);
                sqlCmd.Parameters["@PaymentMode"].Value = employeeAndGroupAccountFormUI.PaymentMode;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_Cash", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_Cash"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_Cash;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_AccountPayable", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_AccountPayable"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_AccountPayable;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_Purchase", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_Purchase"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_Purchase;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_TradeDiscount", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_TradeDiscount"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_TradeDiscount;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_Freight", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_Freight"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_Freight;

                sqlCmd.Parameters.Add("@tbl_GLAccountId_AccruedPurchase", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GLAccountId_AccruedPurchase"].Value = employeeAndGroupAccountFormUI.Tbl_GLAccountId_AccruedPurchase;


                result = sqlCmd.ExecuteNonQuery();

                sqlCmd.Dispose();
                SupportCon.Close();
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "AddEmployeeAndGroupAccount()";
            logExcpUIobj.ResourceName     = "EmployeeAndGroupAccountFormDAL.CS";
            logExcpUIobj.RecordId         = "";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[EmployeeAndGroupAccountFormDAL : AddEmployeeAndGroupAccount] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }

        return(result);
    }