コード例 #1
0
        public static ScanTimeApprovalCollection GetAllItemByManager(ScanTimeApprovalSqlParameters SearchKey)
        {
            ScanTimeApprovalCollection collection = new ScanTimeApprovalCollection();

            var pars = new SqlParameter[]
            {
                new SqlParameter("@FromDate", SearchKey.FromDate),
                new SqlParameter("@ToDate", SearchKey.ToDate),
                new SqlParameter("@User", SearchKey.UserLoggedIn),
                new SqlParameter("@ShowWaiting", SearchKey.ShowWaiting),
                new SqlParameter("@StartRow", SearchKey.StartRow),
                new SqlParameter("@EndRow", SearchKey.EndRow),
                new SqlParameter("@OrderBy", SearchKey.OrderBy),
                new SqlParameter("@OrderDirection", SearchKey.OrderDirection),
                new SqlParameter("@FilterBy", SearchKey.FilterBy),
                new SqlParameter("@ShowUnNoReg", SearchKey.ShowUnNoReg)
            };

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "DNH_TimesheetApproval_Get", pars))
            {
                while (reader.Read())
                {
                    ScanTimeApprovalReceiver obj = new ScanTimeApprovalReceiver();
                    obj         = GetItemFromReader(reader);
                    obj.TimeIn  = MergeTime(obj.RootIn, obj.ManualIn, "in");
                    obj.TimeOut = MergeTime(obj.RootOut, obj.ManualOut, "out");
                    collection.Add(obj);
                }
            }
            return(collection);
        }
コード例 #2
0
        public static ScanTimeApprovalCollection Search(ScanTimeApprovalSqlParameters SearchKey)
        {
            ScanTimeApprovalCollection collection = new ScanTimeApprovalCollection();

            var pars = new SqlParameter[]
            {
                new SqlParameter("@FromDate", SearchKey.FromDate),
                new SqlParameter("@ToDate", SearchKey.ToDate),
                new SqlParameter("@User", SearchKey.UserLoggedIn),
                new SqlParameter("@ShowWaiting", SearchKey.ShowWaiting),
                new SqlParameter("@StartRow", SearchKey.StartRow),
                new SqlParameter("@EndRow", SearchKey.EndRow),
                new SqlParameter("@OrderBy", SearchKey.OrderBy),
                new SqlParameter("@OrderDirection", SearchKey.OrderDirection),
                new SqlParameter("@FilterBy", SearchKey.FilterBy),
                new SqlParameter("@ShowUnNoReg", SearchKey.ShowUnNoReg)
            };



            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "USP_TMS_ApproveTimeSheet_Get", pars))
            {
                while (reader.Read())
                {
                    ScanTimeApprovalReceiver obj = new ScanTimeApprovalReceiver();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }