예제 #1
0
 public void UpdateDeliveryDate(BusinessModels.Provider prov)
 {
     DAL.Provider UpdatedProvider = repos.Providers.GetItem(prov.Id);
     UpdatedProvider.PossibleDeliveryDate = prov.PossibleDeliveryDate;
     repos.Providers.Update(UpdatedProvider);
     repos.Save();
 }
예제 #2
0
 public Provider(DAL.Provider provider)
 {
     CompanyName          = provider.CompanyName;
     FamilyName           = provider.FamilyName;
     Id                   = provider.Id;
     Initials             = provider.Initials;
     FullName             = provider.FamilyName + " " + provider.Initials;
     PossibleDeliveryDate = provider.PossibleDeliveryDate;
 }
예제 #3
0
        public void UpdateDeliveryDate(DateTime date, int[] indeces)
        {
            BLL.BusinessModels.Provider UpdatedProvider;
            int check = 0;

            foreach (int id in indeces)
            {
                UpdatedProvider = getProvider(id);
                if (UpdatedProvider.PossibleDeliveryDate < date)
                {
                    UpdatedProvider.PossibleDeliveryDate = date;
                    DAL.Provider UpdProvider = repos.Providers.GetItem(UpdatedProvider.Id);
                    UpdProvider.PossibleDeliveryDate = UpdatedProvider.PossibleDeliveryDate;
                    repos.Providers.Update(UpdProvider);
                    check += 1;
                }
            }
            if (check > 0)
            {
                repos.Save();
            }
        }
예제 #4
0
        public void CheckProviders()
        {
            List <BLL.BusinessModels.Provider> UpdateList = getProviders();
            int check = 0;

            foreach (BusinessModels.Provider item in UpdateList)
            {
                if (item.PossibleDeliveryDate <= DateTime.Now)
                {
                    item.PossibleDeliveryDate = DateTime.Now.AddMonths(1);
                    DAL.Provider UpdatedProvider = repos.Providers.GetItem(item.Id);
                    UpdatedProvider.PossibleDeliveryDate = item.PossibleDeliveryDate;
                    repos.Providers.Update(UpdatedProvider);
                    check += 1;
                }
            }
            if (check > 0)
            {
                repos.Save();
            }
            //if (repos.Save() < 1) throw new DbUpdateException();
        }
예제 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Providers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProviders(Provider provider)
 {
     base.AddObject("Providers", provider);
 }
예제 #6
0
 /// <summary>
 /// Create a new Provider object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="url">Initial value of the Url property.</param>
 /// <param name="insertedDate">Initial value of the InsertedDate property.</param>
 /// <param name="active">Initial value of the Active property.</param>
 public static Provider CreateProvider(global::System.Int32 id, global::System.String name, global::System.String url, global::System.DateTime insertedDate, global::System.Boolean active)
 {
     Provider provider = new Provider();
     provider.Id = id;
     provider.Name = name;
     provider.Url = url;
     provider.InsertedDate = insertedDate;
     provider.Active = active;
     return provider;
 }
예제 #7
0
 public DungSaiNCCDAL()
 {
     _provider = new Provider();
 }