private void BindListBySearchParameters(GoodsReceivedNoteDistributionListUI goodsReceivedNoteDistributionListUI)
 {
     try
     {
         DataTable dtb = goodsReceivedNoteDistributionListBAL.GetGoodsReceivedNoteDistributionListBySearchParameters(this.goodsReceivedNoteDistributionListUI);
         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     = "Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteDistributionList.CS";
         logExcpUIobj.RecordId         = "All";
         logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
         logExcpDALobj.SaveExceptionToDB(logExcpUIobj);
         log.Error("[Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteDistributionList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
    public int DeleteGoodsReceivedNoteDistribution(GoodsReceivedNoteDistributionListUI goodsReceivedNoteDistributionListUI)
    {
        int result = 0;

        result = goodsReceivedNoteDistributionListDAL.DeleteGoodsReceivedNoteDistribution(goodsReceivedNoteDistributionListUI);
        return(result);
    }
    public DataTable GetGoodsReceivedNoteDistributionListBySearchParameters(GoodsReceivedNoteDistributionListUI goodsReceivedNoteDistributionListUI)
    {
        DataTable dtb = new DataTable();

        dtb = goodsReceivedNoteDistributionListDAL.GetGoodsReceivedNoteDistributionListBySearchParameters(goodsReceivedNoteDistributionListUI);
        return(dtb);
    }
Esempio n. 4
0
    public DataTable GetGoodsReceivedNoteDistributionListById(GoodsReceivedNoteDistributionListUI goodsReceivedNoteDistributionListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GoodsReceivedNoteDistributionId"].Value = goodsReceivedNoteDistributionListUI.Tbl_GoodsReceivedNoteDistributionId;

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

            log.Error("[GoodsReceivedNoteDistributionListDAL : getGoodsReceivedNoteDistributionListById] An error occured in the processing of Record Id : " + goodsReceivedNoteDistributionListUI.Tbl_GoodsReceivedNoteDistributionId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
Esempio n. 5
0
    public int DeleteGoodsReceivedNoteDistribution(GoodsReceivedNoteDistributionListUI goodsReceivedNoteDistributionListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteDistributionId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GoodsReceivedNoteDistributionId"].Value = goodsReceivedNoteDistributionListUI.Tbl_GoodsReceivedNoteDistributionId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[GoodsReceivedNoteDistributionListDAL : DeleteGoodsReceivedNoteDistribution] An error occured in the processing of Record Id : " + goodsReceivedNoteDistributionListUI.Tbl_GoodsReceivedNoteDistributionId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }