示例#1
0
    public int DeleteAssetBookGroupSetup(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        int result = 0;

        result = assetBookGroupSetupFormDAL.DeleteAssetBookGroupSetup(assetBookGroupSetupFormUI);
        return(result);
    }
示例#2
0
    public DataTable GetAssetBookGroupSetupListById(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetBookGroupSetupFormDAL.GetAssetBookGroupSetupListById(assetBookGroupSetupFormUI);
        return(dtb);
    }
示例#3
0
    public int UpdateAssetBookGroupSetup(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        int resutl = 0;

        resutl = assetBookGroupSetupFormDAL.UpdateAssetBookGroupSetup(assetBookGroupSetupFormUI);
        return(resutl);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        AssetBookGroupSetupFormUI assetBookGroupSetupFormUI = new AssetBookGroupSetupFormUI();

        if (!Page.IsPostBack)
        {
            if (Request.QueryString["AssetBookGroupSetupId"] != null)
            {
                assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId = Request.QueryString["AssetBookGroupSetupId"];

                BindDepreciationMethod();
                BindAveragingConvention();
                FillForm(assetBookGroupSetupFormUI);

                btnSave.Visible   = false;
                btnClear.Visible  = false;
                btnUpdate.Visible = true;
                btnDelete.Visible = true;
                lblHeading.Text   = "Update Asset Book Group Setup";
            }
            else
            {
                BindDepreciationMethod();
                BindAveragingConvention();

                btnSave.Visible   = true;
                btnClear.Visible  = true;
                btnUpdate.Visible = false;
                btnDelete.Visible = false;
                lblHeading.Text   = "Add New Asset Book Group Setup";
            }
        }
    }
示例#5
0
    public DataTable GetAssetBookGroupSetupListById(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_AssetBookGroupSetupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetBookGroupSetupId"].Value = assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId;

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

            log.Error("[AssetBookGroupSetupFormDAL : GetAssetBookGroupSetupListById] An error occured in the processing of Record Id : " + assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    private void FillForm(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        try
        {
            DataTable dtb = assetBookGroupSetupFormBAL.GetAssetBookGroupSetupListById(assetBookGroupSetupFormUI);

            if (dtb.Rows.Count > 0)
            {
                txtAssetBookGroupSetupCode.Text = dtb.Rows[0]["AssetBookGroupSetupCode"].ToString();
                txtAssetGroup.Text     = dtb.Rows[0]["tbl_AssetGroup"].ToString();
                txtAssetGroupGuid.Text = dtb.Rows[0]["tbl_AssetGroupId"].ToString();

                txtAssetBookSetupGuid.Text = dtb.Rows[0]["tbl_AssetBookSetupId"].ToString();
                txtAssetBookSetup.Text     = dtb.Rows[0]["tbl_AssetBookSetup"].ToString();

                ddlOpt_DepreciationMethod.Text  = dtb.Rows[0]["DepreciationMethod"].ToString();
                ddlOpt_AveragingConvention.Text = dtb.Rows[0]["AveragingConvention"].ToString();
                txtOriginalLifeYear.Text        = dtb.Rows[0]["OriginalLifeYear"].ToString();
                txtOriginalLifeDay.Text         = dtb.Rows[0]["OriginalLifeDay"].ToString();
                txtScrapValue.Text = dtb.Rows[0]["ScrapValue"].ToString();
            }
            else
            {
                lblError.Text    = Resources.GlobalResource.msgCouldNotLoadData;
                divError.Visible = true;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "FillForm()";
            logExcpUIobj.ResourceName     = "Assets_AssetBookGroupSetup_AssetBookGroupSetupForm.CS";
            logExcpUIobj.RecordId         = assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId;
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Assets_AssetBookGroupSetup_AssetBookGroupSetupForm : FillForm] An error occured in the processing of Record Id : " + assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId + ". Details : [" + exp.ToString() + "]");
        }
    }
示例#7
0
    public int DeleteAssetBookGroupSetup(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_AssetBookGroupSetupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetBookGroupSetupId"].Value = assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[AssetBookGroupSetupFormDAL : DeleteAsset] An error occured in the processing of Record Id : " + assetBookGroupSetupFormUI.Tbl_AssetBookGroupSetupId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }
示例#8
0
    public int AddAssetBookGroupSetup(AssetBookGroupSetupFormUI assetBookGroupSetupFormUI)
    {
        int result = 0;

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

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

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

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

                sqlCmd.Parameters.Add("@tbl_AssetBookSetupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetBookSetupId"].Value = assetBookGroupSetupFormUI.Tbl_AssetBookSetupId;

                sqlCmd.Parameters.Add("@tbl_AssetGroupId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetGroupId"].Value = assetBookGroupSetupFormUI.Tbl_AssetGroupId;


                sqlCmd.Parameters.Add("@opt_DepreciationMethod", SqlDbType.Int);
                sqlCmd.Parameters["@opt_DepreciationMethod"].Value = assetBookGroupSetupFormUI.opt_DepreciationMethod;


                sqlCmd.Parameters.Add("@opt_AveragingConvention", SqlDbType.Int);
                sqlCmd.Parameters["@opt_AveragingConvention"].Value = assetBookGroupSetupFormUI.opt_AveragingConvention;


                sqlCmd.Parameters.Add("@OriginalLifeYear", SqlDbType.Int);
                sqlCmd.Parameters["@OriginalLifeYear"].Value = assetBookGroupSetupFormUI.OriginalLifeYear;

                sqlCmd.Parameters.Add("@OriginalLifeDay", SqlDbType.Int);
                sqlCmd.Parameters["@OriginalLifeDay"].Value = assetBookGroupSetupFormUI.OriginalLifeDay;

                sqlCmd.Parameters.Add("@ScrapValue", SqlDbType.Decimal);
                sqlCmd.Parameters["@ScrapValue"].Value = assetBookGroupSetupFormUI.ScrapValue;



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

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

        return(result);
    }