Ejemplo n.º 1
0
        public static External_TimesCollection GetAllItemByMonth(DateTime FromDate, DateTime ToDate, int UserID, string FilterBy, string FilterValue)
        {
            var pars = new SqlParameter[]
            {
                new SqlParameter("@FromDate", FromDate),
                new SqlParameter("@ToDate", ToDate),
                new SqlParameter("@FilterBy", FilterBy),
                new SqlParameter("@FilterValue", FilterValue),
                new SqlParameter("@ManagerID", UserID),
                new SqlParameter("@OrderBy", "AssociateNo"),
                new SqlParameter("@OrderDirection", 1),
            };
            External_TimesCollection collection = new External_TimesCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "USP_TMS_External_AssociatesTimeSheet_Get_MonthlyScantime_V1", pars))
            {
                //return CommonHelper.DataReaderToList<External_TimesCollection>(reader);
                External_Times obj = new External_Times();
                while (reader.Read())
                {
                    obj = GetMonthly(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Ejemplo n.º 2
0
        private static External_Times GetMonthly(IDataReader dataReader)
        {
            External_Times objItem = new External_Times();

            objItem.AssociateNo   = SqlHelper.GetString(dataReader, "AssociateNo");
            objItem.AssociateName = SqlHelper.GetString(dataReader, "AssociateName");
            objItem.JoinDate      = SqlHelper.GetDateTime(dataReader, "JoinDate");
            objItem.EndDate       = SqlHelper.GetDateTime(dataReader, "EndDate");

            objItem.Standard = SqlHelper.GetDecimal(dataReader, "Standard");
            objItem.Actual   = SqlHelper.GetDecimal(dataReader, "Actual");

            objItem.IsActive     = SqlHelper.GetBoolean(dataReader, "IsActive");
            objItem.NT_ID        = SqlHelper.GetString(dataReader, "NT_ID");
            objItem.AccessCardNo = SqlHelper.GetInt(dataReader, "AccessCardNo");
            objItem.VendorName   = SqlHelper.GetString(dataReader, "VendorName");
            objItem.Role         = SqlHelper.GetString(dataReader, "Role");
            objItem.DeptName     = SqlHelper.GetString(dataReader, "DeptName");

            objItem.DeptName    = SqlHelper.GetString(dataReader, "DeptName");
            objItem.GroupName   = SqlHelper.GetString(dataReader, "GroupName");
            objItem.ProjectCode = SqlHelper.GetString(dataReader, "ProjectCode");
            objItem.PONumber    = SqlHelper.GetString(dataReader, "PONumber");

            objItem.DirectManager = SqlHelper.GetString(dataReader, "DirectManager");

            return(objItem);
        }