//p2p 20150825 set format date
        public List<MainRequestModel> SearchMainRequest(SearchRequest obj)
        {
            try
            {

                var result = this.MainRequestRepository.SearchMainRequest(obj.Branch,
                    obj.CitizenID, obj.Cusname, obj.Enddate, obj.RequestNo, obj.StartDate,
                    obj.StatusRequest);
                return result;
            }
            catch (Exception)
            {

                throw;
            }
        }
 // public void Test(DateTime  StartDate,DateTime  Enddate,string RequestNo,string StatusRequest,string CitizenID,string Cusname,string Branch)
 public void Test(SearchRequest obj)
 {
 }
        /// <summary>
        /// [20150827] Add by Woody 
        /// user for main marketing page
        /// </summary>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <param name="page"></param>
        /// <param name="StartDate"></param>
        /// <param name="Enddate"></param>
        /// <param name="RequestNo"></param>
        /// <param name="StatusRequest"></param>
        /// <param name="CitizenID"></param>
        /// <param name="Branch"></param>
        /// <returns></returns>
        public List<MainRequestModel> GetMainRequest(int start, int limit, int page, string StartDate, string Enddate,
                string RequestNo, string StatusRequest, string CitizenID, string Branch)
        {
            try
            {
                var param = new SearchRequest{
                    StartDate = StartDate,
                    Branch = Branch,
                    CitizenID = CitizenID,
                    Cusname = CitizenID,
                    Enddate = Enddate,
                    RequestNo =  RequestNo,
                    StatusRequest = StatusRequest
                };
                var result = this.SearchMainRequest(param).Skip(start).Take(limit).ToList <MainRequestModel>();

                return result as List<MainRequestModel>;
            }
            catch (Exception)
            {

                throw;
            }
        }