Exemple #1
0
 private static void SearchDistributorAddressByID()
 {
     try
     {
         int searchDistributorAddressID;
         Console.WriteLine("Enter Distributor Address ID to Search:");
         searchDistributorAddressID = Convert.ToInt32(Console.ReadLine());
         DistributorAddress searchDistributorAddress = DistributorAddressBL.SearchDistributorAddressBL(searchDistributorAddressID);
         if (searchDistributorAddress != null)
         {
             Console.WriteLine("******************************************************************************");
             Console.WriteLine("DistributorAddressID\t\tAddress Line1\t\tAddress Line2\t\tCity\t\tState\t\tPincode");
             Console.WriteLine("******************************************************************************");
             Console.WriteLine("{0}\t\t{1}\t\t{2}\t\t{3}\t\t{4}", searchDistributorAddress.DistributorAddressID, searchDistributorAddress.DistributorAddressLine1, searchDistributorAddress.DistributorAddressLine2, searchDistributorAddress.DistributorCity, searchDistributorAddress.DistributorState, searchDistributorAddress.DistributorPincode);
             Console.WriteLine("******************************************************************************");
         }
         else
         {
             Console.WriteLine("No Distributor Address Details Available");
         }
     }
     catch (InventoryException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Exemple #2
0
 private static void DeleteDistributorAddress()
 {
     try
     {
         int deleteDistributorAddressID;
         Console.WriteLine("Enter DistributorAddressID to Delete:");
         deleteDistributorAddressID = Convert.ToInt32(Console.ReadLine());
         DistributorAddress deleteDistributorAddress = DistributorAddressBL.SearchDistributorAddressBL(deleteDistributorAddressID);
         if (deleteDistributorAddress != null)
         {
             bool distributorAddressdeleted = DistributorAddressBL.DeleteDistributorAddressBL(deleteDistributorAddressID);
             if (distributorAddressdeleted)
             {
                 Console.WriteLine("Distributor Address Deleted");
             }
             else
             {
                 Console.WriteLine("Distributor Address not Deleted ");
             }
         }
         else
         {
             Console.WriteLine("No Distributor Address Details Available");
         }
     }
     catch (InventoryException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Exemple #3
0
 private static void UpdateDistributorAddress()
 {
     try
     {
         int updateDistributorAddressID;
         Console.WriteLine("Enter DistributorAddressID to Update Details:");
         updateDistributorAddressID = Convert.ToInt32(Console.ReadLine());
         DistributorAddress updatedDistributorAddress = DistributorAddressBL.SearchDistributorAddressBL(updateDistributorAddressID);
         if (updatedDistributorAddress != null)
         {
             Console.WriteLine("Update Address Line1 :");
             updatedDistributorAddress.DistributorAddressLine1 = Console.ReadLine();
             Console.WriteLine("Update Address Line2 :");
             updatedDistributorAddress.DistributorAddressLine2 = Console.ReadLine();
             Console.WriteLine("Update City :");
             updatedDistributorAddress.DistributorCity = Console.ReadLine();
             Console.WriteLine("Update State :");
             updatedDistributorAddress.DistributorState = Console.ReadLine();
             Console.WriteLine("Update Pincode :");
             updatedDistributorAddress.DistributorPincode = Console.ReadLine();
             bool distributorAddressUpdated = DistributorAddressBL.UpdateDistributorAddressBL(updatedDistributorAddress);
             if (distributorAddressUpdated)
             {
                 Console.WriteLine("Distributor Address Details Updated");
             }
             else
             {
                 Console.WriteLine("Distributor Address Details not Updated ");
             }
         }
         else
         {
             Console.WriteLine("No Distributor Address Details Available");
         }
     }
     catch (InventoryException ex)
     {
         Console.WriteLine(ex.Message);
     }
 }