Exemple #1
0
 /// <summary>
 /// For HolidayList Bind
 /// </summary>
 /// <returns></returns>
 public List <tblHoliday> GetHolidayList(string Empid)
 {
     try
     {
         DALBase           obj     = new DALBase(_config);
         List <tblHoliday> listObj = new List <tblHoliday>();
         DataSet           ds      = obj.GetHolidaylist(ConstantStoredProcedure.SP_BCL_HOLIDAYLIST, Empid);
         if (ds != null && ds.Tables.Count > 0)
         {
             for (int i = 0; i < ds.Tables.Count; i++)
             {
                 if (ds.Tables[i] != null && ds.Tables[i].Rows.Count > 0)
                 {
                     foreach (DataRow dtRow in ds.Tables[i].Rows)
                     {
                         var date     = dtRow["FROMDATE"].ToString();
                         var Descr    = dtRow["TODATE"].ToString();
                         var Descr1   = dtRow["DESCRIPTION"].ToString();
                         var Descr2   = dtRow["Status"].ToString();
                         var objLeave = new tblHoliday();
                         objLeave.HolidayDate = Convert.ToDateTime(date).ToString("yyyy/MM/dd").Replace('-', '/');
                         objLeave.HolidayName = Convert.ToDateTime(Descr).ToString("yyyy/MM/dd").Replace('-', '/');
                         objLeave.Text        = Descr1;
                         objLeave.Text1       = Descr2;
                         listObj.Add(objLeave);
                     }
                 }
             }
         }
         return(listObj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }