/// <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); }
public List <TreeItem> GetAllManagerDepartmentTreeByMelliCode(string code) { try { BDepartment DepartmentBusiness = new BDepartment(); BPerson PersonBusinesss = new BPerson(); BManager ManagerBusiness = new BManager(); var person = PersonBusinesss.GetByBarcode(code); if (person == null) { return(new List <TreeItem>()); } decimal managerPersonId = person.ID; var manager = ManagerBusiness.GetManager(managerPersonId); IList <Department> departments = DepartmentBusiness.GetAllManagerDepartmentTree_JustOrgan(manager.ID); var result = departments.Select(c => new TreeItem() { id = (Int32)c.ID, parent = c.ParentID.ToString(), text = c.Name }).ToList(); result[0].parent = "#"; return(result); } catch (UIValidationExceptions ex) { this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex); throw ex; } catch (Exception ex) { this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex); throw ex; } }
public PersonProxy GetPersonByMelliCode(string code) { try { BPerson PersonBusinesss = new BPerson(); var person = PersonBusinesss.GetByBarcode(code); if (person == null) { return(new PersonProxy()); } 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; return(proxy); } catch (UIValidationExceptions ex) { this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex); throw ex; } catch (Exception ex) { this.exceptionHandler.ApiHandleException("ProfileServiceProvider", ex); throw ex; } }