Ejemplo n.º 1
0
        protected void Button44_Click(object sender, EventArgs e)
        {
            BRemainLeave bus = new BRemainLeave();

            //bus.GetRemainLeave(1392, 1393, 0, 10);
            bus.TransferToNextYear("", 1391, 1392);
        }
Ejemplo n.º 2
0
        public void TestSetup()
        {
            busRemainLeave   = new BRemainLeave();
            leave_testObject = new LeaveYearRemain();

            leaveYearRemainTA.Insert(Utility.ToMildiDate("1389/01/01"), 10, 10, 9, 9, ADOPerson1.ID);

            leaveTable                    = leaveYearRemainTA.GetDataByPersonId(ADOPerson1.ID, Utility.ToMildiDate("1389/01/01"));
            ADOLeaveYear.ID               = ((DatabaseGateway.TA_LeaveYearRemainRow)leaveTable.Rows[0]).LeaveYearRemain_ID;
            ADOLeaveYear.PersonId         = ADOPerson1.ID;
            ADOLeaveYear.Date             = Utility.ToMildiDate("1389/01/01");
            ADOLeaveYear.DayRemainOK      = 10;
            ADOLeaveYear.MinuteRemainOK   = 10;
            ADOLeaveYear.DayRemainReal    = 9;
            ADOLeaveYear.MinuteRemainReal = 9;

            leaveSetTA.InsertQuery(ADOPerson1.ID, DateTime.Now.AddMonths(-1), true, 1440);

            DateTime endYear = Utility.ToMildiDate("1389/05/10");

            UsedLeaveDtlTA.Insert(endYear, 480, 0, 480, ADOPerson1.ID, 0);
            UsedleaveTable = UsedLeaveDtlTA.GetDataByValue(ADOPerson1.ID);
            calcResultTA.Insert(endYear, 0, 0, ADOPerson1.ID, 0, 0, 0, 0, 480, (decimal)UsedleaveTable.Rows[0][0], "ULD");

            dataAcesDepTA.Insert(BUser.CurrentUser.ID, ADODepartment1.ID, false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// مانده مرخصی را انتهای ماه برمیگرداند
        /// </summary>
        /// <param name="personId"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        private string GetReaiLeaveToEndMonth(decimal personId, int year, int month)
        {
            string remain = "";

            try
            {
                ILeaveInfo leaveInfo = new BRemainLeave();
                int        day, minutes;
                leaveInfo.GetRemainLeaveToEndOfMonth(personId, year, month, out day, out minutes);
                int hour = (minutes / 60);
                int min = minutes % 60;
                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    remain = String.Format(" {0} روز و {1} ساعت و {2} دقیقه", day, hour, min);
                }
                else if (BLanguage.CurrentLocalLanguage == LanguagesName.English)
                {
                    remain = String.Format(" {0} days and {1} hours and {2} minutes", day, hour, min);
                }
            }
            catch (InvalidDatabaseStateException ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BWorkdTime", "GetReaiLeaveToEndMonth");

                if (BLanguage.CurrentLocalLanguage == LanguagesName.Parsi)
                {
                    remain = " محاسبه نشده";
                }
                else if (BLanguage.CurrentLocalLanguage == LanguagesName.English)
                {
                    remain = "Not Calculated";
                }
            }
            catch (Exception ex)
            {
                BaseBusiness <Entity> .LogException(ex, "BWorkdTime", "GetReaiLeaveToEndMonth");

                throw ex;
            }
            return(remain);
        }