public int DeleteGoodsReceivedNote(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
    {
        int result = 0;

        result = goodsReceivedNoteListDAL.DeleteGoodsReceivedNote(goodsReceivedNoteListUI);
        return(result);
    }
    public DataTable GetGoodsReceivedNoteListBySearchParameters(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
    {
        DataTable dtb = new DataTable();

        dtb = goodsReceivedNoteListDAL.GetGoodsReceivedNoteListBySearchParameters(goodsReceivedNoteListUI);
        return(dtb);
    }
    public DataTable GetGoodsReceivedNoteListById(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
    {
        DataTable dtb = new DataTable();

        dtb = goodsReceivedNoteListDAL.GetGoodsReceivedNoteListById(goodsReceivedNoteListUI);
        return(dtb);
    }
Exemplo n.º 4
0
 private void BindListBySearchParameters(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
 {
     try
     {
         DataTable dtb = goodsReceivedNoteListBAL.GetGoodsReceivedNoteListBySearchParameters(this.goodsReceivedNoteListUI);
         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_GoodsReceivedNoteList.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_GoodsReceivedNoteList : BindListBySearchParameters] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
     }
 }
    private void SearchGoodsReceivedNoteList()
    {
        try
        {
            GoodsReceivedNoteListUI goodsReceivedNoteListUI = new GoodsReceivedNoteListUI();
            goodsReceivedNoteListUI.Search = txtGoodsReceivedNoteSearch.Text;
            DataTable dtb = goodsReceivedNoteListBAL.GetGoodsReceivedNoteListBySearchParameters(goodsReceivedNoteListUI);
            if (dtb.Rows.Count > 0 && dtb != null)
            {
                gvGoodsReceivedNoteSearch.DataSource = dtb;
                gvGoodsReceivedNoteSearch.DataBind();
                divGoodsReceivedNoteSearchError.Visible = false;
                gvGoodsReceivedNoteSearch.Visible       = true;
            }
            else
            {
                divGoodsReceivedNoteSearchError.Visible = true;
                lblGoodsReceivedNoteSearchError.Text    = Resources.GlobalResource.msgNoRecordFound;
                gvGoodsReceivedNoteSearch.Visible       = false;
            }
        }
        catch (Exception exp)
        {
            logExcpUIobj.MethodName       = "SearchGoodsReceivedNoteList()";
            logExcpUIobj.ResourceName     = "Procurement_Receive_Goods_or_Services_Receive_Goods_or_Services_GoodsReceivedNoteDistributionForm.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_GoodsReceivedNoteDistributionForm : SearchGoodsReceivedNoteList] An error occured in the processing of Record. Details : [" + exp.ToString() + "]");
        }
    }
    public DataTable GetGoodsReceivedNoteListById(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
    {
        DataSet   ds   = new DataSet();
        DataTable dtbl = new DataTable();

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

                sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GoodsReceivedNoteId"].Value = goodsReceivedNoteListUI.Tbl_GoodsReceivedNoteId;

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

            log.Error("[GoodsReceivedNoteListDAL : getGoodsReceivedNoteListById] An error occured in the processing of Record Id : " + goodsReceivedNoteListUI.Tbl_GoodsReceivedNoteId + ". Details : [" + exp.ToString() + "]");
        }
        finally
        {
            ds.Dispose();
        }

        return(dtbl);
    }
    public int DeleteGoodsReceivedNote(GoodsReceivedNoteListUI goodsReceivedNoteListUI)
    {
        int result = 0;

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

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

                sqlCmd.Parameters.Add("@tbl_GoodsReceivedNoteId", SqlDbType.NVarChar);
                sqlCmd.Parameters["@tbl_GoodsReceivedNoteId"].Value = goodsReceivedNoteListUI.Tbl_GoodsReceivedNoteId;

                result = sqlCmd.ExecuteNonQuery();

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

            log.Error("[GoodsReceivedNoteListDAL : DeleteGoodsReceivedNote] An error occured in the processing of Record Id : " + goodsReceivedNoteListUI.Tbl_GoodsReceivedNoteId + ". Details : [" + exp.ToString() + "]");
        }

        return(result);
    }