Exemplo n.º 1
0
 public List <tbl_LeaveRequest> GetLeaveRequest(string PA, string PSA, string Category)
 {
     try
     {
         DALBase obj = new DALBase(_config);
         List <tbl_LeaveRequest> listObj  = new List <tbl_LeaveRequest>();
         tbl_LeaveRequest        objLeave = new tbl_LeaveRequest();
         DataSet   ds = obj.GetLeaveRequestBYId("BCL_TEST_GETLEAVEMASTER", PA, PSA, Category);
         DataTable dt = ds.Tables[0];
         if (dt != null)
         {
             objLeave.LeaveCode     = "";
             objLeave.LeaveCategory = "--Please Select--";
             listObj.Add(objLeave);
             if (dt.Rows.Count > 0)
             {
                 foreach (DataRow dtRow in dt.Rows)
                 {
                     string LeaveID = dtRow["LEAVEID"].ToString() + "~" + dtRow["Qttype"].ToString() + "~" + dtRow["LEAVECODE"].ToString();
                     string Descr   = dtRow["Description"].ToString();
                     objLeave               = new tbl_LeaveRequest();
                     objLeave.LeaveCode     = LeaveID;
                     objLeave.LeaveCategory = Descr;
                     listObj.Add(objLeave);
                 }
             }
         }
         return(listObj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }