Asp.net Project Tutorial: The Blood Donor Project's Business Logic

Introduction:

Within the intricate web of the "Blood Donor Project," the Business Logic acts as the orchestrator, directing the flow of data between the user interface and the database. This article dissects the key functionalities of the Business Logic, shedding light on how it bridges the gap between the user's actions and the underlying database operations.

Business Logic: Navigating Data Flow

The "BloodDonarBusinessLogic" namespace encapsulates the core functionalities that drive the application's operations. Let's explore the major components and their roles within the Business Logic:

Insert Blood Donor Details:

The "InsertBloodDonarBL" method seamlessly integrates with the Database Logic to facilitate the insertion of blood donor details into the database. This ensures that user-contributed data is stored securely and efficiently.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using BloodDonarObject;
using BloodDonarDataBaseLogic;

namespace BloodDonarBusinessLogic
{
    public class BusinessLogic
    {
	    BloodDonarDataBaseLogic.DatabaseLogic boDBLogic = new DatabaseLogic();

        #region Insert Blood Donar Details

        public void InsertBloodDonarBL(BloodDonarObject.BusinessObject boObj)
        {
            try
            {
                boDBLogic.InsertBloodDonarDB(boObj);
            }
            catch
            {
                throw;
            }
        }

        #endregion
     }
 }

Insert Post Status Data:

The "InsertPostStatusData" method acts as a conduit for adding status updates to the database. Leveraging the Database Logic, it enables users to share their blood donation journey through status posts.


#region Insert Post Status Data
public void InsertPostStatusData(BloodDonarObject.BusinessObject statusObj)
{
    try
    {
	  boDBLogic.InsertStatusData(statusObj);
    }
    catch
    {
	  throw;
    }
}
#endregion

Insert Blood Bank Details:

The "InsertBBDetails" method seamlessly integrates blood bank details into the application's database. This ensures a comprehensive and up-to-date repository of blood bank information.


#region Insert Blood Bank Details
public void InsertBBDetails(BloodDonarObject.BusinessObject bbObj)
{
    try
    {
	  boDBLogic.InsertBloodBankData(bbObj);
    }
    catch
    {
	  throw;
    }
}
#endregion

Get Status Post:

The "DisplayStatusPost" method allows users to retrieve their status posts from the database, providing a personalized experience within the application.


#region Get Status Post
public DataSet DisplayStatusPost(BusinessObject sObject)
{
    DataSet statuspostDS = new DataSet();
    statuspostDS = boDBLogic.GetStatusPost(sObject);
    return statuspostDS;
}
#endregion

Verify Blood Donor Login:

The "VerifyBloodDonarUser" method ensures the security of user accounts by verifying login credentials against the database. This critical functionality safeguards user information.


#region Verify Blood Donar Login
public int VerifyBloodDonarUser(BusinessObject boObj)
{
    try
    {
		int i = boDBLogic.VerifyBloodDonar(boObj);
		return i;
    }
    catch
    {
		throw;
    }
}
#endregion

Auto Generate ID For ALL:

The "AutoGenerateID" method streamlines the process of generating unique identifiers for various components within the application, ensuring data integrity and uniqueness.


#region Auto Generate ID For ALL
public string AutoGenerateID(BusinessObject boObject)
{
    try
    {
		return boDBLogic.GenerateID(boObject);
    }
    catch
    {
		throw;
    }
}

#endregion

Get Single Donor Details through Username:

Users can retrieve their individual donor details through the "GetSingleDonarDetails" method, offering a personalized view of their information.


#region Get Single Donar Details through Username
public DataSet GetSingleDonarDetails(BusinessObject boObj)
{
   DataSet ds = new DataSet();
   ds = boDBLogic.GetBloodDonarDetails(boObj);
   return ds;
}
#endregion

Additional Functionalities:

The Business Logic extends its capabilities with methods to retrieve all blood donor and blood bank details, filter blood donor and blood bank information based on state and city, and obtain data for individual blood banks.


#region Get ALL Blood Donar Details 
public DataSet GetAllBloodDonarData()
{
    DataSet ds = new DataSet();
    ds = boDBLogic.GetAllBloodDonarDetails();
    return ds;
}
#endregion

#region Get ALL Blood Bank Data
public DataSet GetALLBloodBankDetails()
{
    DataSet dsallbb = new DataSet();
    dsallbb = boDBLogic.GetALLBloodBankData();
    return dsallbb;
}
#endregion

#region Get Single Blood Bank Details
public DataSet GetSingleBBDetails(BusinessObject Obj)
{
    DataSet dssbb = new DataSet();
    dssbb = boDBLogic.GetSingleBloodBankData(Obj);
    return dssbb;
}
#endregion

#region Filter Blood Bank Details Tthrough State and City
public DataSet FilterBloodDonarStateCityData(BusinessObject scObj)
{
    DataSet ds = new DataSet();
    ds = boDBLogic.GetBloodDonarStateCityData(scObj);
    return ds;
}
#endregion

#region Filter Blood Bank Details Tthrough State and City
public DataSet FilterBloodBankStateCityData(BusinessObject scObject)
{
    DataSet ds = new DataSet();
    ds = boDBLogic.GetBloodBankStateCityData(scObject);
    return ds;
}
#endregion


Download Source Code

Download the complete source code for the Blood Donor Project from the provided link and explore its functionalities.


To get more information regarding blood donar project source code like Business Object, Database & Stored Procedure, Database Logic and User Interface

Post a Comment

0 Comments