Ejemplo n.º 1
0
        public void AddPhotoGallery(Pracownica pracownica, string url, string filename)
        {
            pracownica.Files.Add(new File { Url = url + "/" + filename,
                                        thumbUrl = "",
                                        Description = "",
                                        PracownicaId = pracownica.PracownicaID
                            });

            DbStore.SaveChange();
        }
Ejemplo n.º 2
0
 public void ChangeMainPhoto(Pracownica pracownica, string url, string filename)
 {
     pracownica.MainPhotoUrl = url + "/" + filename;
     DbStore.SaveChange();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Create new Pracownica and attach it to the account model
        /// </summary>
        /// <param name="model"></param>
        private void CreatePracownicaAccount(RegisterModel model)
        {
            try
            {
                var pracownica = new Pracownice.Models.Pracownica();
                    pracownica.Uslugi = new List<Usluga>();
                    pracownica.Name = model.UserName;
                    pracownica.Email = model.Email;
                    pracownica.MainPhotoUrl = MyConfig.baseUrl + "/Files/images/" + "unknown.png";

                    var file = new List<Pracownice.Models.File>
                    {
                        new File {PracownicaId = pracownica.PracownicaID, Url = MyConfig.baseUrl + "/Files/images/unknown.png", thumbUrl = MyConfig.baseUrl + "/Files/miniaturki/unknownThumb.png"}
                    };

                    pracownica.Files = file;

                storeDb.Pracownice.Add(pracownica);
                storeDb.SaveChanges();

                foreach (var item in storeDb.BazoweUslugi)
                {
                    pracownica.Uslugi.Add(new Usluga {Name=item.nazwaUslugi, Description = "Dodaj Swój Opis", Prize=0, Time = 0, Active = true, PracownicaID = pracownica.PracownicaID} );
                }

                storeDb.SaveChanges();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }