Example #1
0
        public static T_TMS_External_Atd_ScanTime UpdateItem(T_TMS_External_Atd_ScanTime model)
        {
            Guid result = Guid.Empty;

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, CommandType.StoredProcedure, "T_TMS_External_Atd_ScanTime_Update", CreateSqlParameter(model)))
            {
                while (reader.Read())
                {
                    result = (Guid)reader[0];
                }
            }
            return(GetItemByID(result));
        }
Example #2
0
        public static T_TMS_External_Atd_ScanTimeCollection Search(SearchFilter SearchKey)
        {
            T_TMS_External_Atd_ScanTimeCollection collection = new T_TMS_External_Atd_ScanTimeCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_TMS_External_Atd_ScanTime_Search", SearchFilterManager.SqlSearchConditionNoCompany(SearchKey)))
            {
                while (reader.Read())
                {
                    T_TMS_External_Atd_ScanTime obj = new T_TMS_External_Atd_ScanTime();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Example #3
0
        public static T_TMS_External_Atd_ScanTimeCollection GetAllItem()
        {
            T_TMS_External_Atd_ScanTimeCollection collection = new T_TMS_External_Atd_ScanTimeCollection();

            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_TMS_External_Atd_ScanTime_GetAll", null))
            {
                while (reader.Read())
                {
                    T_TMS_External_Atd_ScanTime obj = new T_TMS_External_Atd_ScanTime();
                    obj = GetItemFromReader(reader);
                    collection.Add(obj);
                }
            }
            return(collection);
        }
Example #4
0
        public static T_TMS_External_Atd_ScanTime GetItemByID(Guid ID)
        {
            T_TMS_External_Atd_ScanTime item = new T_TMS_External_Atd_ScanTime();
            var sqlParams = new SqlParameter[1];

            sqlParams[0] = new SqlParameter("@ID", ID);
            using (var reader = SqlHelper.ExecuteReaderService(ModuleConfig.MyConnection, "T_TMS_External_Atd_ScanTime_GetByID", sqlParams))
            {
                while (reader.Read())
                {
                    item = GetItemFromReader(reader);
                }
            }
            return(item);
        }
Example #5
0
        private static T_TMS_External_Atd_ScanTime GetItemFromReader(IDataReader dataReader)
        {
            T_TMS_External_Atd_ScanTime objItem = new T_TMS_External_Atd_ScanTime();

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

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

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

            objItem.Manual_Input = SqlHelper.GetBoolean(dataReader, "Manual_Input");

            objItem.In1Out0 = SqlHelper.GetBoolean(dataReader, "In1Out0");

            objItem.Work_Date = SqlHelper.GetDateTime(dataReader, "Work_Date");

            objItem.Is_Over = SqlHelper.GetBoolean(dataReader, "Is_Over");

            objItem.RecordStatus = SqlHelper.GetBoolean(dataReader, "RecordStatus");

            objItem.Is_OverF = SqlHelper.GetBoolean(dataReader, "Is_OverF");

            objItem.ID = SqlHelper.GetGuid(dataReader, "ID");

            objItem.Shift_ID = SqlHelper.GetInt(dataReader, "Shift_ID");

            objItem.IsValid = SqlHelper.GetBoolean(dataReader, "IsValid");

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

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

            objItem.CreateDate = SqlHelper.GetDateTime(dataReader, "CreateDate");

            objItem.IsCopy = SqlHelper.GetBoolean(dataReader, "IsCopy");

            if (SqlHelper.ColumnExists(dataReader, "TotalRecord"))
            {
                objItem.TotalRecord = SqlHelper.GetInt(dataReader, "TotalRecord");
            }
            return(objItem);
        }
Example #6
0
 private static SqlParameter[] CreateSqlParameter(T_TMS_External_Atd_ScanTime model)
 {
     return(new SqlParameter[]
     {
         new SqlParameter("@Scan_Time", model.Scan_Time),
         new SqlParameter("@Bar_Code", model.Bar_Code),
         new SqlParameter("@Reader_ID", model.Reader_ID),
         new SqlParameter("@Manual_Input", model.Manual_Input),
         new SqlParameter("@In1Out0", model.In1Out0),
         new SqlParameter("@Work_Date", model.Work_Date),
         new SqlParameter("@Is_Over", model.Is_Over),
         new SqlParameter("@RecordStatus", model.RecordStatus),
         new SqlParameter("@Is_OverF", model.Is_OverF),
         new SqlParameter("@ID", model.ID),
         new SqlParameter("@Shift_ID", model.Shift_ID),
         new SqlParameter("@IsValid", model.IsValid),
         new SqlParameter("@RootScan", model.RootScan),
         new SqlParameter("@ScanTimeIn_Edit", model.ScanTimeIn_Edit),
         new SqlParameter("@CreateDate", model.CreateDate),
         new SqlParameter("@IsCopy", model.IsCopy),
     });
 }