예제 #1
0
    private void BindListBySearchParameters(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        try
        {
            DataTable dtb = assetAndGroupAccountListBAL.GetAssetAndGroupAccountListBySearchParameters(assetAndGroupAccountListUI);


            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvData.DataSource = dtb;
                gvData.DataBind();
                divError.Visible = false;
                gvData.Visible   = true;
            }
            else
            {
                divError.Visible = true;
                lblError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvData.Visible   = false;
            }

            txtSearch.Text = "";
            txtSearch.Focus();
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "BindListBySearchParameters()";
            logExcpUIobj.ResourceName     = "Assets_AssetAndGroupAccount_AssetAndGroupAccountList.CS";
            logExcpUIobj.RecordId         = "All";
            logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
            logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

            log.Error("[Assets_AssetAndGroupAccount_AssetAndGroupAccountList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
예제 #2
0
 private void SearchAssetAndGroupAccountList()
 {
     try
     {
         AssetAndGroupAccountListUI assetAndGroupAccountListUI = new AssetAndGroupAccountListUI();
         assetAndGroupAccountListUI.Search = txtAssetAndGroupAccountSearch.Text;
         DataTable dtb = assetAndGroupAccountListBAL.GetAssetAndGroupAccountListBySearchParameters(assetAndGroupAccountListUI);
         if (dtb.Rows.Count > 0 && dtb != null)
         {
             gvAssetAndGroupAccountSearch.DataSource = dtb;
             gvAssetAndGroupAccountSearch.DataBind();
             divAssetAndGroupAccountSearchError.Visible = false;
         }
         else
         {
             divEmployeeSearchError.Visible          = true;
             lblAssetAndGroupAccountSearchError.Text = Resources.GlobalResource.msgNoRecordFound;
             gvAssetAndGroupAccountSearch.Visible    = false;
         }
     }
     catch (Exception exp)
     {
         logExcpUIobj.MethodName       = "SearchAssetAndGroupAccountList()";
         logExcpUIobj.ResourceName     = "Assets_Asset_AssetForm.CS";
         logExcpUIobj.RecordId         = "All";
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Assets_Asset_AssetForm : SearchAssetAndGroupAccountList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
예제 #3
0
    public int DeleteAssetAndGroupAccount(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        int result = 0;

        result = assetAndGroupAccountListDAL.DeleteAssetAndGroupAccount(assetAndGroupAccountListUI);
        return(result);
    }
예제 #4
0
    public DataTable GetAssetAndGroupAccountListBySearchParameters(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetAndGroupAccountListDAL.GetAssetAndGroupAccountListBySearchParameters(assetAndGroupAccountListUI);
        return(dtb);
    }
예제 #5
0
    public DataTable GetAssetAndGroupAccountListById(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        DataTable dtb = new DataTable();

        dtb = assetAndGroupAccountListDAL.GetAssetAndGroupAccountListById(assetAndGroupAccountListUI);
        return(dtb);
    }
예제 #6
0
    public DataTable GetAssetAndGroupAccountListById(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

        //Boolean result = false;
        try
        {
            using (SqlConnection SupportCon = new SqlConnection(connectionString))
            {
                SqlCommand sqlCmd = new SqlCommand("SP_AssetAndGroupAccount_SelectById", SupportCon);
                sqlCmd.CommandType    = CommandType.StoredProcedure;
                sqlCmd.CommandTimeout = commandTimeout;

                sqlCmd.Parameters.Add("@tbl_AssetAndGroupAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetAndGroupAccountId"].Value = assetAndGroupAccountListUI.Tbl_AssetAndGroupAccountId;

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

            log.Error("[AssetAndGroupAccountListDAL : GetAssetAndGroupAccountListById] An error occured in the processing of Record Id : " + assetAndGroupAccountListUI.Tbl_AssetAndGroupAccountId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
예제 #7
0
    public int DeleteAssetAndGroupAccount(AssetAndGroupAccountListUI assetAndGroupAccountListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_AssetAndGroupAccountId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_AssetAndGroupAccountId"].Value = assetAndGroupAccountListUI.Tbl_AssetAndGroupAccountId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[AssetAndGroupAccountListDAL : DeleteAssetAndGroupAccount] An error occured in the processing of Record Id : " + assetAndGroupAccountListUI.Tbl_AssetAndGroupAccountId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }