예제 #1
0
 public void SortByActiveDays(ref List <AssessSource> tempMyProjectDetailCollection)
 {
     AssessSource[] tempNameListt = new AssessSource[tempMyProjectDetailCollection.Count];
     tempNameListt = tempMyProjectDetailCollection.ToArray();
     int[] tempstringNameList = new int[tempMyProjectDetailCollection.Count];
     for (int i = 0; i < tempMyProjectDetailCollection.Count; i++)
     {
         tempstringNameList[i] = tempMyProjectDetailCollection[i].ActiveDays;
     }
     Array.Sort(tempstringNameList, tempNameListt);
     tempMyProjectDetailCollection.Clear();
     tempMyProjectDetailCollection = tempNameListt.ToList();
 }
예제 #2
0
 public void SortByDep()
 {
     AssessSource[] tempNameListt = new AssessSource[AssessSourcecollection.Count];
     tempNameListt = AssessSourcecollection.ToArray();
     string[] tempstringNameList = new string[AssessSourcecollection.Count];
     for (int i = 0; i < AssessSourcecollection.Count; i++)
     {
         tempstringNameList[i] = AssessSourcecollection[i].CompanyInfo;
     }
     Array.Sort(tempstringNameList, tempNameListt);
     AssessSourcecollection.Clear();
     AssessSourcecollection = tempNameListt.ToList();
 }
예제 #3
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         = "此人有重名";
            }
        }
예제 #4
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();
        }