예제 #1
0
		public EvaluationCardPrint (DbEntities.dbserver3.wordup.rows.Projekt projektDaten)
			: base(projektDaten)
			{

			LoadIdeePrint();
			LoadAktivitaeten();
			}
예제 #2
0
		public AktivitaetenPrint(DbEntities.dbserver3.wordup.rows.Aktivitaet AktivitaetenEntry)
			{
			ID = AktivitaetenEntry.Id.ToString();
			Type = AktivitaetenEntry.AktivitaetsTyp.AktivitaetsType;
			Wer = AktivitaetenEntry.Akteur.NameId;
			Details = AktivitaetenEntry.Details;
			PrintOutType = AktivitaetenEntry.AktivitaetsTyp.PrintOutType;
			SymbolFarbe = AktivitaetenEntry.AktivitaetsTyp.SymbolFarbe;
			}
예제 #3
0
파일: IdeePrint.cs 프로젝트: heinzsack/DEV
		public IdeePrint(DbEntities.dbserver3.wordup.rows.WSPlakat WSPlakateEntry)
			{
			ShowWMUDetail = false;
			ID = WSPlakateEntry.Id.ToString();
			Idee = WSPlakateEntry.LangBeschreibung;
			OrtsHinweis = WSPlakateEntry.OrtsHinweis;
			Klasse = WSPlakateEntry.Organisation.CodeName;
			WMU = "W/M/U = " + WSPlakateEntry.WertW + "/" + WSPlakateEntry.WertM + "/" + WSPlakateEntry.WertU;
			WMUSumme = "IdeenPunkte = " + Convert.ToString(((WSPlakateEntry.WertW != null) ? WSPlakateEntry.WertW : 0)
										+ ((WSPlakateEntry.WertM != null) ? WSPlakateEntry.WertM : 0)
										+ ((WSPlakateEntry.WertU != null) ? WSPlakateEntry.WertU : 0));
			}
        public OrderToStoreLog SaveLogOrderToStore(OrderToStore orderToStore, string comments, string status, DateTime timestamp, bool bHasToSave = false)
        {
            var orderToStoreLog = new OrderToStoreLog
            {
                Comments     = comments,
                OrderToStore = orderToStore,
                Status       = status,
                Timestamp    = timestamp
            };

            DbEntities.OrderToStoreLog.Add(orderToStoreLog);
            if (bHasToSave)
            {
                DbEntities.SaveChanges();
            }

            return(orderToStoreLog);
        }
예제 #5
0
		private void CreatePlayerRootPage(DbEntities.dbserver3.multimedia.rows.Page sourceRootPage)
			{
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedSourceRootPage
				= TargetPlayerDb.Pages.NewRow();
			convertedSourceRootPage.Id = sourceRootPage.Id;
			convertedSourceRootPage.DiagnosticText = sourceRootPage.DiagnosticText;
			convertedSourceRootPage.ExpectedDuration = (double) sourceRootPage.ExpectedDuration;
			convertedSourceRootPage.PageGroup = TargetPageGroup;
			convertedSourceRootPage.SortOrder = (int) sourceRootPage.SortOrder;
			convertedSourceRootPage.BorderColor = sourceRootPage.BorderColor;
			convertedSourceRootPage.Background = sourceRootPage.Background;
			convertedSourceRootPage.BorderThickness = sourceRootPage.BorderThickness;
			convertedSourceRootPage.HasFixedRatio = sourceRootPage.HasFixedRatio;
			convertedSourceRootPage.RatioX = sourceRootPage.RatioX;
			convertedSourceRootPage.RatioY = sourceRootPage.RatioY;
			convertedSourceRootPage.Table.Rows.Add(convertedSourceRootPage);
			CreateAllChildElements(sourceRootPage, convertedSourceRootPage);
			}
예제 #6
0
        public IEnumerable <ProductStoreModel> GetAllProductStoreByStoreID(int storeID)
        {
            dbcontext = new DbEntities();

            var query = from c in dbcontext.StoreDetails
                        where c.Store.StoreID == storeID
                        select c;

            return(query.ToList().Select(
                       c => new ProductStoreModel()
            {
                Name = c.Product.Name,
                ProductID = c.Product.ProductID,
                Picture = c.Product.Picture.LoadImage(),
                Quantity = c.Quantity
            }
                       ));
        }
예제 #7
0
        private void addToGroup(int id, int GroupId, int uid)
        {
            using (DbEntities _db = new DbEntities())
            {
                DateTime    _now = DateTime.Now;
                GroupMember _new = new GroupMember()
                {
                    UserId      = id,
                    GroupId     = GroupId,
                    CreatedDate = _now,
                    CreatedBy   = uid,
                    UpdatedBy   = uid,
                };

                _db.GroupMembers.Add(_new);
                _db.SaveChanges();
            }
        }
예제 #8
0
파일: JobController.cs 프로젝트: zweliB/API
        public HttpResponseMessage CreateNewJob(JobDTO jobDTO)
        {
            using (DbEntities entities = new DbEntities())
            {
                Client_User _User = new Client_User
                {
                    cu_name    = jobDTO.Name,
                    cu_surname = jobDTO.Surname,
                    cu_email   = jobDTO.Email,
                    cu_contact = jobDTO.Contact,
                    client_no  = jobDTO.CompanyID
                };

                Job job = new Job
                {
                    job_title       = jobDTO.Title,
                    job_description = jobDTO.Description,
                    job_attachement = jobDTO.Attachment,
                    client_user_no  = jobDTO.ClientID,
                    job_date        = jobDTO.Date,
                    job_status      = "Registered",
                    Client_User     = _User
                };

                entities.Jobs.Add(job);
                entities.SaveChanges();

                JobModel jobModel = new JobModel
                {
                    ID          = job.job_No,
                    Title       = job.job_title,
                    Description = job.job_description,
                    Attachment  = job.job_attachement,
                    ClientID    = job.client_user_no,
                    Date        = job.job_date,
                    Status      = job.job_status
                };

                var message = Request.CreateResponse(HttpStatusCode.Created, jobModel);
                message.Headers.Location = new Uri(Request.RequestUri + "/" + jobModel.ID);

                return(message);
            }
        }
예제 #9
0
        private void InitializeOrganTree()
        {
            this.treeOrgan.Nodes.Clear();
            using (DbEntities db = new DbEntities())
            {
                var vList = db.Organizations.ToList();
                this.ResolveOrganTree(vList, Guid.Empty.ToString(), this.treeOrgan.Nodes);    // 生成树

                if (treeOrgan.Nodes.Count == 0)
                {
                    Response.Write("组织机构信息尚未初始化!");
                    Response.End();

                    return;
                }
                // 展开第一个树节点
                this.treeOrgan.Nodes[0].Expanded = true;
            }
        }
예제 #10
0
        /// <summary>
        /// 查询信息(根据SubTitle模糊查询)
        /// </summary>
        /// <param name="input">输入信息</param>
        /// <returns></returns>
        public static Dictionary <int, string> Search(string input)
        {
            var dic = new Dictionary <int, string>();

            try
            {
                var db = new DbEntities();

                dic = (from d in db.DreamTitle
                       where d.SubTitle.Contains(input)
                       select d).ToDictionary(key => key.DreamId, value => value.SubTitle);
            }
            catch (Exception ex)
            {
                LogService.InsertLog(ex);
            }

            return(dic);
        }
예제 #11
0
        public DataPoolVO(DataPool datapool)
        {
            DbEntities db = new DbEntities();

            this.Id = datapool.Id;
            this.DescricaoDataPool      = datapool.Descricao;
            this.DescricaoDemanda       = datapool.Demanda != null ? datapool.Demanda.Descricao : "";
            this.DescricaoSistema       = datapool.AUT.Descricao != null ? datapool.AUT.Descricao : "";
            this.DataSolicitacao        = datapool.DataSolicitacao;
            this.DataTermino            = datapool.DataTermino;
            this.DescricaoTDM           = datapool.TDM.Descricao;
            this.IdScriptCondicaoScript = datapool.IdScript_CondicaoScript;
            List <TestData> listaMassasTestes = new List <TestData>();

            listaMassasTestes.AddRange(db.TestData.Where(x => x.IdDataPool == datapool.Id).ToList());

            this.ListaMassa = listaMassasTestes;
            //DataPoolVOs.ListaMassa.ad
        }
예제 #12
0
        /// <summary>
        /// 取当前页的数据。
        /// </summary>
        /// <returns></returns>
        private List <Module> GetPagedData()
        {
            int pageIndex = this.Grid2.PageIndex;
            int pageSize  = this.Grid2.PageSize;

            string sortField     = this.Grid2.SortField;
            string sortDirection = this.Grid2.SortDirection;

            string key  = this.tbKey.Text.Trim();
            int    type = (int)GoComType.Business;

            using (var db = new DbEntities())
            {
                var vList = db.Modules
                            .Where(p => p.Name.StartsWith(key) || p.Type.StartsWith(key) || p.Assembly.StartsWith(key))
                            .Select(p => new
                                    Module
                {
                    Guid        = p.Guid,
                    Name        = p.Name,
                    Assembly    = p.Assembly,
                    Type        = p.Type,
                    Method      = p.Method,
                    Description = p.Description,
                    Attributes  = p.Attributes,
                    Version     = p.Version,
                    Developer   = p.Developer,
                    SortCode    = p.SortCode,
                    Url         = p.Url,
                    Package     = p.Package,
                    LMTime      = p.LMTime
                })
                            .ToList();

                var v = vList.AsQueryable().Where(p => (p.Attributes & type) == type);
                if (!string.IsNullOrEmpty(sortField))
                {
                    v = v.DynamicSorting(sortField, sortDirection);
                }
                var vList2 = v.Skip(pageIndex * pageSize).Take(pageSize).ToList();
                return(vList2);
            }
        }
        public void SetCancelOrderToStore(long orderToStoreId)
        {
            var now          = DateTime.Now;
            var orderToStore = new OrderToStore
            {
                OrderToStoreId   = orderToStoreId,
                IsCanceled       = true,
                DateTimeCanceled = now,
                LastStatus       = string.Empty
            };

            DbEntities.OrderToStore.Attach(orderToStore);
            DbEntities.Entry(orderToStore).Property(e => e.IsCanceled).IsModified       = true;
            DbEntities.Entry(orderToStore).Property(e => e.DateTimeCanceled).IsModified = true;
            DbEntities.SaveChanges();
            ((IObjectContextAdapter)DbEntities).ObjectContext.Detach(orderToStore);

            SaveLogOrderToStore(orderToStoreId, "Cancelado por el cliente", SettingsData.Constants.TrackConst.CANCELED, now, true);
        }
예제 #14
0
        public IHttpActionResult GetParentPost(int id)
        {
            using (DbEntities _db = new DbEntities())
            {
                var s = _db.DiscussionPosts.Find(id);

                if (s != null)
                {
                    var result = new DiscussionPost();

                    result.Id           = s.Id;
                    result.DiscussionId = s.DiscussionId;
                    result.Topic        = s.Topic;
                    return(Ok(result));
                }
            }

            return(NotFound());
        }
예제 #15
0
        /// <summary>
        /// 审核用户
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        public string CheckUser(string UserID = "")
        {
            string res = "Error";

            //查找该用户
            var userdb  = new DbEntities <User>().SimpleClient;
            var curuser = userdb.GetById(UserID);

            if (curuser != null)
            {
                //更新
                curuser.IsChecked = true;
                if (userdb.Update(curuser))
                {
                    res = "OK";
                }
            }
            return(res);
        }
        public void Add(StoreUpModel model)
        {
            var franchiseStore = new FranchiseStore
            {
                AddressId                = model.AddressId,
                FranchiseId              = model.FranchiseId,
                Name                     = model.Name,
                UserIdIns                = model.UserInsUpId,
                DatetimeIns              = DateTime.Today,
                IsObsolete               = false,
                WsAddress                = model.WsAddress,
                ManageUserId             = model.ManUserId,
                StoreEmail               = model.StoreEmail,
                HasSendEmailWhenNewOrder = model.HasSendEmailWhenNewOrder
            };

            DbEntities.FranchiseStore.Add(franchiseStore);
            DbEntities.SaveChanges();
        }
예제 #17
0
        /// <summary>
        /// This method will insert every missing column for each table into the database. Will only be called if HasallColumns() returns false. This means the user has an outdated .db file
        /// </summary>
        private static void InsertNewColumns()
        {
            using (DbEntities db = new DbEntities())
            {
                //every column that SHOULD exist
                var settingNames = typeof(Settings).GetProperties().Select(property => property.Name).ToArray();

                foreach (string column in settingNames)
                {
                    if (!HasColumn(column, "settings"))
                    {
                        db.Database.ExecuteSqlCommand("ALTER TABLE SETTINGS ADD COLUMN " + column + " " + GetSettingColumnSqlType(column));
                    }
                }

                db.SaveChanges();
                db.Dispose();
            }
        }
예제 #18
0
 public static DTO.ImageDTO GetImage(int id)
 {
     using (var ctx = new DbEntities())
     {
         var image = ctx.Images.Find(id);
         if (image == null)
         {
             return(null);
         }
         var ImageDTO = new ImageDTO
         {
             Id       = image.Id,
             MymeType = image.MymeType,
             UserId   = image.UserId,
             BlobId   = image.BlobId
         };
         return(ImageDTO);
     }
 }
예제 #19
0
        public static List <UserDTO> GetUsers(int?lastId = null)
        {
            using (var ctx = new DbEntities())
            {
                var users = ctx.Users.AsNoTracking().AsQueryable();
                if (lastId.HasValue)
                {
                    users = users.Where(x => x.Id < lastId);
                }

                var usersDTO = new List <UserDTO>();
                var dbusers  = users.OrderByDescending(x => x.Id).Take(3).ToList();
                foreach (User dbUser in dbusers)
                {
                    var user = new UserDTO
                    {
                        BirthDate       = dbUser.BirthDate,
                        Id              = dbUser.Id,
                        PostsId         = new List <int>(),
                        LoginName       = dbUser.LoginName,
                        Nickname        = dbUser.Nickname,
                        PasswordHash    = dbUser.PasswordHash,
                        CreateTime      = dbUser.CreateTime,
                        Salt            = dbUser.Salt,
                        IsProfileShared = dbUser.IsProfileShared
                    };
                    dbUser.Posts.Select(x => x.Id).ToList().ForEach(user.PostsId.Add);

                    var Avatar = dbUser.Avatars.FirstOrDefault(x => x.UserId == user.Id);
                    if (Avatar is Avatar)
                    {
                        user.ImageAvatarId = Avatar.ImageId;
                    }
                    else
                    {
                        user.ImageAvatarId = null;
                    }
                    usersDTO.Add(user);
                }

                return(usersDTO);
            }
        }
예제 #20
0
 public ActionResult Index(ActionViewModel model)
 {
     try
     {
         var db = new DbEntities();
         db.Actions.Add(new Models.Action()
         {
             Data       = model.data,
             Software   = model.software,
             ActionDate = DateTime.Now
         });
         db.SaveChanges();
         return(Json(new { status = "OK" }));
     }
     catch (Exception)
     {
         return(Json(new { status = "ERROR" }));
     }
 }
        public long SaveAddressMap(AddressInfoModel model, bool bIsNew)
        {
            var address = bIsNew ? new Entities.Address() : DbEntities.Address.Single(e => e.AddressId == model.AddressId);

            var phoneToAdd = new ClientPhone {
                ClientPhoneId = model.PrimaryPhone.PhoneId
            };

            DbEntities.ClientPhone.Attach(phoneToAdd);

            for (var i = address.ClientPhone.Count - 1; i >= 0; i--)
            {
                var phone = address.ClientPhone.ElementAt(i);
                address.ClientPhone.Remove(phone);
            }

            address.ClientPhone.Add(phoneToAdd);

            address.CountryName  = model.Country.Value;
            address.RegionNameA  = model.RegionA.Value;
            address.RegionNameB  = model.RegionB.Value;
            address.RegionNameC  = model.RegionC.Value;
            address.RegionNameD  = model.RegionD.Value;
            address.ZipCodeValue = model.ZipCode.Value;

            address.PlaceId = model.PlaceId;
            address.Lat     = model.Lat;
            address.Lng     = model.Lng;

            address.ExtIntNumber = model.ExtIntNumber;
            address.MainAddress  = model.MainAddress;
            address.Reference    = model.Reference;
            address.IsMap        = true;

            if (bIsNew)
            {
                DbEntities.Address.Add(address);
            }
            DbEntities.SaveChanges();

            return(address.AddressId);
        }
예제 #22
0
        public ActionResult Reviews(string id, string a, string reason)
        {
            var model = new List <Review>();

            //show list
            using (HlidacStatu.Lib.Data.DbEntities db = new DbEntities())
            {
                if (!string.IsNullOrEmpty(id) &&
                    !string.IsNullOrEmpty(a) &&
                    Devmasters.TextUtil.IsNumeric(id)
                    )
                {
                    var iId  = Convert.ToInt32(id);
                    var item = db.Review.FirstOrDefault(m => m.Id == iId);
                    if (item != null)
                    {
                        switch (a.ToLower())
                        {
                        case "accepted":
                            item.Accepted(this.User.Identity.Name);
                            break;

                        case "denied":
                            item.Denied(this.User.Identity.Name, reason);
                            break;

                        default:
                            break;
                        }
                    }
                    return(RedirectToAction("Reviews", "Manage"));
                }
                else
                {
                    model = db.Review.AsNoTracking()
                            .Where(m => m.reviewed == null)
                            .ToList();
                }
            }

            return(View(model));
        }
예제 #23
0
        public ActionResult OutboundTaskDetail(string obtid = "-1")
        {
            if (int.TryParse(obtid, out int id)) 
            {
                //视图模型
                List<OutboundTaskDetailViewModel> model = new List<OutboundTaskDetailViewModel>();

                //出库任务细节列表
                var lists = new DbEntities<OutboundTaskDetail>().SimpleClient.GetList();

                //遍历所有
                foreach (OutboundTaskDetail item in lists)
                {
                    //首先添加不是当前的对象
                    if (item.OutboundTaskDetailID != id) 
                    {
                        model.Add(Formatterr.GetOutboundTaskDetailViewModel(item));
                    }
                }

                //获取当前查看的出库任务细节对象
                OutboundTaskDetail cur = lists.Where(it => it.OutboundTaskDetailID == id).FirstOrDefault();

                if (cur != null) 
                {
                    //不为空,存在该对象
                    //按时间排序
                    var temp = model.OrderBy(it => it.ChangeTime).ToList();
                    temp.Add(Formatterr.GetOutboundTaskDetailViewModel(cur));

                    //反转
                    temp.Reverse();
                    return View(temp);
                }

                model.Reverse();
                return View(model);
            }

            TempData["Msg"] = "没有找到对象";
            return RedirectToAction("OutboundTask", "Warehouse");
        }
예제 #24
0
        public ActionResult EditCar(int id)
        {
            TempData.Keep();

            using (DbEntities entity = new DbEntities())
            {
                var Result = (from c in entity.Cars
                              where c.Car_Id == id
                              select c).SingleOrDefault <Car>();

                CarDto cmodel = new CarDto
                {
                    ID             = Result.Car_Id,
                    Registration   = Result.Registration,
                    Model          = Result.Model,
                    Brand          = Result.brand,
                    Description    = Result.Description,
                    SeatsNumber    = Result.SeatNumber,
                    Image          = Result.Image,
                    CarCategory_Id = Result.Category_Id,
                    CarStatus_Id   = Result.CarStatus_Id,
                };
                List <Car_Category> catList    = new List <Car_Category>();
                List <Car_Status>   statusList = new List <Car_Status>();
                using (DbEntities entities = new DbEntities())
                {
                    catList = (from l in entities.Car_Category
                               select l).ToList <Car_Category>();
                }
                using (DbEntities entities = new DbEntities())
                {
                    statusList = (from s in entities.Car_Status
                                  select s).ToList <Car_Status>();
                }
                TempData.Clear();
                ViewData["Department"] = new SelectList(catList, "CarCategory_Id", "CarCategory_Name", $"{cmodel.CarCategory_Id}");
                ViewData["Status"]     = new SelectList(statusList, "CarStatus_Id", "CarStatus_Name", $"{ cmodel.CarStatus_Id }");


                return(View(cmodel));
            }
        }
예제 #25
0
        public static void DefaultTemplate(DbEntities db)
        {
            var user = db.User.Local.Where(r => r.Name.Contains("System Admin")).FirstOrDefault() ?? db.User.Where(r => r.Name.Contains("System Admin")).FirstOrDefault();

            foreach (NotificationType notifyType in Enum.GetValues(typeof(NotificationType)))
            {
                var tempSLA = db.SLAReminder.Where(s => s.NotificationType == notifyType).FirstOrDefault();

                NotificationCategory tempCategory = (int)0;

                if (tempSLA != null)
                {
                    tempCategory = tempSLA.NotificationCategory;
                }

                var template = db.NotificationTemplates.Local.Where(r => r.NotificationType == notifyType).FirstOrDefault() ?? db.NotificationTemplates.Where(r => r.NotificationType == notifyType).FirstOrDefault();

                if (template == null)
                {
                    db.NotificationTemplates.Add(
                        new NotificationTemplate
                    {
                        NotificationType     = notifyType,
                        NotificationCategory = tempCategory,
                        TemplateName         = notifyType.DisplayName(),
                        TemplateRefNo        = "T" + ((int)notifyType).ToString(),
                        enableEmail          = true,
                        TemplateSubject      = "Subject: " + notifyType.DisplayName(),
                        TemplateMessage      = "Email Body Template",
                        enableSMSMessage     = true,
                        SMSMessage           = "SMS Message Template",
                        enableWebMessage     = true,
                        WebMessage           = "Web Message Template",
                        WebNotifyLink        = "",
                        CreatedDate          = DateTime.Now,
                        CreatedBy            = user.Id,
                        User    = user,
                        Display = true
                    });
                }
            }
        }
예제 #26
0
        public static void VerificarSequencial(System.Data.Entity.Infrastructure.DbEntityEntry entityEntry)
        {
            DbEntities contextoSequencial = new DbEntities();
            string     nomeTipo           = entityEntry.Entity.GetType().Name;
            Sequencial ultimo             = contextoSequencial.Sequenciais.Where(s => s.Entidade == nomeTipo).SingleOrDefault();

            if (ultimo == null)
            {
                ultimo = new Sequencial()
                {
                    Entidade = entityEntry.Entity.GetType().Name, ProximoSequencial = 0
                };
                contextoSequencial.Sequenciais.Add(ultimo);
            }

            ultimo.ProximoSequencial       += 1;
            entityEntry.CurrentValues["Id"] = ultimo.ProximoSequencial;
            //entityEntry.Entity.GetType().GetProperty("Id").SetValue(entityEntry.Entity, ultimo.ProximoSequencial, null);
            contextoSequencial.SaveChanges();
        }
예제 #27
0
 /// <summary>
 /// Checks wether the table x has column x
 /// </summary>
 /// <param name="columnName">The column you want to check on</param>
 /// <param name="table">The table you want to check on</param>
 /// <returns></returns>
 private static bool HasColumn(string columnName, string table)
 {
     using (DbEntities db = new DbEntities())
     {
         try
         {
             var t = db.Database.SqlQuery <object>("SELECT " + columnName + " FROM " + table).ToList();
             db.Dispose();
             return(true);
         }
         catch (SQLiteException)
         {
             db.Dispose();
             //if (ex.Message.ToLower().Contains("no such column"))
             //{
             return(false);
             //}
         }
     }
 }
예제 #28
0
		public PersonPrint(DbEntities.dbserver3.wordup.rows.PersonZuTermin ConnectorDaten)
			{
			ID = ConnectorDaten.Person.Id.ToString();
			Sex = ConnectorDaten.Person.Sex;
			NameID = ConnectorDaten.Person.NameId;
			VorName = ConnectorDaten.Person.VorName;
			FamilienName = ConnectorDaten.Person.FamilienName;
			Telefon = ConnectorDaten.Person.Telefon;
			eMail = ConnectorDaten.Person.EMail;
			if (ConnectorDaten.PersonenTypId != null)
				TypNameID = ConnectorDaten.Typ.TypNameId;
			else
				TypNameID = ConnectorDaten.Typ.TypNameId;
			Gruppe = ConnectorDaten.Typ.Gruppe;
			ZusatzInformation = ConnectorDaten.Person.ZusatzInformation;
			Interessen = ConnectorDaten.Person.Interessen;
//			ArbeitsGruppenName = ConnectorDaten.ArbeitsGruppe.LangName;
			//if (ConnectorDaten.Table.Columns["PersonenInDerAGTyp"] != null)
			//	PersonenInDerAGTyp = ConnectorDaten["PersonenInDerAGTyp"].ToString();
			}
예제 #29
0
        public ActionResult Login(User user)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", user));
            }
            DbEntities db       = new DbEntities();
            var        userInfo = db.User.FirstOrDefault(s => s.Name == user.Name);

            if (userInfo != null && userInfo.Pwd == user.Pwd)
            {
                FormsAuthentication.SetAuthCookie(userInfo.Name, false);
                return(RedirectToAction("Index", "Order"));
            }
            else
            {
                ModelState.AddModelError("", "无效的登录尝试。检查用户名和密码");
            }
            return(View("Index", user));
        }
예제 #30
0
        public void UpdateSyncOkFile(SyncFileModel syncFile)
        {
            DbEntities.Configuration.ValidateOnSaveEnabled = false;
            var model = new FranchiseDataFile {
                FranchiseDataFileId = syncFile.FranchiseDataFileId, IsSync = true
            };

            DbEntities.FranchiseDataFile.Attach(model);
            DbEntities.Entry(model).Property(e => e.IsSync).IsModified = true;
            DbEntities.SaveChanges();

            var countSyncFiles = DbEntities.FranchiseDataFile.Count(e => e.FranchiseDataVersionId == syncFile.FranchiseDataVersionId && e.IsSync);
            var countModel     = new FranchiseDataVersion {
                FranchiseDataVersionId = syncFile.FranchiseDataVersionId, NumberOfFilesDownloaded = countSyncFiles
            };

            DbEntities.FranchiseDataVersion.Attach(countModel);
            DbEntities.Entry(countModel).Property(e => e.NumberOfFilesDownloaded).IsModified = true;
            DbEntities.SaveChanges();
        }
예제 #31
0
        private static List <int> ObtemIdTestData(int id_datapool)
        {
            #region Debug
            // Instancia a Entity
            #endregion

            DbEntities db = new DbEntities();

            #region Debug
            // Query para buscar o id do TestData,passando o id do Datapool que será executado.
            #endregion

            var tdQuery =
                (from td1 in db.TestData
                 join dtp in db.DataPool on td1.IdDataPool equals dtp.Id
                 where dtp.Id == id_datapool && td1.IdStatus == 1
                 select td1.Id).ToList();

            return(tdQuery);
        }
예제 #32
0
        public List <Modelos.PersonaDgv> MostrarTodos()
        {
            DbEntities db = new DbEntities();
            //var lista = (from p in db.Personas.Include("Pais")
            //             select p).ToList();
            List <Modelos.PersonaDgv> lista = (from p in db.Personas
                                               join pa in db.Paises
                                               on p.Id_Pais equals pa.Id
                                               select new PersonaDgv
            {
                Id = p.Id,
                Nombre = p.Nombre,
                Fecha_Nacimiento = p.Fecha_Nacimiento,
                Id_Pais = p.Id_Pais,
                Credito_Maximo = p.Credito_Maximo,
                Descripcion = pa.Descripcion
            }).ToList();

            return(lista);
        }
예제 #33
0
        /// <summary>
        /// 创建一对多关联
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TJoin"></typeparam>
        /// <param name="expression"></param>
        /// <returns></returns>
        protected DbEntities<TJoin> IncludeMany<T, TJoin>(Expression<Func<T, TJoin,bool>> expression) where T : IModel, new()
            where TJoin : IModel, new()
        {
            var type = typeof(TJoin);
            var name = $"ents_{type}_{TypeCache.GetpPrimaryKeyValue(this)}";
            var a = DbContext._DbSets.TryGetValue(name, out IDbSet set2);
            if (a)
            {
                return set2 as DbEntities<TJoin>;
            }
            if (FromCache)//当是缓存时
            {
                throw new Exception("缓存对象不能调用");
            }
            var _relationExp = CreaterelationExp(expression);

            var set = new DbEntities<TJoin>(name, DbContext, _relationExp);
            //DbContext._DbSets.Add(name, set);
            return set;
        }
예제 #34
0
        public HttpResponseMessage UpdateEmployeeLoginDetails(UserModel user)
        {
            using (DbEntities entities = new DbEntities())
            {
                var userResult = (from u in entities.Users
                                  where u.users_no == user.ID
                                  select u).FirstOrDefault();
                if (userResult != null)
                {
                    userResult.users_password = user.Password;
                    entities.SaveChanges();

                    return(Request.CreateResponse(HttpStatusCode.OK, user));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotModified, "Could Not Update Password. Please Contact Administrator"));
                }
            }
        }
예제 #35
0
        public IHttpActionResult AddAttachmentToDisccusion(int pid, int aid)
        {
            if (aid > 0)
            {
                using (DbEntities _db = new DbEntities())
                {
                    DiscussionAttachment _attachment = new DiscussionAttachment()
                    {
                        AttachmentId = aid,
                        PostId       = pid,
                    };

                    _db.DiscussionAttachment.Add(_attachment);
                    _db.SaveChanges();

                    return(Ok(true));
                }
            }
            return(NotFound());
        }
예제 #36
0
		public PersonPrint (DbEntities.dbserver3.wordup.rows.PersonZuWordUpID ConnectorDaten )
			{
			this.ConnectorDaten = ConnectorDaten;
            ID = ConnectorDaten.Person.Id.ToString();
			Sex = ConnectorDaten.Person.Sex;
			NameID = ConnectorDaten.Person.NameId;
			VorName = ConnectorDaten.Person.VorName;
			FamilienName = ConnectorDaten.Person.FamilienName;
			Telefon = ConnectorDaten.Person.Telefon;
			eMail = ConnectorDaten.Person.EMail;
			if (ConnectorDaten.PersonenTypId != null)
				TypNameID = ConnectorDaten.Typ.TypNameId;
			else
				TypNameID = ConnectorDaten.Typ.TypNameId;
			Gruppe = ConnectorDaten.Typ.Gruppe;
			ZusatzInformation = ConnectorDaten.Person.ZusatzInformation;
			Interessen = ConnectorDaten.Person.Interessen;
			CodeName = ConnectorDaten.Organisation.CodeName;
			PLZ = ConnectorDaten.Person.PLZ;
			Ort = ConnectorDaten.Person.Ort;
			Adresse = ConnectorDaten.Person.Adresse;
			//if (ConnectorDaten.Table.Columns["PersonenInDerAGTyp"] != null)
			//	PersonenInDerAGTyp = ConnectorDaten["PersonenInDerAGTyp"].ToString();
			}
예제 #37
0
        public List<Object> CreateTreeForOrtePictures(DbEntities.dbserver3.wordup.rows.Projekt ProjectEntry)
            {
            List<Object> PicturesToPrint = new List<Object>();
            PicturesToPrint.Add(new HeadLinePrint(ProjectEntry.Ort.Bezeichnung, "Main")
                {
                PageBreakBeforeRequested = false,
                AdditionalTopDistance = 8,
                AdditionalBottomDistance = 5
                });
			List<PictureContainerList> PictureContainerLists
				= PictureContainerList.PrepareData
						(Data.DbServer3, ProjectEntry, ProjectEntry.Ort, true, true);
	        foreach (PictureContainerList pictureContainerList in PictureContainerLists)
		        {
		        if (pictureContainerList.ForeignKeyConnectoren.Count == 0)
			        continue;
		        if ((pictureContainerList.MaterialienTyp == MaterialienTypen.Ort)
		            || (pictureContainerList.MaterialienTyp == MaterialienTypen.OrtsBild))
			        continue;
		        foreach (MaterialJPGForeignKeyConnector materialJPGForeignKeyConnector in pictureContainerList.ForeignKeyConnectoren)
			        {
					PicturesToPrint.Add(new VerticalStackedPicturePrint(materialJPGForeignKeyConnector)
						{ PageBreakAllowedBefore = true });

					}
				}
			foreach (PictureContainerList pictureContainerList in PictureContainerLists)
				{
				if (pictureContainerList.ForeignKeyConnectoren.Count == 0)
					continue;
				if ((pictureContainerList.MaterialienTyp != MaterialienTypen.Ort)
					&& (pictureContainerList.MaterialienTyp != MaterialienTypen.OrtsBild))
					continue;
				int Index = 0;
				int Columns = 5;
				while (Index < pictureContainerList.ForeignKeyConnectoren.Count)
					{
					foreach (MaterialJPGForeignKeyConnector materialJPGForeignKeyConnector 
						in pictureContainerList.ForeignKeyConnectoren)
						{
						PicturesToPrint.Add(new HorizontalStackedPicturePrint
                                (pictureContainerList, Index, Columns)
							{ PageBreakAllowedBefore = true, Height = 100});
							Index += Columns;
							}
						}
					}
			/*
            if ((MainPictureFiles.Count > 0)
                || (CommonPictureFiles.Count > 0))
                {
                List<String> EntriesToDelete = new List<String>();
                foreach (String PictureName in MainPictureFiles)
                    {
                    if (PictureName.IndexOf(WMB.Basics.THUMB_NAIL_PREFIX) != -1)
                        EntriesToDelete.Add(PictureName);
                    }
                foreach (String PictureNameToDelete in EntriesToDelete)
                    MainPictureFiles.Remove(PictureNameToDelete);
                EntriesToDelete.Clear();

                MainPictureFiles.Sort();

                foreach (String PictureName in CommonPictureFiles)
                    {
                    if ((PictureName.IndexOf("LuftBild.jpg") != -1)
                        || (PictureName.IndexOf("LagePlan.jpg") != -1)
                        || (PictureName.IndexOf("UeberBlick.jpg") != -1))
                        EntriesToDelete.Add(PictureName);
                    }
                foreach (String PictureNameToDelete in EntriesToDelete)
                    CommonPictureFiles.Remove(PictureNameToDelete);
                CommonPictureFiles.Sort();
                foreach (String MainPictureName in MainPictureFiles)
                    {
                    PicturesToPrint.Add(new VerticalStackedPicturePrint(MainPictureName) {PageBreakAllowedBefore = true});
                    }
                int Index = 0;
                int Columns = 5;
                while (Index < CommonPictureFiles.Count)
                    {
                    PicturesToPrint.Add(new HorizontalStackedPicturePrint(CommonPictureFiles, Index, Columns)
                        {PageBreakAllowedBefore = true, Height = 100});
                    Index += Columns;
                    }
                }
				*/
			return PicturesToPrint;
            }
예제 #38
0
파일: PrintOut.cs 프로젝트: heinzsack/DEV
	    private String GruenGelbRotVerteilung(DbEntities.dbserver3.wordup.rows.Projekt[] projekteToProcess)
		    {
			List<String> result = new List<string>();
			Dictionary<AktivitaetsTyp.AmpelTyp,int> AmpelDistribution 
				= new Dictionary<AktivitaetsTyp.AmpelTyp, int>();
			AmpelDistribution[AktivitaetsTyp.AmpelTyp.Green] = 0;
			AmpelDistribution[AktivitaetsTyp.AmpelTyp.Yellow] = 0;
			AmpelDistribution[AktivitaetsTyp.AmpelTyp.Red] = 0;
			AmpelDistribution[AktivitaetsTyp.AmpelTyp.NoAction] = 0;

			int unTyped = 0;
			foreach (DbEntities.dbserver3.wordup.rows.Projekt projekt in projekteToProcess)
			    {
			    AktivitaetsTyp.AmpelTyp? typOfProjekt = projekt.AmpelTypForThisProjekt;
			    if (typOfProjekt == null)
				    {
				    unTyped++;
				    continue;
				    }
			    AmpelDistribution[(AktivitaetsTyp.AmpelTyp) typOfProjekt]++;
			    }


			result.Add($"Grün {AmpelDistribution[AktivitaetsTyp.AmpelTyp.Green]}");
			result.Add($"Gelb {AmpelDistribution[AktivitaetsTyp.AmpelTyp.Yellow]}");
			result.Add($"Rot {AmpelDistribution[AktivitaetsTyp.AmpelTyp.Red]}");
			result.Add($"Fremd {AmpelDistribution[AktivitaetsTyp.AmpelTyp.NoAction]}");
			result.Add($"-- {unTyped}");
			return String.Join(", ", result);
		    }
예제 #39
0
파일: PrintOut.cs 프로젝트: heinzsack/DEV
	        private List<Object> CreateZustaendigForProjekte(DbEntities.dbserver3.wordup.rows.Projekt[] projekteToCount)
		        {
		        List<Object> CollectionOfClassesToPrint = new List<object>();
				Dictionary<Zustaendigkeit, int> ZuständigkeitenVerteilung = new Dictionary<Zustaendigkeit, int>();
				foreach (DbEntities.dbserver3.wordup.rows.Projekt projekt in projekteToCount)
					{
					if (!ZuständigkeitenVerteilung.Keys.Contains(projekt.Zustaendigkeit))
						ZuständigkeitenVerteilung[projekt.Zustaendigkeit] = 0;
					ZuständigkeitenVerteilung[projekt.Zustaendigkeit]++;
					}
				List<String> numbers = new List<string>();
		        bool first = true;
				foreach (Zustaendigkeit zust in ZuständigkeitenVerteilung.Keys.OrderBy(ord => ord.NameId))
					{
					if (first)
						{
						decimal Prozente = Math.Round((decimal)((ZuständigkeitenVerteilung[zust]*100)/projekteToCount.Length), 2);
						numbers.Add($"{zust.NameId} = {ZuständigkeitenVerteilung[zust]} ({Prozente}%)");
						}
					else
						numbers.Add($"{zust.NameId} = {ZuständigkeitenVerteilung[zust]}");
					first = false;
					}
				String printLine = String.Join("; ", numbers);
				CollectionOfClassesToPrint.Add(new HeadLinePrint($"{printLine}", "SubSubSub"));
				return CollectionOfClassesToPrint;

		        }
예제 #40
0
		private static void DebugLoop(DbEntities.dbserver3.multimedia.rows.Page page, int level)
			{
			String indentation = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t";
			Debug.WriteLine($"{indentation.Substring(0, level + 2)} P {level}: {page.SortOrder} {page.DiagnosticText}");
			foreach (IBaseVisual baseVisual in page.IChildren.Where(whe => whe.GetType() != typeof(Page)))
				{
				if (baseVisual.GetType() == typeof(Text))
					{
					Debug.WriteLine($"{indentation.Substring(0, level + 3)} T {(baseVisual as Text).DiagnosticText}: {(baseVisual as Text).TextColumn}");
					continue;
					}
				if (baseVisual.GetType() == typeof(Link))
					{
					Debug.WriteLine($"{indentation.Substring(0, level + 3)} L {(baseVisual as Link).DiagnosticText}: {(baseVisual as Link).LinkColumn}");
					continue;
					}
				if (baseVisual.GetType() == typeof(Image))
					{
					Debug.WriteLine($"{indentation.Substring(0, level + 3)} I {(baseVisual as Image).DiagnosticText}: {(baseVisual as Image).Extension}");
					continue;
					}
				if (baseVisual.GetType() == typeof(Video))
					{
					continue;
					}
				}
			foreach (Page childPage
					in page.ChildPages.OrderBy(ord => ord.SortOrder))
				{
				DebugLoop(childPage, level + 1);
				}
			}
예제 #41
0
		private void CreateImageElement(DbEntities.dbserver3.multimedia.rows.Image imageBase,
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedParentPage)
			{
			Image newImage = TargetPlayerDb.Images.NewRow();
			newImage.Id = imageBase.Id;
			newImage.Page = convertedParentPage;
			newImage.ImageId = imageBase.ImageId;
			newImage.FileIdentifier = imageBase.ImageId;
			newImage.Background = imageBase.Background;
			newImage.BorderColor = imageBase.BorderColor;
			newImage.SortOrder = imageBase.SortOrder;
			newImage.Extension = imageBase.Extension;
			newImage.Rotation = imageBase.Rotation;
			newImage.Background = imageBase.Background;
			newImage.BorderColor = imageBase.BorderColor;
			newImage.BorderThickness = imageBase.BorderThickness;
			newImage.MarginThickness = imageBase.MarginThickness;
			newImage.Rotation = imageBase.Rotation;

			newImage.Table.Rows.Add(newImage);
			}
예제 #42
0
		public ProjektPrint(DbEntities.dbserver3.wordup.rows.Projekt projektDaten)
			: base(projektDaten)
			{
			}
예제 #43
0
		public RealisierungPrint(DbEntities.dbserver3.wordup.rows.Projekt projektDaten)
			: base(projektDaten)
			{
			}
예제 #44
0
 public void AddUsedEntry(DbEntities.dbserver3.wordup.rows.Projekt ProjektUsed)
 {
     UsedEntries.Add(new AccessedInThisRun() { LastAccessTime = DateTime.Now, AccessedProjekt = ProjektUsed });
     SendPropertyChanged("UsedEntries");
 }
예제 #45
0
        string GetModuleName(object addIn)
        {
            string guid = string.Empty;
            if (addIn is IAddIn)
            {
                guid = ((IAddIn)addIn).Guid.ToString();
            }
            else
            {
                guid = MetaHelper.GetModuleGuid(addIn.GetType());
            }

            Module module = XContext.ModuleList.Where(p => p.Guid == guid).FirstOrDefault();
            if (module == null)
            {
                using (DbEntities db = new DbEntities())
                {
                    module = db.Modules.Where(p => p.Guid == guid.ToUpper()).FirstOrDefault();
                }
            }

            if (module != null)
            {
                return module.Name;
            }
            else
            {
                return ModuleManager.GetModuleName(addIn);
            }
        }
예제 #46
0
		public IdeePrintTight(DbEntities.dbserver3.wordup.rows.WSPlakat WSPlakateEntry)
			{
			ShowWMUDetail = false;
			WsPlakat = WSPlakateEntry;
			}
예제 #47
0
		private void CreatePlayerSubPage(DbEntities.dbserver3.multimedia.rows.Page sourcePage,
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedSourceParent)
			{
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedSourcePage
				= TargetPlayerDb.Pages.NewRow();
			convertedSourcePage.Id = Guid.NewGuid();
			convertedSourcePage.DiagnosticText = $"child von {sourcePage.DiagnosticText}";
			convertedSourcePage.ExpectedDuration = 0;
			convertedSourcePage.PageGroup = TargetPageGroup;
			convertedSourcePage.ParentPage = convertedSourceParent;
			convertedSourcePage.SortOrder = (int)sourcePage.SortOrder;
			convertedSourcePage.BorderColor = sourcePage.BorderColor;
			convertedSourcePage.Background = sourcePage.Background;
			convertedSourcePage.BorderThickness = sourcePage.BorderThickness;
			convertedSourcePage.MarginThickness = sourcePage.MarginThickness;
			convertedSourcePage.HasFixedRatio = false;
			convertedSourcePage.RatioX = sourcePage.RatioX;
			convertedSourcePage.RatioY = sourcePage.RatioY;
			convertedSourcePage.Table.Rows.Add(convertedSourcePage);
			CreateAllChildElements(sourcePage, convertedSourcePage);
			}
예제 #48
0
		public ProjektPrintRoot(DbEntities.dbserver3.wordup.rows.Projekt projektDaten)
			{
			ProjektDaten = projektDaten;
			PageBreakAllowedBefore = true;
			ID = projektDaten.Id.ToString();
			ProjektBeschreibung = projektDaten.Beschreibung;
			NumericProjektID = projektDaten.NumericProjektId;
			OrtsNameID = projektDaten.Ort?.NameId;
			Zustaendig = projektDaten.Zustaendigkeit?.NameId;
			ProjektTyp = projektDaten.Typ?.TypNameId;
			Wertigkeit = Convert.ToString(projektDaten.Wertigkeit);
			ArbeitsGruppenNameID = projektDaten.Ort?.OrtsTeil?.AktuallArbeitsGruppe?.NameId;
			OrtsTeil = projektDaten.Ort?.OrtsTeil?.NameId;
			ImPlenumsFilm = projektDaten.ImPlenumsFilm;
			ImFilm = projektDaten.ImFilm;
			if (projektDaten.SummeW != null)
				SummeW = projektDaten.SummeW.Value;
			else
				SummeW = 0;
			if (projektDaten.SummeM != null)
				SummeM = projektDaten.SummeM.Value;
			else
				SummeM = 0;
			if (projektDaten.SummeU != null)
				SummeU = projektDaten.SummeU.Value;
			else
				SummeU = 0;
			}
예제 #49
0
		private void CreateTextElement(DbEntities.dbserver3.multimedia.rows.Text textBase,
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedParentPage)
			{
			Text newText = TargetPlayerDb.Texts.NewRow();
			newText.Id = textBase.Id;
			newText.Page = convertedParentPage;
			newText.TextColumn = textBase.TextColumn;

			newText.Background = textBase.Background;
			newText.BorderColor = textBase.BorderColor;
			newText.SortOrder = textBase.SortOrder;
			newText.TextColumn = textBase.TextColumn;
			newText.FontFamily = textBase.FontFamily;
			newText.FontWeight = textBase.FontWeight;
			newText.FontStyle = textBase.FontStyle;
			newText.Foreground = textBase.Foreground;
			newText.Background = textBase.Background;
			newText.BorderColor = textBase.BorderColor;
			newText.BorderThickness = textBase.BorderThickness;
			newText.MarginThickness = textBase.MarginThickness;
			newText.Rotation = textBase.Rotation;

			newText.Table.Rows.Add(newText);
			}
예제 #50
0
파일: PrintOut.cs 프로젝트: heinzsack/DEV
        public String CreateMultiProjectProjectFolder(DbEntities.dbserver3.wordup.rows.Projekt[] ProjectsToCreate,
            String TargetDirectory, String Description, String FileNameElement = "")
            {
            //String ProjectFolderBaseDirectory = Basics.Instance.ProjektMaterialDirectory;
            //String OrteFolderBaseDirectory = Basics.Instance.OrtsMaterialDirectory;
            String FileName = String.Empty;
            if (String.IsNullOrEmpty(FileNameElement))
                FileName = Path.Combine(TargetDirectory,
                    "ProjektMappe_" + DateTime.Now.ToString("yyyy-MMM-dd_HH_mm") + ".pdf");
            else
                FileName = Path.Combine(TargetDirectory,
                    WMB.Basics.ConvertToCorrectFileNameElement(FileNameElement) + ".pdf");
	        Guid OldOrteID = Guid.Empty;
            List<Object> ResultetObjectsToPrint = new List<Object>();

			foreach (DbEntities.dbserver3.wordup.rows.Projekt projectEntry in ProjectsToCreate)
                {
                PlanungPrint planungPrint = new PlanungPrint(projectEntry)
					{
					PageBreakAllowedBefore = true
					};
				ResultetObjectsToPrint.Add(planungPrint);
				planungPrint.MaximalWMUValue = Data.DbServer3.WordUp.Projekte.WMUDistribution.Keys.Max();
				planungPrint.MaximalWSPLakateValue = Data.DbServer3.WordUp.Projekte.WSPlakateDistribution.Keys.Max();
				planungPrint.MaximalWertigkeitValue = Data.DbServer3.WordUp.Projekte.WertigkeitValueDistribution.Keys.Max();
				ResultetObjectsToPrint.Add(new HeadLinePrint("Bemerkungen:", "SubSubSub"));
				foreach (Aktivitaet aktivitaet in projectEntry.Aktivitaeten)
	                {
					ResultetObjectsToPrint.Add(new AktivitaetenPrint(aktivitaet)
						{
						
						});
					}
				ResultetObjectsToPrint.Add(new HeadLinePrint("Ideen", "SubSubSub"));
				foreach (WSPlakat wsPlakat in projectEntry.WSPlakate)
	                {
					ResultetObjectsToPrint.Add(new IdeePrint(wsPlakat)
						{}
					);
                    }
                foreach (ProjektZuTermin projektZuTermin in Data.DbServer3.WordUp.ProjekteZuTerminen.Find_By_ProjekteId(projectEntry.Id) )
	                {
					TerminPrint TerminRoot = new TerminPrint(projektZuTermin.Termin);
					ResultetObjectsToPrint.Add(TerminRoot);
					bool firstTeam = true;
					bool firstVertreter = true;
					foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
						.FindOrLoad_ActivePersonenZuTerminen(projektZuTermin.Termin.Id)
						.Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForBetreuer.Contains((Guid)sel.PersonenTypId)))
						{
						if (firstTeam)
							{
							ResultetObjectsToPrint.Add(new HeadLinePrint("Betreuer", "Sub")
								{ PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0) });
							firstTeam = false;
							}
						TeamPersonPrint TeamPerson = new TeamPersonPrint(PersonZuTerminEntry);
						TeamPerson.BorderPadding = new Thickness(40, 0, 0, 0);

						ResultetObjectsToPrint.Add(TeamPerson);
						}
					foreach (PersonZuTermin PersonZuTerminEntry in Data.DbServer3.WordUp.PersonenZuTerminen
						.FindOrLoad_ActivePersonenZuTerminen(projektZuTermin.Termin.Id)
						.Where(sel => Data.DbServer3.WordUp.Typen.AllTypIDsForVertreter.Contains((Guid)sel.PersonenTypId)))
						{
						if (firstVertreter)
							{
							ResultetObjectsToPrint.Add(new HeadLinePrint("VertreterInnen", "Sub")
								{ PageBreakAllowedBefore = true, BorderPadding = new Thickness(40, 10, 0, 0) });
							firstVertreter = false;
							}
						VertreterPersonPrint VertreterPerson = new VertreterPersonPrint(PersonZuTerminEntry);
						VertreterPerson.BorderPadding = new Thickness(40, 0, 0, 0);
						ResultetObjectsToPrint.Add(VertreterPerson);

						}


					}
				if (projectEntry.Ort.Id != OldOrteID)
                    {
                    OldOrteID = projectEntry.Ort.Id;
                    ResultetObjectsToPrint.AddRange(DataWrapper.Instance.CreateTreeForOrtePictures
                        (projectEntry));
                    }

                }

            XAMLPrintoutDefinitions.PrintFileCards PicturePrintHandler = new XAMLPrintoutDefinitions.PrintFileCards();
            return PicturePrintHandler.PrintProjektMapData(ResultetObjectsToPrint, FileName, Description);
            }
예제 #51
0
		private void CreateVideoElement(DbEntities.dbserver3.multimedia.rows.Video videoBase,
			HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedParentPage)
			{
			Video newVideo = TargetPlayerDb.Videos.NewRow();
			newVideo.Id = videoBase.Id;
			newVideo.Page = convertedParentPage;
			newVideo.VideoId = videoBase.VideoId;
			newVideo.FileIdentifier = videoBase.VideoId;

			newVideo.Background = videoBase.Background;
			newVideo.BorderColor = videoBase.BorderColor;
			newVideo.SortOrder = videoBase.SortOrder;
			newVideo.Extension = videoBase.Extension;
			newVideo.Rotation = videoBase.Rotation;
			newVideo.Background = videoBase.Background;
			newVideo.BorderColor = videoBase.BorderColor;
			newVideo.BorderThickness = videoBase.BorderThickness;
			newVideo.MarginThickness = videoBase.MarginThickness;
			newVideo.Rotation = videoBase.Rotation;

			newVideo.Table.Add(newVideo);
			}
예제 #52
0
        public void CreateAllForOneProjectToPrint(Basics.DataSelection Phase, List<Object> CollectionOfClassesToPrint,
            DbEntities.dbserver3.wordup.rows.Projekt ProjektToUse, ref bool FirstProjekt,
            bool WithOrWithoutPlakate = false, bool WithOrWithoutActivities = false,
            bool WithOrWithoutTermine = false, bool WithOrWithoutProjektUebersicht = false,
            String SecurityGroup = "ProfisFull")
	        {
	        ProjektPrintRoot RootProjektObject = null;
	        switch (Phase)
		        {
				case Basics.DataSelection.Wuensche:
					RootProjektObject = new WunschPrint(ProjektToUse);
					break;
				case Basics.DataSelection.Planungen:
					RootProjektObject = new PlanungPrint(ProjektToUse);
					break;
				case Basics.DataSelection.Projekte:
					RootProjektObject = new ProjektPrint(ProjektToUse);
					break;
				case Basics.DataSelection.Realisierungen:
					RootProjektObject = new RealisierungPrint(ProjektToUse);
					break;
				case Basics.DataSelection.Fertig:
					RootProjektObject = new FertigPrint(ProjektToUse);
					break;
				}

			RootProjektObject.MaximalWMUValue = Data.DbServer3.WordUp.Projekte.WMUDistribution.Keys.Max();
			RootProjektObject.MaximalWSPLakateValue = Data.DbServer3.WordUp.Projekte.WSPlakateDistribution.Keys.Max();
			RootProjektObject.MaximalWertigkeitValue = Data.DbServer3.WordUp.Projekte.WertigkeitValueDistribution.Keys.Max();

			if (FirstProjekt)
                {
                FirstProjekt = false;
                }
            else
                {
				RootProjektObject.PageBreakAllowedBefore = true;
                }
			RootProjektObject.BorderPadding = new Thickness(40, 10, 0, 0);
            CollectionOfClassesToPrint.Add(RootProjektObject);
            if (WithOrWithoutActivities)
                {
                bool FirstAktivitaet = true;
                foreach (Aktivitaet AktivitaetenEntry in Data.DbServer3.WordUp.Aktivitaeten.Collection
                    .Where(Entry => Entry.ProjektId == ProjektToUse.Id).OrderByDescending(ord => ord.CreationDateTime))
                    {
                    if (FirstAktivitaet)
                        {
                        CollectionOfClassesToPrint.Add(new HeadLinePrint("Bemerkungen:", "SubSubSub"));
                        FirstAktivitaet = false;
                        }
                    AktivitaetenPrint RootAktivitaetenPrint = new AktivitaetenPrint(AktivitaetenEntry);
					RootProjektObject.Aktivitaeten.Add(RootAktivitaetenPrint);
                    RootAktivitaetenPrint.BorderPadding = new Thickness(80, 0, 0, 0);
                    CollectionOfClassesToPrint.Add(RootAktivitaetenPrint);
                    }
                }
            if (WithOrWithoutPlakate)
                {
                bool FirstIdee = true;
                foreach (WSPlakat PlakatEntry in Data.DbServer3.WordUp.WSPlakate.Collection
                    .Where(Entry => Entry.ProjektId == ProjektToUse.Id))
                    {
                    if (FirstIdee)
                        {
                        CollectionOfClassesToPrint.Add(new HeadLinePrint("Ideen", "SubSubSub"));
                        FirstIdee = false;
                        }
                    IdeePrint RootIdeePrint = new IdeePrint(PlakatEntry)
	                    {
						ShowWMUDetail = true
						};
					RootProjektObject.Ideen.Add(RootIdeePrint);
                    RootIdeePrint.BorderPadding = new Thickness(80, 0, 0, 0);
                    CollectionOfClassesToPrint.Add(RootIdeePrint);
                    }
                }
            if (WithOrWithoutTermine)
                {
                bool FirstTermin = true;
                foreach (
                    Termin TerminEntry in Data.DbServer3.WordUp.Termine.Find_ForSpecificProjektID(ProjektToUse.Id))
                    {
                    if (FirstTermin)
                        {
                        CollectionOfClassesToPrint.Add(new HeadLinePrint("Termine, die eine Verbindung mit dem Projekt "
                                                                         +
																		 RootProjektObject.NumericProjektID.Substring(3) +
                                                                         " haben", "SubSubSub"));
                        FirstTermin = false;
                        }
                    AddOnTerminPrint RootTerminPrint = new AddOnTerminPrint(TerminEntry);
					RootProjektObject.Termine.Add(RootTerminPrint);
                    RootTerminPrint.BorderPadding = new Thickness(80, 0, 0, 0);
                    CollectionOfClassesToPrint.Add(RootTerminPrint);
                    }
                }
            }
예제 #53
0
		private void CreateAllChildElements(DbEntities.dbserver3.multimedia.rows.Page sourcePage,
				HsCentralServiceWebInterfacesServer._dbs.hsserver.ringplayerdb.rows.Page convertedSourcePage)
			{ 
			foreach (DbEntities.CustomClasses.PlayerInterfaces.IBaseVisual baseVisual
						in sourcePage.IChildren.OrderBy(ord => ord.ISortOrder))
				{
				if (baseVisual.GetType() == typeof(DbEntities.dbserver3.multimedia.rows.Page))
					{
					CreatePlayerSubPage(baseVisual as DbEntities.dbserver3.multimedia.rows.Page, convertedSourcePage);
					}
				else if (baseVisual.GetType() == typeof(DbEntities.dbserver3.multimedia.rows.Text))
					{
					CreateTextElement(baseVisual as DbEntities.dbserver3.multimedia.rows.Text, convertedSourcePage);
					}
				else if (baseVisual.GetType() == typeof(DbEntities.dbserver3.multimedia.rows.Image))
					{
					CreateImageElement(baseVisual as DbEntities.dbserver3.multimedia.rows.Image, convertedSourcePage);
					}
				else if (baseVisual.GetType() == typeof(DbEntities.dbserver3.multimedia.rows.Video))
					{
					CreateVideoElement(baseVisual as DbEntities.dbserver3.multimedia.rows.Video, convertedSourcePage);
					}
				else
					{
					throw new Exception($"Illegal Typ ({baseVisual.GetType()}) as pageChildren ");
					}
				}
			}
예제 #54
0
		public VertreterPersonPrint (DbEntities.dbserver3.wordup.rows.PersonZuWordUpID connectorDaten)
			: base(connectorDaten)
			{
			}
예제 #55
0
        void SetModule(object addIn)
        {
            string guid = string.Empty;
            if (addIn is IAddIn)
            {
                guid = ((IAddIn)addIn).Guid.ToString();
            }
            else
            {
                guid = MetaHelper.GetModuleGuid(addIn.GetType());
            }

            if (addIn is AboutForm)
            {
                this.Icon = (addIn as AboutForm).Icon;
            }
            else if (addIn is LoginForm)
            {
                this.Icon = (addIn as LoginForm).Icon;
            }
            else if (guid.Length > 0)
            {
                Module module = XContext.ModuleList.Where(p => p.Guid == guid).FirstOrDefault();
                if (module == null)
                {
                    using (DbEntities db = new DbEntities())
                    {
                        module = db.Modules.Where(p => p.Guid == guid.ToUpper()).FirstOrDefault();
                    }
                }

                if (module != null)
                {
                    this.Text = module.Name;
                    try
                    {
                        using (System.IO.MemoryStream ms = new System.IO.MemoryStream(module.Icon))
                        {
                            this.Icon = System.Drawing.Image.FromStream(ms).ToIcon();
                        }
                    }
                    catch { }
                }
                else
                {
                    this.Text = ModuleManager.GetModuleName(addIn);
                }
            }
        }
예제 #56
0
		public VertreterPersonPrint(DbEntities.dbserver3.wordup.rows.PersonZuArbeitsGruppe connectorDaten)
			: base(connectorDaten)
			{
			}
예제 #57
0
		private DbEntities.dbserver3.wordup.rows.Ort[] GetOrteToDraw(out DbEntities.dbserver3.wordup.rows.Projekt[] Projekte,
			TypeOfPictureToDraw PictureToDraw)
			{
			DbEntities.dbserver3.wordup.rows.Ort[] Result = new Ort[0];
			Projekte = new Projekt[0];
			switch (PictureToDraw)
				{
					case TypeOfPictureToDraw.AllActuallExistingOrte:
					case TypeOfPictureToDraw.AllActuallWuensche:
						Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte("Wuensche");
						Result = Projekte.Select(sel => sel.Ort).Distinct().OrderBy(ord => ord.Bezeichnung).ToArray();
						break;
					case TypeOfPictureToDraw.AllActuallWuenscheNotFinish:
						Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte("Wuensche")
							.Where(sel => sel.Ort.WLaenge == null).ToArray();
						Result = Projekte.Select(sel => sel.Ort).Distinct().OrderBy(ord => ord.Bezeichnung).ToArray();
						break;
					case TypeOfPictureToDraw.AllActualPlanungen:
						Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte("Planungen");
						Result = Projekte.Select(sel => sel.Ort).Distinct().OrderBy(ord => ord.Bezeichnung).ToArray();
						break;
					case TypeOfPictureToDraw.AllActuallPlanungenNotFinish:
						Projekte = Data.DbServer3.WordUp.Projekte.Find_PhasenCorrectProjekte("Planungen")
							.Where(sel => sel.Ort.WLaenge == null
							              || sel.PPTBilder.Count == 0).ToArray();
						Result = Projekte.Select(sel => sel.Ort).Distinct().OrderBy(ord => ord.Bezeichnung).ToArray();
						break;
				}
			return Result;
			}
		public StadtWienEttikettenPersonPrint(DbEntities.dbserver3.wordup.rows.PersonZuWordUpID connectorDaten)
			: base(connectorDaten)
			{

			}
예제 #59
0
		/*
										private void ConvertToMMUnitsLoop(ButtonData parentButton, Object ParentObject, int level)
											{
											if (!EntriesPerLevel.ContainsKey(level))
												EntriesPerLevel[level] = 0;
											int sortOrder = 0;
											foreach (ButtonData buttonData in allOldButton
														.Where(whe => whe.ParentButton != null
														&& whe.ParentButton == parentButton).OrderBy(ord => ord.Row).ToArray())
												{
												MMUnit RootMMUnit = null;
												DbEntities.dbserver3.multimedia.rows.Page contentPage = null;
												if (level == 0)
													{
													RootMMUnit = Data.DbServer3.MultiMedia.MMUnits.FindOrLoad(buttonData.Id);
													if (RootMMUnit != null)
														{
														RootMMUnit.Delete();
														Data.DbServer3.MultiMedia.SaveKatabolic(new Object());
														Data.DbServer3.MultiMedia.AcceptChanges();
														}
													RootMMUnit = Data.DbServer3.MultiMedia.MMUnits.NewRow();
													RootMMUnit.Id = buttonData.Id;
													if (String.IsNullOrWhiteSpace(buttonData.NameId))
														buttonData.NameId = "Fahrplan";
													RootMMUnit.NameId = buttonData.NameId;
													RootMMUnit.Title = buttonData.Text;
													if (buttonData.EntryType == "Entry")
														RootMMUnit.MMUnitTyp = mmUnitTypForButtonData;
													if (buttonData.EntryType == "StaticEntry")
														RootMMUnit.MMUnitTyp = mmUnitTypForButtonDataStatic;
													RootMMUnit.Table.Rows.Add(RootMMUnit);
													RootMMUnit.PagingType = DirectPlayerPage;
													Data.DbServer3.MultiMedia.MMUnits.SaveChanges(new Object());
													Data.DbServer3.MultiMedia.MMUnits.AcceptChanges();
													}
												contentPage = Data.DbServer3.MultiMedia.Pages.NewRow();
												contentPage.Id = buttonData.Id;
												contentPage.SortOrder = ++sortOrder;
												contentPage.DiagnosticText = buttonData.NameId;
												if (level == 0)
													{
													contentPage.MMUnit = RootMMUnit;
													}
												else
													{
													contentPage.ParentPage = ParentObject as DbEntities.dbserver3.multimedia.rows.Page;
													}
												contentPage.Table.Rows.Add(contentPage);

												AddDrawingElements(buttonData, contentPage);
												Data.DbServer3.MultiMedia.SaveAnabolic(new Object());
												Data.DbServer3.MultiMedia.AcceptChanges();
												ConvertToMMUnitsLoop(buttonData, contentPage, level + 1);
												EntriesPerLevel[level]++;
												LoopCounter++;
												}

											}
								*/
		private void AddDrawingElements(ButtonData buttonData, DbEntities.dbserver3.multimedia.rows.Page page)
			{
			XmlDocument FileContent = null;
			if (!String.IsNullOrWhiteSpace(buttonData.FileName))
				{
				FileInfo fileInfo = new FileInfo(Path.Combine(@"\\webserver2\WPMediaSender\Haus\ButtonData",
					buttonData.FileName));
				if (fileInfo.Exists)
					{
					FileContent = new XmlDocument();
					FileContent.Load(fileInfo.FullName);
					}
				}
			if (!String.IsNullOrWhiteSpace(buttonData.ImageAfter))
				{
				String OldButtonRootDirectory = @"D:\WPMediaSender\AutoContent\ButtonData";
				FileInfo imageFileInfo = new FileInfo(Path.Combine(OldButtonRootDirectory, buttonData.ImageAfter));
				if (imageFileInfo.Exists)
					{
					Byte[] pictureBytes = imageFileInfo.LoadAs_ByteArray();
					String extension = Path.GetExtension(imageFileInfo.Name).Replace(".", "").ToLower();
					MMPicture picture = Data.DbServer3.MultiMedia.MMPictures.LoadOrCreate(pictureBytes,
						Path.GetFileNameWithoutExtension(imageFileInfo.Name), extension);
					Image newImage = Data.DbServer3.MultiMedia.Images.NewRow();
					newImage.Id = Guid.NewGuid();
					newImage.Page = page;
					newImage.DiagnosticText = $"Image zu {buttonData.NameId}";
					newImage.Extension = extension;
					newImage.SortOrder = 1;
					newImage.MMPicture = picture;
					newImage.Background = Colors.Transparent.ToString();
					newImage.BorderThickness = new Thickness(0).ToString();
					newImage.MarginThickness = new Thickness(0).ToString();
					newImage.Rotation = 0D;
					newImage.Table.Rows.Add(newImage);

					}
				}
			if (buttonData.LinkType == "ButtonPage")
				return;
			if ((buttonData.LinkType == "Internet")
				&& (!String.IsNullOrWhiteSpace(buttonData.LinkData)))
				{
				Link newLink = Data.DbServer3.MultiMedia.Links.NewRow();
				newLink.Id = Guid.NewGuid();
				newLink.Page = page;
				newLink.DiagnosticText = $"Link zu {buttonData.NameId}";
				newLink.SortOrder = 1;
				newLink.LinkColumn = buttonData.LinkData;
				newLink.FontWeight = FontWeights.ExtraLight.ToString();
				newLink.Foreground = Colors.Black.ToString();
				newLink.MarginThickness = new Thickness(0).ToString();
				newLink.Table.Rows.Add(newLink);
				}

			if ((buttonData.LinkType == "Content")
				&& (!String.IsNullOrWhiteSpace(buttonData.LinkData)))
				{
				Text newText = Data.DbServer3.MultiMedia.Texts.NewRow();
				newText.Id = Guid.NewGuid();
				newText.Page = page;
				newText.DiagnosticText = $"Text zu {buttonData.NameId}";
				newText.SortOrder = 1;
				newText.TextColumn = buttonData.LinkData;
				newText.FontWeight = FontWeights.ExtraLight.ToString();
				newText.Foreground = Colors.Black.ToString();
				newText.MarginThickness = new Thickness(0).ToString();
				newText.Table.Rows.Add(newText);
				}

			}
예제 #60
0
 public List<Object> CreateTreeForProjekteFolder(DbEntities.dbserver3.wordup.rows.Projekt ProjektEntry,
     String SecurityGroup)
     {
     List<Object> CollectionOfClassesToPrint = new List<object>();
     bool FirstProjektInProjektOrt = false;
     CreateAllForOneProjectToPrint(Basics.DataSelection.Planungen, CollectionOfClassesToPrint, ProjektEntry, ref FirstProjektInProjektOrt,
         true, true, true, true, SecurityGroup);
     return CollectionOfClassesToPrint;
     }