Example #1
0
        public void  FillmAssessSourceSalary(ref AssessSource mAssessSource)
        {
            List <NewStaffSalary> resultNewStaffSalaryList = new List <NewStaffSalary>();


            foreach (var item in NewStaffSalaryList)
            {
                if (item.StaffName == mAssessSource.StaffName)
                {
                    resultNewStaffSalaryList.Add(item);
                }
            }

            if (resultNewStaffSalaryList.Count == 1)
            {
                NewStaffSalary result = resultNewStaffSalaryList[0];

                try
                {
                    int tempPro  = Convert.ToInt32(result.ProbationSalary);
                    int tempFull = Convert.ToInt32(result.FullSalary);
                    int tempBal  = tempFull - tempPro;

                    mAssessSource.mNewStaffSalary.ProbationSalary = tempPro.ToString();
                    mAssessSource.mNewStaffSalary.FullSalary      = tempFull.ToString();
                    mAssessSource.mNewStaffSalary.balance         = tempBal.ToString();
                }
                catch
                {
                    mAssessSource.mNewStaffSalary.ProbationSalary = result.ProbationSalary;
                    mAssessSource.mNewStaffSalary.FullSalary      = result.FullSalary;
                    mAssessSource.mNewStaffSalary.balance         = "";
                }
            }
            else if (resultNewStaffSalaryList.Count <= 0)
            {
                mAssessSource.mNewStaffSalary.ProbationSalary = "查无此人";
                mAssessSource.mNewStaffSalary.FullSalary      = "查无此人";
                mAssessSource.mNewStaffSalary.balance         = "查无此人";
            }
            else if (resultNewStaffSalaryList.Count > 1)
            {
                mAssessSource.mNewStaffSalary.ProbationSalary = "此人有重名";
                mAssessSource.mNewStaffSalary.FullSalary      = "此人有重名";
                mAssessSource.mNewStaffSalary.balance         = "此人有重名";
            }
        }
Example #2
0
        public void DoWorkCalThread(Action <int> percent)
        {
            mExcel = new Excel(SalaryFile, false);
            mExcel.SetCurrentWorksheet(SalaryDate);
            percent(10);
            float proc = (float)0.0000;

            for (int i = 2; i <= mExcel.RowCount; i++)
            {
                NewStaffSalary mAssessSource = new NewStaffSalary();

                mAssessSource.StaffName       = mExcel.GetCell(i, 2);
                mAssessSource.ProbationSalary = mExcel.GetCell(i, 8);
                mAssessSource.FullSalary      = mExcel.GetCell(i, 9);
                NewStaffSalaryList.Add(mAssessSource);
                proc = (float)i / (float)mExcel.RowCount * (float)100;
                percent((int)proc);
            }


            int ProcessPos = 0;

            AssessSourcecollection.Clear();
            mExcel = new Excel(ExportFile, false);
            mExcel.SetCurrentWorksheet(Date);
            percent(10);
            for (int i = 2; i <= mExcel.RowCount; i++)
            {
                AssessSource mAssessSource = new AssessSource();
                mAssessSource.OrderNumber  = i - 1;
                mAssessSource.StaffName    = mExcel.GetCell(i, 1);
                mAssessSource.StaffDep     = mExcel.GetCell(i, 2);
                mAssessSource.StaffPostion = mExcel.GetCell(i, 3);
                mAssessSource.EntryTime    = mExcel.GetCell(i, 4);
                mAssessSource.EndTime      = mExcel.GetCell(i, 5);
                mAssessSource.PositiveTime = mExcel.GetCell(i, 6);
                mAssessSource.CompanyInfo  = mExcel.GetCell(i, 10);

                FillmAssessSourceSalary(ref mAssessSource);

                string tempre = mAssessSource.GetTimePercent(DateXiuxiRi, Date);
                if (tempre != "")
                {
                    mExcel.SetCellComment(i, 6, tempre);
                }

                AssessSourcecollection.Add(mAssessSource);
            }
            percent(70);
            SortByCompanyAndPercent();
            string tempzhuanzheng = "";

            mExcel.Save();
            mExcel.Visible = true;
            tempzhuanzheng = mIniFile.IniReadValue("AssessFile", "转正导出文件", tempzhuanzheng);



            ExportToExcel(AppDomain.CurrentDomain.BaseDirectory + tempzhuanzheng);
            percent(100);


            mExcel.Clean();
            mExcel.Dispose();
        }