public ValidateRecordEventArgs( IDataRecord record, DataReaderBase.RecordValuesCollection values, ImportActivity importActivity )
        {
            if( record == null )
                throw new ArgumentNullException( "record" );
            Record = record;

            _values = values;
            _importActivity = importActivity;
        }
示例#2
0
        public static Permission FetchByID(ConnectorBase conn, Int32 PermissionId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.PermissionId, PermissionId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    Permission item = new Permission();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#3
0
        public static PreOrder FetchByID(ConnectorBase conn, Int64 uniqueId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.UniqueId, uniqueId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    var item = new PreOrder();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#4
0
        public static UserProfile FetchByID(ConnectorBase conn, Int64 UserId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.UserId, UserId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    UserProfile item = new UserProfile();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#5
0
        public static PromotedArea FetchByID(int Id)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.Id, Id);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    PromotedArea item = new PromotedArea();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#6
0
        public static CategoryYad2 FetchByID(ConnectorBase conn, Int64 CategoryYad2Id)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CategoryYad2Id, CategoryYad2Id);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    CategoryYad2 item = new CategoryYad2();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#7
0
        public static Comment FetchByID(Int64 CommentId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CommentId, CommentId);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    Comment item = new Comment();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#8
0
        public static SupplierPromotedArea FetchByID(ConnectorBase conn, int Id)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.Id, Id);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    SupplierPromotedArea item = new SupplierPromotedArea();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
        public static SupplierEvent FetchByID(ConnectorBase conn, Int64 supplier_event_Id)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.id, supplier_event_Id);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    SupplierEvent item = new SupplierEvent();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#10
0
        public static Advertisement FetchByID(ConnectorBase conn, Int64 Id)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.Id, Id);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    Advertisement item = new Advertisement();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#11
0
        public static AppUserCampaign FetchByID(ConnectorBase conn, Int64 AppUserCampaignId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.AppUserCampaignId, AppUserCampaignId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    AppUserCampaign item = new AppUserCampaign();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#12
0
        public static Bid FetchByID(Int64 BidId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.BidId, BidId);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    Bid item = new Bid();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#13
0
        public static EmailLog FetchByID(ConnectorBase conn, Int64 EmailLogId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.EmailLogId, EmailLogId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    EmailLog item = new EmailLog();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#14
0
        public static CartProduct FetchByID(ConnectorBase conn, int CartProductId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CartProductId, CartProductId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    CartProduct item = new CartProduct();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#15
0
        public static AdCompany FetchByID(ConnectorBase conn, Int64 CompanyId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CompanyId, CompanyId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    AdCompany item = new AdCompany();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#16
0
        public static TempAppUser FetchByID(ConnectorBase conn, Int64 TempAppUserId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.TempAppUserId, TempAppUserId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    TempAppUser item = new TempAppUser();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#17
0
        public static List <PromotedArea> GetPromotedArea()
        {
            var   listOfPromotedArea = new List <PromotedArea>();
            Query qry = new Query(PromotedArea.TableSchema);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                while (reader.Read())
                {
                    var promotedArea = new PromotedArea();
                    promotedArea.Name = (string)reader[PromotedArea.Columns.Name];
                    promotedArea.Id   = (int)reader[PromotedArea.Columns.Id];
                    listOfPromotedArea.Add(promotedArea);
                }
            }
            return(listOfPromotedArea);
        }
示例#18
0
        public override void Read(DataReaderBase reader)
        {
            EmailLogId   = Convert.ToInt64(reader[Columns.EmailLogId]);
            ToList       = (string)reader[Columns.ToList];
            CcList       = (string)reader[Columns.CcList];
            BccList      = (string)reader[Columns.BccList];
            FromName     = (string)reader[Columns.FromName];
            FromEmail    = (string)reader[Columns.FromEmail];
            MailPriority = (System.Net.Mail.MailPriority)Convert.ToInt32(reader[Columns.MailPriority]);
            Subject      = (string)reader[Columns.Subject];
            Body         = (string)reader[Columns.Body];
            DeliveryDate = Convert.ToDateTime(reader[Columns.DeliveryDate]);
            Status       = (EmailLogStatus)Convert.ToInt32(reader[Columns.Status]);
            Exception    = StringOrNullFromDb(reader[Columns.Exception]);

            IsThisANewRecord = false;
        }
示例#19
0
        public static PriceDeviation FetchByID(ConnectorBase conn, Int64 SupplierId, Int64 ProductId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.SupplierId, SupplierId)
                        .AND(Columns.ProductId, ProductId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    PriceDeviation item = new PriceDeviation();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#20
0
        public static SupplierService FetchByID(ConnectorBase conn, Int64 ServiceId, Int64 SupplierId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.ServiceId, ServiceId)
                        .AND(Columns.SupplierId, SupplierId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    SupplierService item = new SupplierService();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#21
0
        public static SupplierCity FetchByID(Int64 CityId, Int64 SupplierId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CityId, CityId)
                        .AND(Columns.SupplierId, SupplierId);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    SupplierCity item = new SupplierCity();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#22
0
        public static AppUserGcmToken FetchByID(Int64 AppUserId, string Token)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.AppUserId, AppUserId)
                        .AND(Columns.Token, Token);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    AppUserGcmToken item = new AppUserGcmToken();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
        public static AppSupplierAPNSToken FetchByID(ConnectorBase conn, Int64 SupplierId, string Token)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.SupplierId, SupplierId)
                        .AND(Columns.Token, Token);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    AppSupplierAPNSToken item = new AppSupplierAPNSToken();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#24
0
        public static ProductAnimal FetchByID(ConnectorBase conn, Int64 ProductId, Int64 AnimalId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.ProductId, ProductId)
                        .AND(Columns.AnimalId, AnimalId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    ProductAnimal item = new ProductAnimal();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
        private static BidMessage get_message_by_bid_and_supplier(Int64 bidId, Int64 supplierId)
        {
            var qry = new Query(BidMessage.TableSchema);

            qry.Where(BidMessage.Columns.BidId, bidId);
            qry.AddWhere(BidMessage.Columns.SupplierId, supplierId);
            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    BidMessage item = new BidMessage();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#26
0
        public static AppUserUI GetAppUserUI(Int64 AppUserId)
        {
            Query q = new Query(AppUser.TableSchema)
                      .Select(AppUser.Columns.AppUserId)
                      .AddSelect(AppUser.Columns.ProfileImage)
                      .AddSelect(AppUser.Columns.Email)
                      .AddSelect(AppUser.Columns.IsLocked)
                      .AddSelect(AppUser.Columns.FirstName)
                      .AddSelect(AppUser.Columns.LastName)
                      .AddSelect(AppUser.Columns.Phone)
                      .AddSelect(AppUser.Columns.LastLogin)
                      .AddSelect(AppUser.Columns.IsAdv)
                      .AddSelect(AppUser.Columns.CreateDate)
                      .AddSelect(AppUser.Columns.Street)
                      .AddSelect(AppUser.Columns.HouseNum)
                      .AddSelect(AppUser.Columns.Floor)
                      .AddSelect(AppUser.Columns.ApartmentNumber)
                      .AddWhere(AppUser.Columns.IsDeleted, false)
                      .Join(JoinType.LeftJoin, AppUser.TableSchema, AppUser.Columns.CityId, AppUser.TableSchema.SchemaName, City.TableSchema, City.Columns.CityId, City.TableSchema.SchemaName)
                      .AddSelect(City.TableSchema.SchemaName, City.Columns.CityName, City.Columns.CityName)
                      .Where(AppUser.Columns.AppUserId, AppUserId);

            AppUserUI app_user_ui = new AppUserUI();

            using (DataReaderBase reader = q.ExecuteReader())
            {
                if (reader.Read())
                {
                    app_user_ui.AppUserId       = Convert.ToInt64(reader[AppUser.Columns.AppUserId]);
                    app_user_ui.Email           = reader[AppUser.Columns.Email] == null ? "" : reader[AppUser.Columns.Email].ToString();
                    app_user_ui.IsLocked        = Convert.ToBoolean(reader[AppUser.Columns.IsLocked]);
                    app_user_ui.FirstName       = reader[AppUser.Columns.FirstName] == null ? "" : reader[AppUser.Columns.FirstName].ToString();
                    app_user_ui.LastName        = reader[AppUser.Columns.LastName] == null ? "" : reader[AppUser.Columns.LastName].ToString();
                    app_user_ui.Phone           = reader[AppUser.Columns.Phone] == null ? "" : reader[AppUser.Columns.Phone].ToString();
                    app_user_ui.LastLogin       = reader[AppUser.Columns.LastLogin] == null ? "" : Convert.ToDateTime(reader[AppUser.Columns.LastLogin]).ToLocalTime().ToString(@"dd/MM/yyyy HH:mm");
                    app_user_ui.IsAdv           = Convert.ToBoolean(reader[AppUser.Columns.IsAdv]);
                    app_user_ui.ApartmentNumber = reader[AppUser.Columns.ApartmentNumber] == null ? "" : reader[AppUser.Columns.ApartmentNumber].ToString();
                    app_user_ui.Street          = reader[AppUser.Columns.Street] == null ? "" : reader[AppUser.Columns.Street].ToString();
                    app_user_ui.HouseNum        = reader[AppUser.Columns.HouseNum] == null ? "" : reader[AppUser.Columns.HouseNum].ToString();
                    app_user_ui.Floor           = reader[AppUser.Columns.Floor] == null ? "" : reader[AppUser.Columns.Floor].ToString();
                    app_user_ui.CityName        = reader[City.Columns.CityName] == null ? "" : reader[City.Columns.CityName].ToString();
                    app_user_ui.CreateDate      = reader[AppUser.Columns.CreateDate] == null ? "" : Convert.ToDateTime(reader[AppUser.Columns.CreateDate]).ToLocalTime().ToString(@"dd/MM/yyyy");
                }
            }
            return(app_user_ui);
        }
        public static ProductYad2Category FetchByID(Int64 CategoryYad2Id, Int64 ProductId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.CategoryYad2Id, CategoryYad2Id)
                        .AND(Columns.ProductId, ProductId);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    ProductYad2Category item = new ProductYad2Category();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#28
0
        public static List <AdCompany> GetAllCompaniesUI(bool IsSearch = false, string SearchName = "", string SearchPhone = "", int PageSize = 0, int CurrentPageIndex = 0)
        {
            Query qry = new Query(AdCompany.TableSchema);

            qry.SelectAllTableColumns();
            qry.Distinct();
            var wl1 = new WhereList().OR(AdCompany.TableSchema.SchemaName, AdCompany.Columns.Deleted, WhereComparision.EqualsTo, null)
                      .OR(AdCompany.TableSchema.SchemaName, AdCompany.Columns.Deleted, WhereComparision.GreaterThan, DateTime.Now);

            qry.AddWhere(WhereCondition.AND, wl1);

            if (IsSearch == true)
            {
                WhereList wl = new WhereList();
                wl.OR(AdCompany.Columns.ContactPhone, WhereComparision.Like, SearchPhone)
                .OR(AdCompany.Columns.Phone, WhereComparision.Like, SearchPhone);
                qry.AND(wl);
                qry.AddWhere(AdCompany.Columns.ContactName, WhereComparision.Like, SearchName);
            }
            if (PageSize > 0)
            {
                qry.LimitRows(PageSize).OffsetRows(PageSize * CurrentPageIndex);
            }

            List <AdCompany> list = new List <AdCompany>();

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                while (reader.Read())
                {
                    list.Add(new AdCompany
                    {
                        CompanyId    = Convert.ToInt64(reader[AdCompany.Columns.CompanyId]),
                        BusinessName = Convert.ToString(reader[AdCompany.Columns.BusinessName]),
                        Email        = Convert.ToString(reader[AdCompany.Columns.Email]),
                        ContactPhone = Convert.ToString(reader[AdCompany.Columns.ContactPhone]),
                        Phone        = Convert.ToString(reader[AdCompany.Columns.Phone]),
                        ContactName  = Convert.ToString(reader[AdCompany.Columns.ContactName]),
                        CreatedDate  = reader[AdCompany.Columns.CreatedDate] == DBNull.Value ? (DateTime?)null : Convert.ToDateTime(reader[AdCompany.Columns.CreatedDate]),
                        Description  = Convert.ToString(reader[AdCompany.Columns.Description])
                    });
                }
            }
            return(list);
        }
示例#29
0
        public static List <ProductYad2UI> GetAllProductsYad2(List <int> StatusIds = null, int PageSize = 0, int CurrentPageIndex = 0)
        {
            Query qry = new Query(ProductYad2.TableSchema);

            qry.Join(JoinType.InnerJoin, ProductYad2.TableSchema, ProductYad2.Columns.CityId, ProductYad2.TableSchema.SchemaName,
                     City.TableSchema, City.Columns.CityId, City.TableSchema.SchemaName);
            qry.SelectAll();
            qry.SelectAllTableColumns();
            qry.AddSelect(City.TableSchema.SchemaName, City.Columns.CityName, City.Columns.CityName);
            if (StatusIds != null && StatusIds.Count != 0)
            {
                qry.AddWhere(ProductYad2.TableSchema.SchemaName, ProductYad2.Columns.Status, WhereComparision.In, StatusIds);
            }
            if (PageSize > 0)
            {
                qry.LimitRows(PageSize).OffsetRows(PageSize * CurrentPageIndex);
            }
            List <ProductYad2UI> list = new List <ProductYad2UI>();

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                while (reader.Read())
                {
                    list.Add(new ProductYad2UI
                    {
                        ProductId     = Convert.ToInt64(reader["ProductId"]),
                        ProductName   = Convert.ToString(reader["ProductName"]),
                        ProductImage  = Convert.ToString(reader["ProductImage"]),
                        Phone         = Convert.ToString(reader["Phone"]),
                        AppUserId     = Convert.ToInt64(reader["AppUserId"]),
                        Status        = (StatusType)Enum.Parse(typeof(StatusType), reader["Status"].ToString()),
                        CreateDate    = Convert.ToDateTime(reader["CreateDate"]).ToLocalTime(),
                        UpdateDate    = Convert.ToDateTime(reader["UpdateDate"]).ToLocalTime(),
                        CityId        = Convert.ToInt64(reader["CityId"]),
                        CityName      = Convert.ToString(reader["CityName"]),
                        StatusRemarks = Convert.ToString(reader["StatusRemarks"]),
                        Price         = Convert.ToDecimal(reader["Price"]),
                        ContactName   = Convert.ToString(reader["ContactName"]),
                        Details       = Convert.ToString(reader["Details"]),
                        LstCategory   = GetAllCatagoriesOfProduct(Convert.ToInt64(reader["ProductId"])),
                    });
                }
            }
            return(list);
        }
示例#30
0
        public static ProductFilter FetchByID(Int64 ProductId, Int64 FilterId, Int64 SubFilterId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.ProductId, ProductId)
                        .AND(Columns.FilterId, FilterId)
                        .AND(Columns.SubFilterId, SubFilterId);

            using (DataReaderBase reader = qry.ExecuteReader())
            {
                if (reader.Read())
                {
                    ProductFilter item = new ProductFilter();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#31
0
        public static SubCategoryFilter FetchByID(ConnectorBase conn, Int64 SubCategoryId, Int64 FilterId, Int64 CategoryId)
        {
            Query qry = new Query(TableSchema)
                        .Where(Columns.SubCategoryId, SubCategoryId)
                        .AND(Columns.FilterId, FilterId)
                        .AND(Columns.CategoryId, CategoryId);

            using (DataReaderBase reader = qry.ExecuteReader(conn))
            {
                if (reader.Read())
                {
                    SubCategoryFilter item = new SubCategoryFilter();
                    item.Read(reader);
                    return(item);
                }
            }
            return(null);
        }
示例#32
0
        protected virtual bool OnValidateRecord(DataReaderBase.RecordValuesCollection values)
        {
            if (ValidateRecord != null)
            {
                var details = ValidateCurrentRecord();
                var args = new ValidateRecordEventArgs(
                    (IDataRecord)_reader,
                    values,
                    this );

                foreach( var validationErrorDetail in details )
                    args.AddValidationErrorDetail( validationErrorDetail );

                ValidateRecord(this, args);
                return !args.IsValid || args.SkipRecord;
            }
            return true;
        }
示例#33
0
 public string RestoreRawRecord(DataReaderBase.RecordValuesCollection values)
 {
     StringBuilder sb = new StringBuilder();
     foreach (string value in values)
     {
         if (sb.Length > 0)
             sb.Append(_csvDelimiterChar);
         sb.Append(!string.IsNullOrEmpty(value) ? value : "[NULL]");
     }
     return sb.ToString();
 }