Esempio n. 1
0
 public BusinessObjects.Models.CustomIssueTicketAndShowMessageButtons selectIssueTicketAndShowMessageButtonsByBankName(string pBankName, int pBranchId, int pScreenId)
 {
     try
     {
         BusinessObjects.Models.CustomIssueTicketAndShowMessageButtons lstButtons = new BusinessObjects.Models.CustomIssueTicketAndShowMessageButtons();
         string pquery = "sp_selectIssueTicketAndShowMessageButtonsByBankName";
         List <SqlParameter> buttonsParams = new List <SqlParameter>();
         buttonsParams.Add(new SqlParameter("@bankName", pBankName));
         buttonsParams.Add(new SqlParameter("@branchId", pBranchId));
         buttonsParams.Add(new SqlParameter("@screenId", pScreenId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(pquery, buttonsParams);
         if (dataSet == null)
         {
             return(null);
         }
         if (dataSet.Tables[0].Rows.Count != 0)
         {
             if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) > 0)
             {
                 List <BusinessObjects.Models.CustomIssueTicketButton> lstIssueTicketButtons = new List <BusinessObjects.Models.CustomIssueTicketButton>();
                 List <BusinessObjects.Models.CustomShowMessageButton> lstShowMessageButtons = new List <BusinessObjects.Models.CustomShowMessageButton>();
                 foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                 {
                     if (dataRow["type"].ToString() == "IssueTicket")
                     {
                         BusinessObjects.Models.CustomIssueTicketButton issueTicketButton = new BusinessObjects.Models.CustomIssueTicketButton();
                         issueTicketButton.id        = Convert.ToInt32(dataRow["id"]);
                         issueTicketButton.enName    = dataRow["enName"].ToString();
                         issueTicketButton.arName    = dataRow["arName"].ToString();
                         issueTicketButton.serviceId = Convert.ToInt32(dataRow["serviceId"]);
                         issueTicketButton.screenId  = Convert.ToInt32(dataRow["screenId"]);
                         lstIssueTicketButtons.Add(issueTicketButton);
                     }
                     else
                     {
                         BusinessObjects.Models.CustomShowMessageButton showMessageButton = new BusinessObjects.Models.CustomShowMessageButton();
                         showMessageButton.id        = Convert.ToInt32(dataRow["id"]);
                         showMessageButton.enName    = dataRow["enName"].ToString();
                         showMessageButton.arName    = dataRow["arName"].ToString();
                         showMessageButton.messageEN = dataRow["messageEN"].ToString();
                         showMessageButton.messageAR = dataRow["messageAR"].ToString();
                         showMessageButton.screenId  = Convert.ToInt32(dataRow["screenId"]);
                         lstShowMessageButtons.Add(showMessageButton);
                     }
                 }
                 lstButtons.issueTicketButtons = lstIssueTicketButtons;
                 lstButtons.showMessageButtons = lstShowMessageButtons;
             }
         }
         return(lstButtons);
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(null);
     }
 }
Esempio n. 2
0
 public List <Service> selectServicesByBankId(int pBankId)
 {
     try
     {
         List <Service>      lstServices   = new List <Service>();
         string              pquery        = "sp_selectServicesByBankId";
         List <SqlParameter> ServiceParams = new List <SqlParameter>();
         ServiceParams.Add(new SqlParameter("@bankId", pBankId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(pquery, ServiceParams);
         if (dataSet != null)
         {
             if (dataSet.Tables[0].Rows.Count != 0)
             {
                 if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) != 0)
                 {
                     foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                     {
                         Service service = new Service();
                         service.id              = Convert.ToInt32(dataRow["id"]);
                         service.enName          = dataRow["enName"].ToString();
                         service.arName          = dataRow["arName"].ToString();
                         service.active          = Convert.ToBoolean(dataRow["active"]);
                         service.maxNumOfTickets = Convert.ToInt32(dataRow["maxNumOfTickets"]);
                         if (dataRow["minimumServiceTime"] != System.DBNull.Value)
                         {
                             service.minimumServiceTime = Convert.ToInt32(dataRow["minimumServiceTime"]);
                         }
                         if (dataRow["maximumServiceTime"] != System.DBNull.Value)
                         {
                             service.maximumServiceTime = Convert.ToInt32(dataRow["maximumServiceTime"]);
                         }
                         service.bankId = Convert.ToInt32(dataRow["bankId"]);
                         lstServices.Add(service);
                     }
                 }
                 else
                 {
                     Service service = new Service();
                     service.id = 0;
                     lstServices.Add(service);
                     return(lstServices);
                 }
             }
             return(lstServices);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(null);
     }
 }
Esempio n. 3
0
 public List <Counter> selectCountersByBranchId(int pBranchId, int pBankId)
 {
     try
     {
         List <Counter>      lstCounters   = new List <Counter>();
         string              pquery        = "sp_selectCountersByBranchId";
         List <SqlParameter> ServiceParams = new List <SqlParameter>();
         ServiceParams.Add(new SqlParameter("@branchId", pBranchId));
         ServiceParams.Add(new SqlParameter("@bankId", pBankId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(pquery, ServiceParams);
         if (dataSet != null)
         {
             if (dataSet.Tables[0].Rows.Count != 0)
             {
                 if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) != 0)
                 {
                     foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                     {
                         Counter counter = new Counter();
                         counter.id       = Convert.ToInt32(dataRow["id"]);
                         counter.enName   = dataRow["enName"].ToString();
                         counter.arName   = dataRow["arName"].ToString();
                         counter.active   = Convert.ToBoolean(dataRow["active"]);
                         counter.type     = dataRow["type"].ToString();
                         counter.branchId = Convert.ToInt32(dataRow["branchId"]);
                         lstCounters.Add(counter);
                     }
                 }
                 else
                 {
                     Counter counter = new Counter();
                     counter.id = 0;
                     lstCounters.Add(counter);
                     return(lstCounters);
                 }
             }
             return(lstCounters);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(null);
     }
 }
Esempio n. 4
0
 public List <AllocateCounterService> selectAllocateCounterService(int counterId, int bankId)
 {
     try
     {
         List <AllocateCounterService> lstAllocateCounterService = new List <AllocateCounterService>();
         string pquery = "sp_selectAllocateCounterService";
         List <SqlParameter> AllocateCounterServiceParams = new List <SqlParameter>();
         AllocateCounterServiceParams.Add(new SqlParameter("@counterId", counterId));
         AllocateCounterServiceParams.Add(new SqlParameter("@bankId", bankId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(pquery, AllocateCounterServiceParams);
         if (dataSet != null)
         {
             if (dataSet.Tables[0].Rows.Count != 0)
             {
                 if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) > 0)
                 {
                     foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                     {
                         AllocateCounterService allocateCounterService = new AllocateCounterService();
                         allocateCounterService.id            = Convert.ToInt32(dataRow["id"]);
                         allocateCounterService.counterId     = Convert.ToInt32(dataRow["counterId"]);
                         allocateCounterService.serviceId     = Convert.ToInt32(dataRow["serviceId"]);
                         allocateCounterService.serviceEnName = dataRow["serviceEnName"].ToString();
                         allocateCounterService.serviceArName = dataRow["serviceArName"].ToString();
                         lstAllocateCounterService.Add(allocateCounterService);
                     }
                 }
                 else
                 {
                     AllocateCounterService allocateCounterService = new AllocateCounterService();
                     allocateCounterService.id = Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]);
                     lstAllocateCounterService.Add(allocateCounterService);
                     return(lstAllocateCounterService);
                 }
             }
             return(lstAllocateCounterService);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveExceptionToLogFile(ex);
         return(null);
     }
 }
Esempio n. 5
0
 public List <Branch> selectBranchesByBankId(int pBankId)
 {
     try
     {
         List <Branch>       lstBranches  = new List <Branch>();
         string              storedProc   = "sp_selectBranchesByBankId";
         List <SqlParameter> branchParams = new List <SqlParameter>();
         branchParams.Add(new SqlParameter("@bankId", pBankId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(storedProc, branchParams);
         if (dataSet != null)
         {
             if (dataSet.Tables[0].Rows.Count != 0)
             {
                 if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) != 0)
                 {
                     foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                     {
                         Branch branch = new Branch();
                         branch.id     = Convert.ToInt32(dataRow["id"]);
                         branch.enName = dataRow["enName"].ToString();
                         branch.arName = dataRow["arName"].ToString();
                         branch.active = Convert.ToBoolean(dataRow["active"]);
                         branch.bankId = Convert.ToInt32(dataRow["bankId"]);
                         lstBranches.Add(branch);
                     }
                 }
                 else
                 {
                     Branch branch = new Branch();
                     branch.id = 0;
                     lstBranches.Add(branch);
                     return(lstBranches);
                 }
             }
             return(lstBranches);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(null);
     }
 }
Esempio n. 6
0
 public List <BusinessObjects.Models.CustomShowMessageButton> selectShowMessagebyBranchIdAnsScreenId(int pBankId, int pBranchId, int pScreenId)
 {
     try
     {
         List <BusinessObjects.Models.CustomShowMessageButton> lstShowMessageButtons = new List <BusinessObjects.Models.CustomShowMessageButton>();
         string pquery = "selectShowMessagebyBranchIdAndScreen";
         List <SqlParameter> showMessageButtonsParams = new List <SqlParameter>();
         showMessageButtonsParams.Add(new SqlParameter("@bankId", pBankId));
         showMessageButtonsParams.Add(new SqlParameter("@branchId", pBranchId));
         showMessageButtonsParams.Add(new SqlParameter("@screenId", pScreenId));
         DALDBHelper.DALDBHelper dBHelper = new DALDBHelper.DALDBHelper();
         DataSet dataSet = dBHelper.executeAdapterProc(pquery, showMessageButtonsParams);
         if (dataSet != null)
         {
             if (dataSet.Tables[0].Rows.Count != 0)
             {
                 if (Convert.ToInt32((dataSet.Tables[0].Rows[0])["id"]) > 0)
                 {
                     foreach (DataRow dataRow in dataSet.Tables[0].Rows)
                     {
                         BusinessObjects.Models.CustomShowMessageButton showMessageButton = new BusinessObjects.Models.CustomShowMessageButton();
                         showMessageButton.id        = Convert.ToInt32(dataRow["id"]);
                         showMessageButton.enName    = dataRow["enName"].ToString();
                         showMessageButton.arName    = dataRow["arName"].ToString();
                         showMessageButton.messageEN = dataRow["messageEN"].ToString();
                         showMessageButton.messageAR = dataRow["messageAR"].ToString();
                         showMessageButton.screenId  = Convert.ToInt32(dataRow["screenId"]);
                         lstShowMessageButtons.Add(showMessageButton);
                     }
                 }
             }
             return(lstShowMessageButtons);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         ExceptionsWriter.saveEventsAndExceptions(ex, "Exceptions not handled", EventLogEntryType.Error);
         return(null);
     }
 }