コード例 #1
0
ファイル: BSubstitute.cs プロジェクト: ImanRezaeipour/atlas
        /// <summary>
        /// مدیران در جستجو
        /// اگر کاربر فعلی اپراتور فقط در بین مدیران زیر دست اپراتور جست و جو میکنیم
        /// ولی اگر مدیر باشد نتایج جست و جو تهی میباشد
        /// اگر هم مدیر باشد و هم اپراتور آنگاه خود شخص به علاوه مدیران تحت مدیریت برمیگردد
        /// </summary>
        /// <param name="searchKey"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IList <Person> GetAllManager(string searchKey, int pageIndex, int pageSize)
        {
            //BUser bUser = new BUser();
            //NHibernate.ISession CurrentNHSession = NHibernateSessionManager.Instance.GetSession();
            //IList<decimal> accessibleFlows = ((IDataAccess)bUser).GetAccessibleFlows();
            //Manager managerAlias = null;
            ////Person personAlias = null;
            ////Person personOrgAlias = null;
            //ManagerFlow managerFlowAlias = null;
            //Flow flowAlias = null;
            ////OrganizationUnit organUnitAlias = null;
            //NHibernate.IQueryOver<Manager> managerQueryExpression = null;

            //managerQueryExpression = CurrentNHSession.QueryOver<Manager>(() => managerAlias)
            //                                         .JoinAlias(() => managerAlias.ManagerFlowList, () => managerFlowAlias)
            //                                         .JoinAlias(() => managerFlowAlias.Flow, () => flowAlias)
            //                                         .Where(() => flowAlias.ID.IsIn(accessibleFlows.ToArray()));
            //                                         //.Skip(pageIndex * pageSize)
            //                                         //.Take(pageSize);

            //IList<Manager> managerList = managerQueryExpression.List<Manager>().Distinct(new ManagerComparer()).ToList();



            IList <Person> result     = new List <Person>();
            ISearchPerson  searchTool = new BPerson();

            result = searchTool.QuickSearchByPage(pageIndex, pageSize, searchKey, PersonCategory.SubstitudeManager);
            return(result);
        }
コード例 #2
0
        public void TreatDown()
        {
            wgTA.DeleteByCustomCode("55-55");
            shiftTA.DeleteByCustomCode("55-54");
            shiftTA.DeleteByCustomCode("55-55");
            flowTA.DeleteByName("FlowTest");
            managerTA.DeleteByBarcode("00001");
            accessGroupTA.DeleteByName("AccessGroup1_2");
            doctorTA.DeleteByLastName("TestDoctorLastName1");
            illnessTA.DeleteByName("TestIllness1");
            requestTA.DeleteByPerson(ADOPerson1.ID);
            requestTA.DeleteByPerson(ADOPerson2.ID);
            precardTA.DeleteByID("99999999");
            dutyPlcTA.DeleteByName("TestDutyPlc1");
            dutyPlcTA.DeleteByName("TestDutyPlc2");

            BPerson    bperson    = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi);
            BWorkgroup bworkGroup = new BWorkgroup();
            BShift     bshift     = new BShift();

            ClearSession();
            assingWorkGrouTA.DeleteByPerson(ADOPerson1.ID);
            //bshift.SaveChanges(ADOShift1, UIActionType.DELETE);
            //bshift.SaveChanges(ADOShift2, UIActionType.DELETE);
        }
コード例 #3
0
ファイル: BLeaveIncDec.cs プロジェクト: ImanRezaeipour/GTS
 public IList <LeaveIncDecProxy> GetAllByPersonId(decimal personId)
 {
     try
     {
         IList <LeaveIncDecProxy> result = new List <LeaveIncDecProxy>();
         Person prs = new BPerson().GetByID(personId);
         foreach (LeaveIncDec l in prs.LeaveIncDecList)
         {
             LeaveIncDecProxy proxy = new LeaveIncDecProxy()
             {
                 ID = l.ID, Description = l.Description
             };
             proxy.Day    = Math.Abs(l.Day).ToString();
             proxy.Hour   = Utility.IntTimeToTime(Math.Abs(l.Minute), true);
             proxy.Action = l.Type;
             if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
             {
                 proxy.Date = Utility.ToPersianDate(l.Date);
             }
             else
             {
                 proxy.Date = Utility.ToString(l.Date);
             }
             result.Add(proxy);
         }
         return(result);
     }
     catch (Exception ex)
     {
         LogException(ex, "BLeaveIncDec", "GetAllByLeaveYear");
         throw ex;
     }
 }
コード例 #4
0
    /// <summary>
    /// بادریافت شماره پرسنلی ، کارکرد را برمیگرداند
    /// </summary>
    /// <param name="personCode">شماره پرسنلی</param>
    /// <param name="fromDate">تاریخ شروع</param>
    /// <param name="toDate">تاریخ پایان</param>
    /// <returns></returns>
    private TAProxy Fill(string personCode, DateTime fromDate, DateTime toDate)
    {
        BPerson personBusiness = new BPerson();
        var     person         = personBusiness.GetByBarcode(personCode);

        if (person == null)
        {
            return(new TAProxy());
        }

        IList <PersonalMonthlyReportRow> PersonnelMonthlyOperationList    = null;
        PersonalMonthlyReportRow         PersonnelSummaryMonthlyOperation = null;
        BPersonMonthlyWorkedTime         MonthlyOperationBusiness         = new BPersonMonthlyWorkedTime(person.ID);

        var personDateRangeReportProxy = MonthlyOperationBusiness.GetPersonDateRangeReport(fromDate, toDate).FirstOrDefault();

        TAProxy proxy = new TAProxy();

        proxy.PersonCode   = personCode;
        proxy.HozourTime   = personDateRangeReportProxy.PresenceDuration;         //35 * 60;//"35:00"
        proxy.KasreKarTime = personDateRangeReportProxy.HourlyUnallowableAbsence; //2 * 60 + 50;//"02:50"
        proxy.MamuriatTime = personDateRangeReportProxy.HourlyMission;            //12 * 60;//"12:00"
        proxy.KarkerdSum   = personDateRangeReportProxy.ImpureOperation;          //47 * 60;//12:00 + 35:00
        return(proxy);
    }
コード例 #5
0
        static void Main(string[] args)
        {
            BPerson bPerson = new BPerson();

            #region Where
            //Muestra todas las personas de Nasca

            //var resul = bPerson.GetBPeopleFromNascaLambda();

            //foreach (var item in resul)
            //{
            //    Console.WriteLine(item.FirstName);
            //}



            var resul2 = bPerson.GetGroup();

            foreach (var item in resul2)
            {
                Console.WriteLine(item.City);
                Console.WriteLine(item.Cant);
            }

            Console.Read();
            #endregion
        }
コード例 #6
0
        public void ChangeInfo_All_Test()
        {
            infoProxy.DepartmentID     = ADODepartment2.ID;
            infoProxy.EmploymentTypeID = ADOEmploymentType2.ID;

            infoProxy.RuleGroupID       = ADORuleCat2.ID;
            infoProxy.RuleGroupFromDate = Utility.ToPersianDate(new DateTime(2012, 01, 01));
            infoProxy.RuleGroupToDate   = Utility.ToPersianDate(new DateTime(2012, 05, 01));

            infoProxy.DateRangeID       = ADOGroup2.ID;
            infoProxy.DateRangeFromDate = Utility.ToPersianDate(new DateTime(2011, 02, 01));

            infoProxy.WorkGroupID       = ADOWorkGroup2.ID;
            infoProxy.WorkGroupFromDate = Utility.ToPersianDate(new DateTime(2011, 02, 01));

            bool result = busChnageInfo.ChangeInfo(ADOPerson1.PersonCode, infoProxy, out errorList);

            Assert.IsTrue(result);

            ClearSession();

            Person p = new BPerson().GetByID(ADOPerson1.ID);

            p.InitializeForExecuteRule(new DateTime(2010, 1, 1), new DateTime(2013, 1, 1), new DateTime(2010, 1, 1), new DateTime(2013, 1, 1));
            Assert.AreEqual(2, p.PersonRuleCatAssignList.Count);
            Assert.AreEqual(2, p.PersonRangeAssignList.Count);
            Assert.AreEqual(2, p.AssignedWorkGroupList.Count);
            Assert.AreEqual(ADOEmploymentType2.ID, p.EmploymentType.ID);
            Assert.AreEqual(ADODepartment2.ID, p.Department.ID);
        }
コード例 #7
0
        /// <summary>
        /// تعداد پرسنل را برمیگرداند
        /// </summary>
        /// <returns></returns>
        public int GetAllPaeronsCount()
        {
            ISearchPerson searchTool = new BPerson();
            int           count      = searchTool.GetPersonCount();

            return(count);
        }
コード例 #8
0
        /// <summary>
        /// لیست پرسنل را برمیگرداند
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public IList <Person> GetAllPersons(int pageIndex, int PageSize)
        {
            ISearchPerson  searchTool = new BPerson();
            IList <Person> list       = searchTool.GetAllPerson(pageIndex, PageSize);

            return(list);
        }
コード例 #9
0
        public void SaveSMSSetting(SMSSettings setting, PersonAdvanceSearchProxy proxy)
        {
            try
            {
                ISearchPerson  searchTool = new BPerson();
                IList <Person> list;

                //don't select count
                if (proxy.PersonId > 0)
                {
                    list = searchTool.GetPersonInAdvanceSearch(proxy, 0, 1, PersonCategory.Public);
                }
                else
                {
                    list = searchTool.GetPersonInAdvanceSearch(proxy);
                }
                var l = from o in list
                        select o;
                list = l.ToList <Person>();

                foreach (Person prs in list)
                {
                    this.SaveSMSSetting(setting, prs.User);
                }
            }
            catch (Exception ex)
            {
                LogException(ex, "BUserSettings", "SaveSMSSettingsAdvanceSearch");
                throw ex;
            }
        }
コード例 #10
0
        /// <summary>
        /// لیست نتایج جستجو را برمیگرداند
        /// </summary>
        /// <param name="proxy"></param>
        /// <param name="pageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public IList <Person> GetAllPersons(Business.Proxy.PersonAdvanceSearchProxy proxy, int pageIndex, int PageSize)
        {
            ISearchPerson  bperson = new BPerson();
            IList <Person> list    = bperson.GetPersonInAdvanceSearch(proxy, pageIndex, PageSize);

            return(list);
        }
コード例 #11
0
        /// <summary>
        /// تعداد کل نتایج جستجو را برمیگرداند
        /// </summary>
        /// <returns></returns>
        public int GetAllPaeronsCount(Business.Proxy.PersonAdvanceSearchProxy proxy)
        {
            ISearchPerson bperson = new BPerson();
            int           count   = bperson.GetPersonInAdvanceSearchCount(proxy);

            return(count);
        }
コード例 #12
0
        /// <summary>
        /// تعداد مدیران در جستجو
        /// اگر کاربر فعلی اپراتور فقط در بین مدیران زیر دست اپراتور جست و جو میکنیم
        /// ولی اگر مدیر باشد نتایج جست و جو تهی میباشد
        /// اگر هم مدیر باشد و هم اپراتور آنگاه خود شخص به علاوه مدیران تحت مدیریت برمیگردد
        /// </summary>
        /// <param name="searchKey"></param>
        /// <returns></returns>
        public int GetAllManagerCount(string searchKey)
        {
            ISearchPerson searchTools = new BPerson();
            int           count       = searchTools.GetPersonInQuickSearchCount(searchKey, PersonCategory.Manager);

            return(count);
        }
コード例 #13
0
        /// <summary>
        /// بررسی تعداد لایسنس خریداری شده
        /// </summary>
        public static void CheckGTSLicense()
        {
            try
            {
                if (LicenseValue == 0)
                {
                    LicenseValue = GetLicense();
                }

                int personCount = 0;
                if (!SessionHelper.HasSessionValue(SessionHelper.LicensePersonCount))
                {
                    personCount = new BPerson().GetActivePersonCount();
                    SessionHelper.SaveSessionValue(SessionHelper.LicensePersonCount, personCount);
                }
                else
                {
                    personCount = Utility.ToInteger(SessionHelper.GetSessionValue(SessionHelper.LicensePersonCount));
                }

                if (personCount > LicenseValue)
                {
                    throw new BaseException("تعداد پرسنل داخل پایگاه داده بیشتر از مقدار لاسنس میباشد.لطفا نسبت به تهیه لاسنس اقدام نمایید", "اطلس حضور و غیاب");
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex);

                throw ex;
            }
        }
コード例 #14
0
    public List <PersonProxy> GetPersonsByDepartmentId(int DepartmentId)
    {
        try
        {
            BPerson            PersonBusinesss = new BPerson();
            List <PersonProxy> proxys          = new List <PersonProxy>();
            var persons = PersonBusinesss.GetPersonsByDirecetDepartmentId(DepartmentId);
            foreach (var person in persons)
            {
                PersonProxy proxy = new PersonProxy();
                proxy.ID             = person.ID;
                proxy.FirstName      = person.FirstName;
                proxy.LastName       = person.LastName;
                proxy.BarCode        = person.BarCode;
                proxy.Active         = person.Active;
                proxy.IsDeleted      = person.IsDeleted;
                proxy.CardNum        = person.CardNum;
                proxy.EmploymentDate = person.EmploymentDate;
                proxy.ParentPath     = person.Department.ParentPath;
                proxys.Add(proxy);
            }

            return(proxys);
        }
        catch (UIValidationExceptions ex)
        {
            this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex);
            throw ex;
        }
        catch (Exception ex)
        {
            this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex);
            throw ex;
        }
    }
コード例 #15
0
        /// <summary>
        /// تعداد مدیران جستجو شده
        /// اگر کاربر فعلی اپراتور فقط در بین مدیران زیر دست اپراتور جست و جو میکنیم
        /// ولی اگر مدیر باشد نتایج جست و جو تهی میباشد
        /// اگر هم مدیر باشد و هم اپراتور آنگاه خود شخص به علاوه مدیران تحت مدیریت برمیگردد
        /// </summary>
        /// <param name="proxy"></param>
        /// <returns></returns>
        public int GetAllManagerCount(PersonAdvanceSearchProxy proxy)
        {
            //if (!IsOperator()) { return 0; }
            ISearchPerson searchTools = new BPerson();
            int           count       = searchTools.GetPersonInAdvanceSearchCount(proxy, PersonCategory.Manager);

            return(count);
        }
コード例 #16
0
        /*
         *   public IList<Person> GetSearchResult(string searchKey, int year, int month, int pageIndex, int pageSize)
         *   {
         *       try
         *       {
         *           int rangeOrder = month;
         *           ISearchPerson searchTool = new BPerson();
         *           int totalCount = searchTool.GetPersonInQuickSearchCount(searchKey);
         *           IList<Person> personList = searchTool.QuickSearchByPage(0, totalCount, searchKey);
         *           var ids = from o in personList
         *                     select o.ID;
         *           IList<decimal> existsPersonArchiveList = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
         *
         *           personList = personList.Where(x => existsPersonArchiveList.Any(y => y == x.ID))
         *               .Skip(pageIndex * pageSize)
         *               .Take(pageSize)
         *               .ToList();
         *
         *           return personList;
         *       }
         *       catch (Exception ex)
         *       {
         *           BaseBusiness<Entity>.LogException(ex);
         *           throw ex;
         *       }
         *   }
         *
         *   public IList<Person> GetSearchResult(PersonAdvanceSearchProxy proxy, int year, int month, int pageIndex, int pageSize)
         *   {
         *       try
         *       {
         *           int rangeOrder = month;
         *           ISearchPerson searchTool = new BPerson();
         *           IList<Person> personList = searchTool.GetPersonInAdvanceSearch(proxy);
         *           var ids = from o in personList
         *                     select o.ID;
         *           IList<decimal> existsPersonArchiveList = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
         *
         *           personList = personList.Where(x => existsPersonArchiveList.Any(y => y == x.ID))
         *               .Skip(pageIndex * pageSize)
         *               .Take(pageSize)
         *               .ToList();
         *
         *           return personList;
         *       }
         *       catch (Exception ex)
         *       {
         *           BaseBusiness<Entity>.LogException(ex);
         *           throw ex;
         *       }
         *   }
         */
        #endregion

        #region Check Archive & Archive

        /// <summary>
        /// آیا داده های اشخاص مشخص شده قبلا آرشیو شده اند
        /// </summary>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="personId"></param>
        /// <returns></returns>
        public ArchiveExsitsConditions IsArchiveExsits(int year, int month, decimal personId)
        {
            Person         prs  = new BPerson().GetByID(personId);
            IList <Person> list = new List <Person>();

            list.Add(prs);
            return(this.IsArchiveExsits(year, month, list));
        }
コード例 #17
0
ファイル: MainPage.aspx.cs プロジェクト: ImanRezaeipour/GTS
        protected void Button46_Click(object sender, EventArgs e)
        {
            BPerson bus = new BPerson();
            Person  prs = new Person();

            prs.ID = 516;
            bus.DeletePerson(prs, UIActionType.DELETE);
        }
コード例 #18
0
        /// <summary>
        /// مدیران در جستجو
        /// اگر کاربر فعلی اپراتور فقط در بین مدیران زیر دست اپراتور جست و جو میکنیم
        /// ولی اگر مدیر باشد نتایج جست و جو تهی میباشد
        /// اگر هم مدیر باشد و هم اپراتور آنگاه خود شخص به علاوه مدیران تحت مدیریت برمیگردد
        /// </summary>
        /// <param name="searchKey"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IList <Person> GetAllManager(string searchKey, int pageIndex, int pageSize)
        {
            IList <Person> result     = new List <Person>();
            ISearchPerson  searchTool = new BPerson();

            result = searchTool.QuickSearchByPage(pageIndex, pageSize, searchKey, PersonCategory.Manager);
            return(result);
        }
コード例 #19
0
ファイル: MainPage.aspx.cs プロジェクト: ImanRezaeipour/GTS
 protected void Button23_Click(object sender, EventArgs e)
 {
     ISearchPerson PersonnelSearchBusiness = new BPerson();
     //IList<Person> list = PersonnelSearchBusiness.QuickSearchByPage(0, 20, "62620");
     //IList<Department> departmentsList = PersonnelSearchBusiness.GetAllDepartments();
     //Department rootDep = PersonnelSearchBusiness.GetDepartmentRoot();
     IList <Person> prsList = PersonnelSearchBusiness.QuickSearchByPage(0, 1000, "");
 }
コード例 #20
0
        public void TestSetup()
        {
            wgd_testObject = new WorkGroupDetail();
            busCalendar    = new BWorkGroupCalendar(SysLanguageResource.Parsi);

            #region insert workgroup,shift,person
            BPerson bperson = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi);
            ADOPerson = new Person()
            {
                ID = bperson.CreateWorkingPerson2()
            };

            BWorkgroup bworkGroup = new BWorkgroup();
            ADOWorkGroup.CustomCode = "55-55";
            ADOWorkGroup.Name       = "ClanderWorkGroupTest";
            bworkGroup.SaveChanges(ADOWorkGroup, UIActionType.ADD);

            BShift bshift = new BShift();
            ADOShift1.Name      = "ClanderShiftTest1";
            ADOShift1.Person    = ADOPerson;
            ADOShift1.Color     = "0xff6512";
            ADOShift1.ShiftType = ShiftTypesEnum.WORK;
            bshift.SaveChanges(ADOShift1, UIActionType.ADD);

            ADOShift2.Name      = "ClanderShiftTest2";
            ADOShift2.Color     = "0xbbccaa";
            ADOShift2.Person    = ADOPerson;
            ADOShift2.ShiftType = ShiftTypesEnum.WORK;
            bshift.SaveChanges(ADOShift2, UIActionType.ADD);
            #endregion

            #region date inti
            date1  = Utility.ToMildiDate("1390/5/1");
            date2  = Utility.ToMildiDate("1390/5/2");
            date3  = Utility.ToMildiDate("1390/5/3");
            date4  = Utility.ToMildiDate("1390/5/5");
            date5  = Utility.ToMildiDate("1390/5/6");
            date6  = Utility.ToMildiDate("1390/5/7");
            date7  = Utility.ToMildiDate("1390/5/9");
            date8  = Utility.ToMildiDate("1390/5/10");
            date9  = Utility.ToMildiDate("1390/5/11");
            date10 = Utility.ToMildiDate("1389/1/1");
            date11 = Utility.ToMildiDate("1391/1/1");
            #endregion

            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date1);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date2);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date3);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date4);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift1.ID, date5);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date6);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date7);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date8);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date9);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date10);
            wgdTA.Insert(ADOWorkGroup.ID, ADOShift2.ID, date11);
            ClearSession();
        }
コード例 #21
0
        public void QuickSearchOnFirstNameByPageTest()
        {
            ISearchPerson  searchTool = new BPerson();
            string         key        = ADOPerson1.BarCode.Remove(0, 2);
            int            count      = searchTool.GetPersonInQuickSearchCount(key);
            IList <Person> list       = searchTool.QuickSearchByPage(0, count, key);

            Assert.IsTrue(list.Where(x => x.ID == ADOPerson1.ID).Count() == 1);
        }
コード例 #22
0
        public void GetAllByPage_FaTest()
        {
            busPerson = new BPerson(SysLanguageResource.Parsi, LocalLanguageResource.Parsi);

            int            count = busPerson.GetPersonCount();
            IList <Person> list  = busPerson.GetAllByPage(count, 0);

            Assert.IsTrue(list.Where(x => x.PersonCode == ADOPerson1.PersonCode).Count() == 1);
        }
コード例 #23
0
        /*
         *   public IList<Person> GetSearchResult(string searchKey, int year, int month, int pageIndex, int pageSize)
         *   {
         *       try
         *       {
         *           int rangeOrder = month;
         *           ISearchPerson searchTool = new BPerson();
         *           int totalCount = searchTool.GetPersonInQuickSearchCount(searchKey);
         *           IList<Person> personList = searchTool.QuickSearchByPage(0, totalCount, searchKey);
         *           var ids = from o in personList
         *                     select o.ID;
         *           IList<decimal> existsPersonArchiveList = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
         *
         *           personList = personList.Where(x => existsPersonArchiveList.Any(y => y == x.ID))
         *               .Skip(pageIndex * pageSize)
         *               .Take(pageSize)
         *               .ToList();
         *
         *           return personList;
         *       }
         *       catch (Exception ex)
         *       {
         *           BaseBusiness<Entity>.LogException(ex);
         *           throw ex;
         *       }
         *   }
         *
         *   public IList<Person> GetSearchResult(PersonAdvanceSearchProxy proxy, int year, int month, int pageIndex, int pageSize)
         *   {
         *       try
         *       {
         *           int rangeOrder = month;
         *           ISearchPerson searchTool = new BPerson();
         *           IList<Person> personList = searchTool.GetPersonInAdvanceSearch(proxy);
         *           var ids = from o in personList
         *                     select o.ID;
         *           IList<decimal> existsPersonArchiveList = archiveRep.GetExsitsArchivePersons(ids.ToList(), year, rangeOrder);
         *
         *           personList = personList.Where(x => existsPersonArchiveList.Any(y => y == x.ID))
         *               .Skip(pageIndex * pageSize)
         *               .Take(pageSize)
         *               .ToList();
         *
         *           return personList;
         *       }
         *       catch (Exception ex)
         *       {
         *           BaseBusiness<Entity>.LogException(ex);
         *           throw ex;
         *       }
         *   }
         */
        #endregion

        #region Check Archive & Archive

        /// <summary>
        /// آیا داده های اشخاص مشخص شده قبلا نتایج محاسبات شده اند
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <param name="personId">کد پرسنلی</param>
        /// <returns>وضعیت نتایج محاسبات</returns>
        public ArchiveExistsConditions IsArchiveExsits(int year, int month, decimal personId)
        {
            Person         prs  = new BPerson().GetByID(personId);
            IList <Person> list = new List <Person>();

            list.Add(prs);
            NHibernateSessionManager.Instance.GetSession().Evict(prs);
            return(this.IsArchiveExsits(year, month, list));
        }
コード例 #24
0
        /// <summary>
        /// لیست نتایج محاسبات محاسبات یک پرسنل را بر می گرداند
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <param name="personId">کد پرسنلی</param>
        /// <returns>لیست نتایج محاسبات محاسبات</returns>
        public IList <ArchiveCalcValuesProxy> GetArchiveValues(int year, int month, decimal personId)
        {
            Person         prs  = new BPerson().GetByID(personId);
            IList <Person> list = new List <Person>();

            list.Add(prs);

            return(this.GetArchiveValues(year, month, list));
        }
コード例 #25
0
        public ActionResult Index()
        {
            BPerson personBusiness = (BPerson)SimpleInjector.SimpleInjectorContainer.GetInstance <BPerson>();
            BUser   userBusiness   = (BUser)SimpleInjector.SimpleInjectorContainer.GetInstance <BUser>();
            Person  personObj      = personBusiness.SearchPerson(1);

            Model.User userObj = userBusiness.SearchUser(1);
            return(View());
        }
コード例 #26
0
        /// <summary>
        /// پس از حذف آرشیو قبلی , دادههای جدید را کپی میکند
        /// </summary>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="personId"></param>
        /// <returns></returns>
        public bool ArchiveData(int year, int month, decimal personId, bool overwrite)
        {
            Person         prs  = new BPerson().GetByID(personId);
            IList <Person> list = new List <Person>();

            list.Add(prs);
            bool result = this.ArchiveData(year, month, list, overwrite);

            return(result);
        }
コード例 #27
0
ファイル: MainPage.aspx.cs プロジェクト: ImanRezaeipour/GTS
        protected void Button34_Click(object sender, EventArgs e)
        {
            ISearchPerson            search = new BPerson();
            PersonAdvanceSearchProxy proxy  = new PersonAdvanceSearchProxy();

            proxy.RuleGroupId       = 41467;
            proxy.RuleGroupFromDate = "2012/12/15";
            proxy.RuleGroupToDate   = "2012/12/20";
            int            count = search.GetPersonInAdvanceSearchCount(proxy);
            IList <Person> list  = search.GetPersonInAdvanceSearch(proxy, 0, 10);
        }
コード例 #28
0
        /// <summary>
        /// پس از حذف نتایج محاسبات قبلی , دادههای جدید را کپی میکند
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <param name="personId">کد پرسنلی</param>
        /// <param name="overwrite">بازنویسی</param>
        /// <returns>انجام شد/انجام نشد</returns>
        public bool ArchiveData(int year, int month, decimal personId, bool overwrite)
        {
            Person         prs  = new BPerson().GetByID(personId);
            IList <Person> list = new List <Person>();

            list.Add(prs);
            NHibernateSessionManager.Instance.GetSession().Evict(prs);
            bool result = this.ArchiveData(year, month, list, overwrite);

            return(result);
        }
コード例 #29
0
ファイル: BRemainLeave.cs プロジェクト: ImanRezaeipour/GTS
        /// <summary>
        /// مانده مرخصی را برای سالها و افراد جستجو شده  برمیگرداند
        /// حد اکثر 1000 رکورد بر میگرداند
        /// </summary>
        /// <param name="quickSearchKey"></param>
        /// <param name="fromDate"></param>
        /// <param name="toDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public IList <RemainLeaveProxy> GetRemainLeave(string quickSearchKey, int fromYear, int toYear, int pageIndex, int pageSize)
        {
            try
            {
                if (Utility.IsEmpty(quickSearchKey))
                {
                    return(this.GetRemainLeave(fromYear, toYear, pageIndex, pageSize));
                }

                IList <decimal> underManagmentList = new List <decimal>();
                ISearchPerson   searchTool         = new BPerson();
                int             count = 1000;// searchTool.GetPersonInQuickSearchCount(quickSearchKey);
                IList <Person>  list  = searchTool.QuickSearchByPage(0, count, quickSearchKey);
                var             l     = from p in list
                                        select p.ID;
                underManagmentList = l.ToList <decimal>();

                /*
                 * IList<LeaveYearRemain> result = new List<LeaveYearRemain>();
                 * if (underManagmentList != null && underManagmentList.Count > 0)
                 * {
                 *  DateTime fromDate, toDate;
                 *  if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
                 *  {
                 *      fromDate = Utility.ToMildiDate(String.Format("{0}/01/01", fromYear));
                 *      toDate = Utility.ToMildiDate(String.Format("{0}/01/01", toYear));
                 *  }
                 *  else
                 *  {
                 *     fromDate = new DateTime(fromYear, 1, 1);
                 *      toDate = new DateTime(toYear, 1, 1);
                 *  }
                 *  result = objectRep.GetByCriteriaByPage(pageIndex, pageSize,
                 *                                                  new CriteriaStruct(Utility.GetPropertyName(() => new LeaveYearRemain().Date), fromDate, CriteriaOperation.GreaterEqThan),
                 *                                                  new CriteriaStruct(Utility.GetPropertyName(() => new LeaveYearRemain().Date), toDate, CriteriaOperation.LessEqThan),
                 *                                                  new CriteriaStruct(Utility.GetPropertyName(() => new LeaveYearRemain().PersonId), underManagmentList.ToArray<decimal>(), CriteriaOperation.IN));
                 * }
                 * if (result != null && result.Count > 0)
                 * {
                 *  result = result.OrderBy(x => x.Person.LastName).ThenBy(x => x.Date.Year).ToList();
                 *
                 * }
                 * return this.ConvertToProxy(result);
                 * */

                return(this.GetRemainLeave(underManagmentList, fromYear, toYear, pageIndex, pageSize));
            }
            catch (Exception ex)
            {
                LogException(ex, "BRemainLeave", "GetRemainLeave");
                throw ex;
            }
        }
コード例 #30
0
        public PersonController(SIEContext context, IConfiguration configuration)
        {
            _bHistory          = new BHistory(context);
            _bPerson           = new BPerson(context);
            _bPasswordRecovery = new BPasswordRecovery(context, configuration);
            _bInstitution      = new BInstitution(context);
            _uPerson           = new UPerson(context);
            _uRecoveryPassword = new UPasswordRecovery(context);
            _uInstitution      = new UInstitution(context);

            _configuration = configuration;
        }