Beispiel #1
0
 public Statistics()
 {
     HP     = new HealthInfo();
     PvP    = new PVPInfo();
     Quests = new QuestInfo();
     Work   = new WorkInfo();
 }
Beispiel #2
0
        private void SetConfig()
        {
            var extent  = currentExtent();
            var ezMap   = new EZMapTile(this.urlTxb.Text, this.versionTxb.Text);
            int maxZoom = int.Parse(this.maxZoomTxb.Text);
            int minZoom = int.Parse(this.minZoomTxb.Text);

            var list = new System.Collections.Generic.List <RowColumns>();

            for (int i = minZoom; i <= maxZoom; i++)
            {
                list.Add(ezMap.GetRowColomns(extent, i));
            }
            WorkInfo workInfo = new WorkInfo();

            workInfo.maxX     = extent.maxX;
            workInfo.maxY     = extent.maxY;
            workInfo.minX     = extent.minX;
            workInfo.minY     = extent.minY;
            workInfo.mapType  = MapType.PGIS;
            workInfo.rcList   = list;
            workInfo.filePath = this.txbSavePath.Text.Trim();
            workInfo.workName = "PIS 地图下载";
            workInfo.processDownImage.count = 0;
            workInfo.id = System.Guid.NewGuid().ToString();
            workInfo.isAusterityFile = true;

            config = new EzMapConfig();
            config.CurrentExtent = extent;
            config.WorkInfo      = workInfo;
            config.MaxZoom       = maxZoom;
            config.MinZoom       = minZoom;
            config.ServerUrl     = this.urlTxb.Text;
            config.ServerVersion = this.versionTxb.Text;
        }
Beispiel #3
0
        public FrmProperty(WorkInfo workInfo)
        {
            InitializeComponent();
            this.txbMaxX.Text        = workInfo.maxX.ToString();
            this.txbMaxY.Text        = workInfo.maxY.ToString();
            this.txbMinX.Text        = workInfo.minX.ToString();
            this.txbMinY.Text        = workInfo.minY.ToString();
            this.txbCenterPoint.Text = ((workInfo.minX + workInfo.maxX) / 2).ToString() + "," + ((workInfo.minY + workInfo.maxY) / 2).ToString();
            int minZoom = 0;
            int maxZoom = 0;

            if (workInfo.rcList.Count > 0)
            {
                minZoom = workInfo.rcList[0].zoom;
                maxZoom = workInfo.rcList[0].zoom;
            }
            foreach (RowColumns rc in workInfo.rcList)
            {
                if (minZoom > rc.zoom)
                {
                    minZoom = rc.zoom;
                }
                if (maxZoom < rc.zoom)
                {
                    maxZoom = rc.zoom;
                }
            }
            txbMaxZoom.Text = maxZoom.ToString();
            txbMinZoom.Text = minZoom.ToString();
            txbPath.Text    = workInfo.filePath + "\\s";
        }
Beispiel #4
0
        /// <summary>
        /// Gets the work information corresponding to the specified work
        /// entity.
        /// </summary>
        /// <param name="ef">The entity or null.</param>
        /// <param name="context">The context.</param>
        /// <returns>The object or null.</returns>
        /// <exception cref="ArgumentNullException">context</exception>
        public static WorkInfo GetWorkInfo(EfWork ef, BiblioDbContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (ef == null)
            {
                return(null);
            }
            WorkInfo info = new WorkInfo
            {
                IsContainer = false,
                Id          = ef.Id,
                Key         = ef.Key,
                Type        = ef.Type?.Name,
                Title       = ef.Title,
                Language    = ef.Language,
                Edition     = ef.Edition,
                YearPub     = ef.YearPub,
                PlacePub    = ef.PlacePub,
                Number      = ef.Number,
                FirstPage   = ef.FirstPage,
                LastPage    = ef.LastPage
            };

            // authors
            if (ef.AuthorWorks?.Count > 0)
            {
                info.Authors = (from aw in ef.AuthorWorks
                                select new WorkAuthor
                {
                    Id = aw.AuthorId,
                    First = aw.Author?.First,
                    Last = aw.Author?.Last,
                    Role = aw.Role,
                    Ordinal = aw.Ordinal
                }).ToList();
            }

            // keywords
            if (ef.KeywordWorks?.Count > 0)
            {
                info.Keywords = (from kw in ef.KeywordWorks
                                 select new Keyword
                {
                    Language = kw.Keyword?.Language,
                    Value = kw.Keyword?.Value
                }).ToList();
            }

            // container
            if (ef.Container != null)
            {
                info.Container = GetWorkInfo(ef.Container, context);
            }

            return(info);
        }
Beispiel #5
0
        public bool CreateWorkInfo(WorkInfoCreate model)
        {
            PersonnelService ps    = new PersonnelService();
            int model1             = (int)model.PersonnelId;
            PersonnelListItem varA = ps.GetPersonnelById(model1);
            var entity             = new WorkInfo()
            {
                PersonnelId                  = model.PersonnelId,
                PositionId                   = model.PositionId,
                ContactId                    = model.ContactId,
                Wage                         = model.Wage,
                WorkEmail                    = model.WorkEmail,
                LastReview                   = model.LastReview,
                StartOfBenefits              = varA.DOH.AddDays(90),
                VacationDaysAccruedLifetime  = model.VacationDaysAccruedLifetime,
                VacationDaysUsedLifetime     = model.VacationDaysUsedLifetime,
                VacationDaysAccruedForPeriod = model.VacationDaysAccruedForPeriod,
                VacationDaysUsedForPeriod    = model.VacationDaysUsedForPeriod,
                PersonalDaysAccruedLifetime  = model.PersonalDaysAccruedLifetime,
                PersonalDaysUsedLifetime     = model.PersonalDaysUsedLifetime,
                PersonalDaysAccruedForPeriod = model.PersonalDaysAccruedForPeriod,
                PersonalDaysUsedForPeriod    = model.PersonalDaysUsedForPeriod,
                SickDaysAccruedLifetime      = model.SickDaysAccruedLifetime,
                SickDaysUsedLifetime         = model.SickDaysUsedLifetime,
                SickDaysAccruedForPeriod     = model.SickDaysAccruedForPeriod,

                SickDaysUsedForPeriod = model.SickDaysUsedForPeriod
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.WorkInfoDbSet.Add(entity);
                return(ctx.SaveChanges() == 1);
            }
        }
Beispiel #6
0
        public override bool Run(WorkInfo workInfo)
        {
            logger.Info("Entered_method");
            bool bStatus = false;

            try
            {
                var connectorState = ((OutputNode)this.InputNode.Connector).State;
                InputNode.State.DataFilePath = connectorState.DataFilePath;
                InputNode.State.Schema       = connectorState.Schema;

                if (!File.Exists(InputNode.State.DataFilePath))
                {
                    workInfo.Log(this.DisplayName, LogLevel.Error, $"Output DataFile from previous file {InputNode.State.DataFilePath} does not exist");
                    return(false);
                }

                if (InputNode.State.Schema == null)
                {
                    workInfo.Log(this.DisplayName, LogLevel.Error, $"Schema is not passed to OutputModule from previous module");
                    return(false);
                }

                mainWindowClass.LoadData(InputNode.State.DataFilePath, InputNode.State.Schema);
                bStatus = true;
            }
            catch (Exception ex)
            {
                logger.Error(ex, "DataOutputModule encountered an exception");
                bStatus = false;
            }
            return(bStatus);
        }
Beispiel #7
0
        private void tsbStart_Click(object sender, EventArgs e)
        {
            if (this.dataGridViewWorks.SelectedRows.Count == 0)
            {
                return;
            }
            bool isLincence = LisenceManager.IsKeyUsing();

            if (!isLincence)
            {
                if (MessageBox.Show(
                        "您没有许可权限,是否需要注册?",
                        "提示",
                        MessageBoxButtons.OKCancel,
                        MessageBoxIcon.Question,
                        MessageBoxDefaultButton.Button1) == DialogResult.OK)
                {
                    FrmLinence frmLinence = new FrmLinence();
                    frmLinence.ShowDialog();
                }
                return;
            }
            DataGridViewRow row      = this.dataGridViewWorks.SelectedRows[0];
            WorkInfo        workInfo = row.Tag as WorkInfo;

            this.StartDownLoad(workInfo, row);
        }
        // GET api/<controller>/5
        public Hashtable Get(int id)
        {
            Hashtable ht   = new Hashtable();
            Hashtable data = new Hashtable();
            WorkInfo  ai   = new WorkInfo();

            if (ai.HasUsed(id))
            {
                ht.Add("code", 40000);
                data.Add("message", "工作已被使用,无法删除");
            }
            else
            {
                try
                {
                    if (ai.DeleteOne(id))
                    {
                        ht.Add("code", 20000);
                        data.Add("status", "success");
                    }
                    else
                    {
                        ht.Add("code", 40000);
                        data.Add("message", "failed");
                    }
                }
                catch (Exception e)
                {
                    ht.Add("code", 40000);
                    data.Add("message", e.Message);
                }
            }
            ht.Add("data", data);
            return(ht);
        }
Beispiel #9
0
        private void AddBut_Click(object sender, RoutedEventArgs e)
        {
            MainInfo newMainInfo = new MainInfo();
            Employee newEmployee = new Employee();
            Work     newWork     = new Work();
            WorkInfo newWorkInfo = new WorkInfo();

            newEmployee.NumberEmployee        = Convert.ToInt32(tb1.Text);
            newEmployee.FullName              = tb2.Text;
            newEmployee.Position              = tb3.Text;
            newWork.NumberWork                = Convert.ToInt32(tb4.Text);
            newWork.NameWork                  = (tb5.Text);
            newWorkInfo.Laboriousness         = Convert.ToInt32(tb6.Text);
            newWorkInfo.DateOfComplite        = Convert.ToDateTime(tb7.SelectedDate);
            newWorkInfo.PlannedDateFoComplite = Convert.ToDateTime(tb8.SelectedDate);
            newWorkInfo.Readiness             = Convert.ToInt32(tb9.Text);

            dbContext.db.Employee.Add(newEmployee);
            dbContext.db.Work.Add(newWork);
            dbContext.db.WorkInfo.Add(newWorkInfo);

            newMainInfo.IDNameWork  = newWork.ID;
            newMainInfo.IDFullName  = newWork.ID;
            newMainInfo.IDReadiness = newWork.ID;

            dbContext.db.MainInfo.Add(newMainInfo);
            dbContext.db.SaveChanges();

            MessageBox.Show("Вы добавили новые данные!", "Уведомление", MessageBoxButton.OK, MessageBoxImage.Information);
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,WorkLifeBalance,StockOptionLevel,TotalWorkingYears,EnvironmentSatisfaction,StandardHours,OverTime")] WorkInfo workInfo)
        {
            if (id != workInfo.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(workInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WorkInfoExists(workInfo.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(workInfo));
        }
Beispiel #11
0
        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            if (_bw.IsBusy)
            {
                MessageBox.Show("Search is already running");
            }

            _btnSearch.IsEnabled = false;
            _edtResult.Text      = "";
            _edtProgress.Text    = "";

            object userObj = null;

            if (_getUserObject != null)
            {
                userObj = _getUserObject();
            }

            WorkInfo wi = new WorkInfo
            {
                FolderReferences    = _edtFolderReferences.Text,
                PatternReferences   = _edtPatternReferences.Text,
                ReferencesRecursive = _chkReferencesRecursive.IsChecked == true,
                Work       = _work,
                UserObject = userObj,
            };

            _bw.RunWorkerAsync(wi);
            _tabCtrl.SelectedIndex = 1;
            _tabResult.IsEnabled   = true;
            Mouse.OverrideCursor   = Cursors.Wait;
        }
Beispiel #12
0
        /// <summary>
        /// 根据ID获取工作信息表实体
        /// </summary>
        /// <param name="guid">主键ID</param>
        /// <returns>返回工作信息表实体</returns>
        public WorkInfo GetItemById(Guid guid)
        {
            WorkInfo tem = new WorkInfo();

            tem = Dal.Find <WorkInfo>(WorkInfo._.ID == guid);
            return(tem);
        }
        /// <summary>
        /// 拷贝同件号
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public List <string> CopWork(UserModel user)
        {
            List <string>  err      = new List <string>();
            WorkInfo       workInfo = work.Info.Clone() as WorkInfo;
            WorkCollection workColl = new WorkCollection(workInfo.MoldInfo);
            int            workNum  = workColl.Work[workColl.Work.Count - 1].Info.WorkNumber + 1;

            workInfo.WorkNumber = workNum;
            workInfo.UserModel  = user;
            EDMModel edm = GetEDMModel();

            if (edm != null)
            {
                WorkCreateAssmbile create = new WorkCreateAssmbile(workInfo, edm, asm);
                err.AddRange(create.CreatePart(work.WorkpieceDirectoryPath));
                err.AddRange(create.LoadAssmbile());
                if (err.Count == 0)
                {
                    create.Work.SaveCsys(asm.PartTag);
                }
                foreach (NXOpen.Assemblies.Component elect in GetElectrodeComponent())
                {
                    err.AddRange(LoadEle(elect, create.Work.PartTag));
                }
            }
            else
            {
                err.Add("无法获取EDM");
            }

            return(err);
        }
Beispiel #14
0
        public ActionResult <string> SetData(WorkInfoModifyModel data)
        {
            var newData = new WorkInfo()
            {
                WorkInfoID       = data.WorkInfoID,
                WorkInfoOperator = data.WorkInfoOperator,
                WorkOrderID      = data.WorkOrderID,
                ProductID        = data.ProductID,
                StationID        = data.StationID,
                SpecID           = data.SpecID,
                ClientName       = data.ClientName,
                WorkInfoData     = data.WorkInfoData,
                LoginDateTime    = data.LoginDateTime,
                LogoutDateTime   = data.LogoutDateTime
            };

            try
            {
                if (repository.SaveData(newData))
                {
                    return(ActionResult <string> .SetSuccess($"保存 {ItemName} 成功", "保存成功"));
                }
                else
                {
                    return(ActionResult <string> .SetError($"{ItemName} 已经被删除", "保存失败"));
                }
            }
            catch (Exception ex)
            {
                return(ActionResult <string> .SetError(ex.Message, "保存失败"));
            }
        }
        /// <summary>
        /// Возвращает основную информацию об игроке
        /// </summary>
        private object CreateShortPlayerInfo(PlayerInfo playerInfo, WorkInfo activeWork)
        {
            var hasWork       = activeWork != null;
            var workLevelInfo = string.Empty;

            if (hasWork)
            {
                workLevelInfo = activeWork.Type == WorkType.Police ? PoliceDataGetter.RankNames[activeWork.Level] : activeWork.Level.ToString();
            }
            var info = new {
                playerInfo.Name,
                TagName = playerInfo.Clan != null?ClanManager.GetClanName(playerInfo.Clan.ClanId) : null,
                              playerInfo.Balance,
                              playerInfo.Level,
                              playerInfo.Experience,
                              Driver    = playerInfo.Driver.CanDriveB,
                              Work      = hasWork ? activeWork.Type.GetDescription() : string.Empty,
                              WorkLevel = workLevelInfo,
                              WorkExp   = hasWork ? activeWork.Experience : 0,
                              Salary    = hasWork ? activeWork.Salary : 0,
                              Wanted    = playerInfo.Wanted.WantedLevel,
                              playerInfo.PhoneNumber,
                              playerInfo.PhoneBalance,
                              playerInfo.Settings,
                              ClanRank = playerInfo.Clan?.Rank.GetDescription(),
                              ClanRep  = playerInfo.Clan?.Reputation
            };

            return(info);
        }
        public async Task UpdateEmployeeWorkInfo(WorkInfo user)
        {
            using (var sqlConnection = new SqlConnection(connectionString))
            {
                await sqlConnection.OpenAsync();

                var dynamicParameters = new DynamicParameters();
                dynamicParameters.Add("@StatementType", "Update");
                dynamicParameters.Add("@EmployeeId", user.EmployeeId);
                dynamicParameters.Add("@reportingTo", user.reportingTo);
                dynamicParameters.Add("@department", user.department);
                dynamicParameters.Add("@dateOfJoining", user.dateOfJoining);
                dynamicParameters.Add("@sourceOfHire", user.sourceOfHire);
                dynamicParameters.Add("@seatingLocation", user.seatingLocation);
                dynamicParameters.Add("@location", user.location);
                dynamicParameters.Add("@designation", user.designation);
                dynamicParameters.Add("@employeeStatus", user.employeeStatus);
                dynamicParameters.Add("@employeeType", user.employeeType);
                dynamicParameters.Add("@workPhone", user.workPhone);
                dynamicParameters.Add("@extension", user.extension);
                dynamicParameters.Add("@empRole", user.empRole);

                await sqlConnection.ExecuteAsync(
                    "spSelectInsertUpdateDeleteWorkInfo",
                    dynamicParameters,
                    commandType : CommandType.StoredProcedure);
            }
        }
        /// <summary>
        /// 创建Work
        /// </summary>
        /// <param name="workpiece"></param>
        /// <param name="mat"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        private List <string> CreateNewWork(NXOpen.Assemblies.Component ct, WorkpieceModel workpiece, Matrix4 mat, UserModel user)
        {
            List <string> err      = new List <string>();
            MoldInfo      moldInfo = workpiece.Info.MoldInfo;
            int           num      = asmColl.GetWorkCollection(moldInfo).Work.Count;
            WorkInfo      workInfo = new WorkInfo(workpiece.Info.MoldInfo, user, num + 1, mat);
            EDMModel      edm      = GetEdm(ct);

            if (edm == null)
            {
                err.Add("获取EDM错误");
                return(err);
            }
            WorkCreateAssmbile create;

            if (edm.Info.MoldInfo.Equals(workInfo.MoldInfo))
            {
                create = new WorkCreateAssmbile(workInfo, edm, asmModel);
            }
            else
            {
                EDMModel temp = new EDMModel(new EDMInfo(workInfo.MoldInfo, workInfo.UserModel));
                create = new WorkCreateAssmbile(workInfo, temp, asmModel, workpiece);
            }
            err.AddRange(create.CreatePart(workpiece.WorkpieceDirectoryPath));
            err.AddRange(create.LoadAssmbile());
            if (err.Count == 0)
            {
                create.Work.SaveCsys(workPart);
            }
            return(err);
        }
Beispiel #18
0
 public void WriteStats(WorkInfo info)
 {
     name.text   = info.name;
     date.text   = "Year: " + info.date.ToString();
     artist.text = info.artist;
     label.text  = info.label;
 }
Beispiel #19
0
        /// <summary>
        /// 创建工作线程,在没有达到最大并发时,创建新线程
        /// </summary>
        private Thread CreateNewThread()
        {
            var thd = new Thread(new ThreadStart(() =>
            {
                while (true)
                {
                    // 等待来自任务入队列的消息
                    this._poolWork.WaitOne();
                    Interlocked.Add(ref this._runCount, 1);
                    WorkInfo work = null;
                    lock (this)
                    {
                        work = this._works.Dequeue();
                    }
                    try
                    {
                        work.Method.DynamicInvoke(work.Params);
                    }
                    finally
                    {
                        // 通知任务结束
                        work?.Waiter.Release();
                        Interlocked.Add(ref this._runCount, -1);
                        // 通知主线程任务结束,进入空闲状态
                        this._pool.Release();
                    }
                }
            }));

            thd.IsBackground = true;
            thd.Start();
            return(thd);
        }
Beispiel #20
0
        public Hashtable Put(int id, string content)
        {
            int       admin = UserInfo.GetUserIdFromCookie(HttpContext.Current);
            Hashtable ht    = new Hashtable();
            WorkInfo  ai    = new WorkInfo();
            Hashtable data  = new Hashtable();

            try
            {
                // ht.Add("state", ai.AddOne(id, name, birthday, admin, work));
                if (ai.ChangeContent(id, content))
                {
                    ht.Add("code", 20000);
                    data.Add("id", id);
                }
                else
                {
                    ht.Add("code", 40000);
                    data.Add("message", "error");
                }
            }
            catch (Exception e)
            {
                ht.Add("code", 40000);
                data.Add("message", e.Message);
            }
            ht.Add("data", data);
            return(ht);
        }
Beispiel #21
0
        // POST api/<controller>
        public Hashtable Post(string content)
        {
            Hashtable ht   = new Hashtable();
            WorkInfo  ai   = new WorkInfo();
            Hashtable data = new Hashtable();

            try
            {
                // ht.Add("state", ai.AddOne(id, name, birthday, admin, work));
                if (ai.AddOne(content, 0))
                {
                    ht.Add("code", 20000);
                    data.Add("id", ai.GetId(content));
                }
                else
                {
                    ht.Add("code", 40000);
                    data.Add("message", "error");
                }
            }
            catch (Exception e)
            {
                ht.Add("code", 40000);
                data.Add("message", e.Message);
            }
            ht.Add("data", data);
            return(ht);
        }
Beispiel #22
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            NameValueCollection rp = context.Request.Form;
            Guid rwid = new Guid(rp["rwid"]);
            List <BaseEntity> list         = new List <BaseEntity>();
            string            msg          = string.Empty;
            PersonInfo        curentperson = null;
            string            zprenstr     = rp["zpren[]"];

            try
            {
                PersonInfoManager plogic = new PersonInfoManager();

                string[] zpren = zprenstr.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < zpren.Length; i++)
                {
                    if (i == 0)
                    {
                        curentperson = plogic.GetItemById(new Guid(zpren[i]));
                    }
                    WorkHandLog log = new WorkHandLog();
                    log.ID           = Guid.NewGuid();
                    log.WorkID       = rwid;
                    log.CurrentStaus = "处理中";
                    log.ChuliYj      = "工作指派";
                    if (!string.IsNullOrEmpty(context.Session["UserName"] as string))
                    {
                        log.Uper   = new Guid(context.Session["UserID"].ToString());
                        log.UpName = context.Session["RealName"] as string;
                    }
                    log.DownEr       = new Guid(zpren[i]);
                    log.DownName     = plogic.GetItemById(log.DownEr.Value).RealName;
                    log.HandDate     = DateTime.Now;
                    log.HandResult   = "已指派";
                    log.HandSequence = 1;
                    list.Add(log);
                }
                WorkInfo work = new WorkInfo();
                work.ID           = rwid;
                work.RecordStatus = Sharp.Common.StatusType.update;
                work.Status       = "处理中";
                work.CurrentUser  = curentperson.RealName;
                list.Add(work);
                int result = new WorkInfoManager().Save(list);
                context.Response.Write("{\"success\":\"true\"}");
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            if (!string.IsNullOrEmpty(msg))
            {
                byte[] bytes  = Encoding.UTF8.GetBytes(msg.Replace("\r\n", "<br/>"));
                string encode = Convert.ToBase64String(bytes);
                context.Response.Write("{\"success\":\"false\",\"msg\":\"" + encode + "\"}");
            }
            context.Response.End();
        }
Beispiel #23
0
        private async Task <List <UserInfoClearText> > DoHack(WorkInfo work)
        {
            Cracking crack = new Cracking();

            List <UserInfoClearText> result = await Task.Run(() => crack.RunCracking(work));

            return(result);
        }
Beispiel #24
0
        /// <summary>
        /// Выдать зарплату
        /// </summary>
        protected void PayOut(Client player, WorkInfo activeWork)
        {
            var workInfo = WorkInfoManager.GetWorkInfo(player, activeWork.Type);

            PlayerInfoManager.SetBalance(player, workInfo.Salary);
            workInfo.Salary = 0;
            WorkInfoManager.SetWorkInfo(player, workInfo);
        }
Beispiel #25
0
        public void DeleteData(WorkInfo workInfo)
        {
            DbVisitor    db     = new DbVisitor();
            IDbSqlScheme scheme = db.CreateSqlFrom(SqlFromUnit.Me.From(workInfo));

            scheme.dbSqlBody.Where(ConditionItem.Me.And("id", ConditionRelation.Equals, workInfo.id));
            scheme.Delete();
        }
Beispiel #26
0
        public void UpdateData(WorkInfo workInfo)
        {
            DbVisitor    db     = new DbVisitor();
            IDbSqlScheme scheme = db.CreateSqlFrom(SqlFromUnit.Me.From(workInfo));

            scheme.dbSqlBody.DataOperateContains("CompanyName", "CompanyNameEn");
            scheme.Update();
        }
Beispiel #27
0
        public void InsertData(WorkInfo workInfo)
        {
            DbVisitor    db     = new DbVisitor();
            IDbSqlScheme scheme = db.CreateSqlFrom(SqlFromUnit.Me.From(workInfo));

            scheme.dbSqlBody.DataOperateExcludes("id", "employeeInfo");
            scheme.Insert();
        }
Beispiel #28
0
 internal void StartDownLoad(WorkInfo workInfo, DataGridViewRow row)
 {
     if (workInfo != null)
     {
         workInfo.downStates = DownStates.start;
         ParameterizedThreadStart ParStart = new ParameterizedThreadStart(ThreadMethod);
         Thread myThread = new Thread(ParStart);
         if (myDicThreads.ContainsKey(workInfo.id))
         {
             if (myDicThreads[workInfo.id].ThreadState == System.Threading.ThreadState.Suspended)
             {
                 myDicThreads[workInfo.id].Resume();
                 workInfo.rcList.ForEach(
                     m =>
                 {
                     var t = m.GetData() as Thread;
                     if (t != null && t.ThreadState == System.Threading.ThreadState.Suspended)
                     {
                         t.Resume();
                     }
                 });
             }
             else if (myDicThreads[workInfo.id].ThreadState == System.Threading.ThreadState.Stopped)
             {
                 myDicThreads[workInfo.id] = myThread;
                 myThread.Start(workInfo);
                 workInfo.rcList.ForEach(
                     m =>
                 {
                     var t = m.GetData() as Thread;
                     if (t != null && t.ThreadState == System.Threading.ThreadState.Stopped)
                     {
                         t.Start();
                     }
                 });
             }
         }
         else
         {
             myDicThreads.Add(workInfo.id, myThread);
             myThread.Start(workInfo);
         }
         MethodInvoker invoker = delegate
         {
             row.Cells["workStatues"].Value = "正在下载";
         };
         if ((!base.IsDisposed) && base.InvokeRequired)
         {
             base.Invoke(invoker);
         }
         else
         {
             invoker();
         }
     }
 }
Beispiel #29
0
        private void tsbPause_Click(object sender, EventArgs e)
        {
            if (this.dataGridViewWorks.SelectedRows.Count == 0)
            {
                return;
            }
            DataGridViewRow row      = this.dataGridViewWorks.SelectedRows[0];
            WorkInfo        workInfo = row.Tag as WorkInfo;

            if (workInfo != null && myDicThreads.ContainsKey(workInfo.id))
            {
                if (myDicThreads[workInfo.id].ThreadState == System.Threading.ThreadState.Running)
                {
                    myDicThreads[workInfo.id].Suspend();
                    MethodInvoker invoker = delegate
                    {
                        workInfo.downStates            = DownStates.pause;
                        row.Cells["workStatues"].Value = "暂停下载";
                    };
                    if ((!base.IsDisposed) && base.InvokeRequired)
                    {
                        base.Invoke(invoker);
                    }
                    else
                    {
                        invoker();
                    }
                }
                else
                {
                    workInfo.rcList.ForEach(
                        m =>
                    {
                        var t = m.GetData() as Thread;
                        if (t != null && t.ThreadState == System.Threading.ThreadState.Running)
                        {
                            t.Suspend();
                        }
                    });
                    MethodInvoker invoker = delegate
                    {
                        workInfo.downStates            = DownStates.stop;
                        row.Cells["workStatues"].Value = "暂停下载";
                    };
                    if ((!base.IsDisposed) && base.InvokeRequired)
                    {
                        base.Invoke(invoker);
                    }
                    else
                    {
                        invoker();
                    }
                }
            }
        }
Beispiel #30
0
        public async Task <IActionResult> Create([Bind("Id,WorkLifeBalance,StockOptionLevel,TotalWorkingYears,EnvironmentSatisfaction,StandardHours,OverTime")] WorkInfo workInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(workInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(workInfo));
        }
 public void AddWork(WorkInfo work)
 {
     WorkInfo newWork = new WorkInfo();
     work.CopyTo(newWork);
     WorkQueue.Enqueue(newWork);
 }
 public void CopyTo(WorkInfo obj)
 {
     ProductInfo.CopyTo(obj.ProductInfo);
     AllProductInfo.CopyTo(obj.AllProductInfo);
 }
 public void CopyTo(WorkInfo obj)
 {
     ProductInfo.CopyTo(obj.ProductInfo);
     obj.IsEmptyBox = IsEmptyBox;
     obj.IsLastBox = IsLastBox;
 }