예제 #1
0
 public void Validate(Model.LeaveType leavetype)
 {
     if (string.IsNullOrEmpty(leavetype.LeaveTypeName))
     {
         throw new Helper.RequireValueException(Model.LeaveType.PRO_LeaveTypeName);
     }
 }
예제 #2
0
 /// <summary>
 /// Insert a LeaveType.
 /// </summary>
 public void Insert(Model.LeaveType leaveType)
 {
     //
     // todo:add other logic here
     //
     Validate(leaveType);
     accessor.Insert(leaveType);
 }
예제 #3
0
 /// <summary>
 /// Update a LeaveType.
 /// </summary>
 public void Update(Model.LeaveType leaveType)
 {
     //
     // todo: add other logic here.
     //
     Validate(leaveType);
     accessor.Update(leaveType);
 }
예제 #4
0
 /// <summary>
 /// gridview6单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView6_Click(object sender, EventArgs e)
 {
     Model.LeaveType leavetype = this.bindingSource_leaveType.Current as Model.LeaveType;
     if (leavetype != null)
     {
         this.currentleaveType = leavetype;
         this.action           = "view";
         this.Refresh();
     }
 }
예제 #5
0
        //新增
        protected override void AddNew()
        {
            switch (pageindex)
            {
            case 0:
                this.academ = new Book.Model.AcademicBackGround();
                this.academ.AcademicBackGroundId = Guid.NewGuid().ToString();
                break;

            case 1:
                this.currentduty        = new Book.Model.Duty();
                this.currentduty.DutyId = Guid.NewGuid().ToString();
                break;

            case 2:
                this.currentBank        = new Book.Model.Bank();
                this.currentBank.BankId = Guid.NewGuid().ToString();
                break;

            case 3:
                this.currentcompany           = new Book.Model.Company();
                this.currentcompany.CompanyId = Guid.NewGuid().ToString();
                break;

            case 4:
                this.currentbusinessHours = new Book.Model.BusinessHours();
                this.currentbusinessHours.BusinessHoursId = Guid.NewGuid().ToString();
                break;

            case 5:
                this.currentleaveType             = new Book.Model.LeaveType();
                this.currentleaveType.LeaveTypeId = Guid.NewGuid().ToString();
                break;

            case 6:
                this.currentAnnualholiday = new Book.Model.AnnualHoliday();
                this.currentAnnualholiday.AnnualHolidayId = Guid.NewGuid().ToString();
                break;

            case 7:
                break;
            }
        }
예제 #6
0
 public void Insert(Model.LeaveType e)
 {
     this.Insert <Model.LeaveType>(e);
 }
        /// <summary>
        /// 异常考勤订正处理
        /// </summary>
        /// <param name="checkdate"></param>
        /// <param name="emp"></param>
        /// <param name="mActualCheckIn"></param>
        /// <param name="mActualCheckOut"></param>
        /// <returns></returns>
        public Model.HrDailyEmployeeAttendInfo Reatten_Controller(DateTime checkdate, Model.Employee emp, DateTime?mActualCheckIn, DateTime?mActualCheckOut)
        {
            Model.BusinessHours mBusinessHour   = new Book.Model.BusinessHours(); //--當日應上的班別
            DateTime?           mShouldCheckIn  = null;                           //--應上班時間
            DateTime?           mShouldCheckOut = null;                           //--應下班時間
            int    mLateInMinute = 0;                                             //--遲到(分)
            Double?mDayFactor    = 0;                                             //--日基數
            double?mMonthFactor  = 0;                                             //--月基數
            Double?mSpecialBonus = 0;                                             //--班别津贴
            bool   mIsNormal     = true;                                          //--是否正常出勤
            string mNote         = string.Empty;                                  //--備註
            string mCardNo       = string.Empty;                                  //--卡号

            //取得班別表及班別津貼集合
            IList <Model.BusinessHours> mBusinessHourCollection = new BL.BusinessHoursManager().Select();
            //取得年度假日列表
            IList <Model.AnnualHoliday> holidayList = new BL.AnnualHolidayManager().SelectAnnualInfoByYear_list(checkdate.Year);

            //檢查考勤日是否為假日
            Model.AnnualHoliday holiday = null;
            //取得考情日上班部门,确定员工是否休假

            bool h_bool = holidayList.Any(pd => (pd.HolidayDate.Value.ToString("yyyy-MM-dd") == checkdate.ToString("yyyy-MM-dd")));

            if (h_bool)
            {
                holiday = holidayList.Where(pd => (pd.HolidayDate.Value.ToString("yyyy-MM-dd") == checkdate.ToString("yyyy-MM-dd"))).First();
                if (holiday != null)
                {
                    if (!string.IsNullOrEmpty(holiday.Departs))
                    {
                        if (!holiday.Departs.Contains(emp.DepartmentId))
                        {
                            holiday = null;
                        }
                    }
                }
            }

            //取得假別列表
            IList <Model.LeaveType> mleaveTypeList = new BL.LeaveTypeManager().Select();
            //請假資訊
            //Model.Leave mLeave = new BL.LeaveManager().GetEmployeeLeavebyDate(emp.EmployeeId, checkdate);
            IList <Model.Leave> mLeaves = new BL.LeaveManager().GetEmployeeLeavebyDate(emp.EmployeeId, checkdate);

            //若该请假不参与考勤 2015年4月1日23:31:08:有考勤资料优先,请假靠后
            //if (mLeaves != null && mLeaves.Count > 0)
            //{
            //    foreach (Model.Leave l in mLeaves)
            //        if (!l.LeaveType.doAttendance.Value)
            //            return null;
            //    //if (!mLeave.LeaveType.doAttendance.Value)
            //    //    return null;
            //}
            //彈性排班資訊
            Model.Flextime mFlexTime = new BL.FlextimeManager().getbyempiddate(emp.EmployeeId, checkdate);
            if (mFlexTime == null)
            {   //沒有彈性排班,則取原訂班別
                mBusinessHour = emp.BusinessHours;
            }
            else
            {
                //有彈性排班,則排定之訂班別
                mBusinessHour = mFlexTime.BusinessHours;
            }
            if (mBusinessHour == null)
            {
                return(null);
            }
            //____查詢是否有換臨時卡
            Model.TempCard mTempCard = new BL.TempCardManager().Selectbyemployeedate(emp.EmployeeId, checkdate, checkdate);
            if (mTempCard == null)
            {
                mCardNo = emp.CardNo;
            }
            else
            {
                mCardNo = mTempCard.CardNo;
            }
            if (holiday == null)
            {
                //----------------------------------------------
                //非假日:查詢是否有請假及彈性排班,
                //並查出該員當日應上的班別
                //----------------------------------------------
                //先找出該員正常應上下班之時間
                if (mBusinessHour.Fromtime.Value.Hour == 0)
                {
                    mShouldCheckIn = DateTime.Parse(checkdate.AddDays(1).ToShortDateString() + " " + "00:" + mBusinessHour.Fromtime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                else
                {
                    mShouldCheckIn = DateTime.Parse(checkdate.ToShortDateString() + " " + mBusinessHour.Fromtime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.Fromtime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                if (mBusinessHour.Fromtime.Value.Hour > mBusinessHour.ToTime.Value.Hour || mBusinessHour.Fromtime.Value.Hour == 0)        //上班時段有跨日
                {
                    mShouldCheckOut = DateTime.Parse(checkdate.AddDays(1).ToShortDateString() + " " + mBusinessHour.ToTime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                else        //沒有跨日
                {
                    if (mBusinessHour.ToTime.Value.Hour == 0)
                    {
                        mShouldCheckOut = DateTime.Parse(checkdate.AddDays(1).ToShortDateString() + " " + "00:" + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                    }
                    else
                    {
                        mShouldCheckOut = DateTime.Parse(checkdate.ToShortDateString() + " " + mBusinessHour.ToTime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                    }
                }
                //是否有請假
                if (mLeaves != null && mLeaves.Count > 0)
                {
                    if (mLeaves.Count == 1)     //本日只有一条请假记录
                    {
                        Model.LeaveType mLeaveType = mLeaves[0].LeaveType;
                        switch (mLeaves[0].LeaveRange.Value)
                        {
                        case 0:         //請整日
                            //mShouldCheckIn = null;      //请假也有应上下班时间,为了下面计算实际上下班时间,即使请假但是有上下班时间还是要显示出来。
                            //mShouldCheckOut = null;
                            if (mLeaveType.PayRate.Value == 0.5)
                            {
                                mDayFactor = 0.5;
                            }
                            else
                            {
                                mDayFactor = Convert.ToInt32(mLeaveType.PayRate);
                            }
                            //if (emp.IsMigrantWorker)                            //外劳员工请假不计工资(外劳以月薪计算)
                            //    mMonthFactor = 0;
                            //else
                            mMonthFactor = 1;
                            mIsNormal    = true;
                            mNote        = mLeaves[0].LeaveType.ToString() + "(整日)";
                            break;

                        case 1:                                                  //請上半日
                            mShouldCheckIn = mShouldCheckOut.Value.AddHours(-4); //以應下班時間減四小時為應上班時間
                            if (mLeaveType.PayRate.Value == 0.5)
                            {
                                mDayFactor = 0.75;
                            }
                            else
                            {
                                mDayFactor = 0.5 + 0.5 * mLeaveType.PayRate;
                            }
                            mNote = mLeaves[0].LeaveType.ToString() + "(上半日)";
                            //if (emp.IsMigrantWorker)
                            //    mMonthFactor = 0.5;
                            //else
                            mMonthFactor = 1;
                            break;

                        case 2:                                                 //請下半日
                            mShouldCheckOut = mShouldCheckIn.Value.AddHours(4); //以應上班時間加四小時為應下班時間
                            if (mLeaveType.PayRate.Value == 0.5)
                            {
                                mDayFactor = 0.75;
                            }
                            else
                            {
                                mDayFactor = 0.5 + 0.5 * mLeaveType.PayRate;
                            }
                            mNote = mLeaves[0].LeaveType.ToString() + "(下半日)";
                            //if (emp.IsMigrantWorker)
                            //    mMonthFactor = 0.5;
                            //else
                            mMonthFactor = 1;
                            break;
                        }
                    }
                    else    //上下半天都有请假记录
                    {
                        //mShouldCheckIn = null;
                        //mShouldCheckOut = null;
                        mIsNormal = true;
                        string _aNote      = string.Empty;
                        double _aDayFactor = 0;
                        foreach (Model.Leave l in mLeaves)
                        {
                            _aDayFactor += l.LeaveType.PayRate.Value / 2;
                            if (l.LeaveRange == 1)
                            {
                                _aNote += l.LeaveType.ToString() + "(上半日)";
                            }
                            else
                            {
                                _aNote += l.LeaveType.ToString() + "(下半日)";
                            }
                        }
                        mDayFactor = _aDayFactor;
                        mNote      = _aNote;

                        if (emp.IsMigrantWorker)                                         //外劳员工请假不计工资(外劳以月薪计算)
                        {
                            mMonthFactor = 0;
                        }
                        else
                        {
                            mMonthFactor = 1;
                        }
                    }
                }

                //判斷出勤記錄
                //___找不到上下班打卡資料
                if (mActualCheckIn == null || mActualCheckOut == null)
                {   //有請假
                    if (mLeaves != null && mLeaves.Count > 0)
                    {
                        if (mLeaves.Count == 1)
                        {   //只對請半天的做處理
                            if (mLeaves[0].LeaveRange != 0)
                            {
                                mIsNormal = false;
                                mNote     = mNote + ";卻刷卡資料";
                            }
                        }
                    }
                    else //沒請假
                    {
                        mIsNormal = false;
                        mNote     = "卻刷卡資料";
                    }
                }
                //___有上下班打卡資料
                else
                {
                    if (mLeaves != null && mLeaves.Count > 0)
                    {   //有請假
                        Model.LeaveType mLeaveType = mLeaves[0].LeaveType;
                        if (mLeaves[0].LeaveRange != 0)
                        {   //只對請半天的做處理
                            if (mLeaveType.PayRate.Value == 0.5)
                            {
                                mDayFactor = 0.75;
                            }
                            else
                            {
                                mDayFactor = 0.5 + 0.5 * mLeaveType.PayRate;
                            }
                            //if (emp.IsMigrantWorker)
                            //    mMonthFactor = 0.5;
                            //else
                            mMonthFactor  = 1;
                            mSpecialBonus = Convert.ToDouble(mBusinessHour.SpecialPay) * 0.5;
                            mIsNormal     = true;
                        }
                    }
                    else
                    {   //沒請假
                        mDayFactor    = 1;
                        mMonthFactor  = 1;
                        mSpecialBonus = Convert.ToDouble(mBusinessHour.SpecialPay);
                        mIsNormal     = true;
                    }
                    //if (mActualCheckIn > mShouldCheckIn && mLeaves != null && mLeaves.Count > 0 && mLeaves[0].LeaveRange != 0)
                    if (mActualCheckIn > mShouldCheckIn && !(mLeaves != null && mLeaves.Count > 0 && mLeaves[0].LeaveRange == 0))
                    {
                        TimeSpan ts = TimeSpan.Parse((mActualCheckIn - mShouldCheckIn).ToString());
                        mLateInMinute = ts.Hours * 60 + ts.Minutes;
                        if (mLateInMinute > 0)
                        {
                            //if (mLateInMinute > 10)
                            //{   //遲到超過10分鐘,顯示異常(讓員工有申訴機會)
                            mIsNormal = false;
                            //if (mNote != "")
                            if (!string.IsNullOrEmpty(mNote))
                            {
                                mNote = mNote + ";";
                            }
                            mNote = mNote + "遲到";
                            //}
                        }
                    }
                    else
                    {
                        mLateInMinute = 0;
                    }
                    //早退超過5分鐘,顯示異常
                    //if (mActualCheckOut < mShouldCheckOut && mLeaves != null && mLeaves.Count > 0 && mLeaves[0].LeaveRange != 0)
                    if (mActualCheckOut < mShouldCheckOut && !(mLeaves != null && mLeaves.Count > 0 && mLeaves[0].LeaveRange == 0))
                    {
                        TimeSpan ts          = TimeSpan.Parse((mShouldCheckOut - mActualCheckOut).ToString());
                        int      mLeaveEarly = ts.Hours * 60 + ts.Minutes;
                        if (mLeaveEarly > 0)
                        {
                            mIsNormal = false;
                            //if (mNote != "")
                            if (!string.IsNullOrEmpty(mNote))
                            {
                                mNote = mNote + ";";
                            }
                            mNote = mNote + "早退";
                        }
                    }
                }
            }
            else
            {   //假日
                mDayFactor    = 1;
                mMonthFactor  = 1;
                mLateInMinute = 0;
                mIsNormal     = true;
                mNote         = holiday.HolidayName;
                //找出是否有假日出勤記錄
                //___依正常排班表來判
                DateTime mayBeCheckIn  = global::Helper.DateTimeParse.NullDate;
                DateTime mayBeCheckOut = global::Helper.DateTimeParse.NullDate;
                //先找出該員可能上下班之時間
                if (mBusinessHour.Fromtime.Value.Hour == 0)
                {
                    mayBeCheckIn = DateTime.Parse(checkdate.AddDays(1).ToString("yyyy-MM-dd") + " " + "00:" + mBusinessHour.Fromtime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                else
                {
                    mayBeCheckIn = DateTime.Parse(checkdate.ToString("yyyy-MM-dd") + " " + mBusinessHour.Fromtime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.Fromtime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                if (mBusinessHour.Fromtime.Value.Hour > mBusinessHour.ToTime.Value.Hour)
                {   //上班時段有跨日
                    mayBeCheckOut = DateTime.Parse(checkdate.AddDays(1).ToString("yyyy-MM-dd") + " " + mBusinessHour.ToTime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                }
                else
                {  //上班時段有沒有跨日
                    if (mBusinessHour.ToTime.Value.Hour == 0)
                    {
                        mayBeCheckOut = DateTime.Parse(checkdate.AddDays(1).ToString("yyyy-MM-dd") + " " + "00:" + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                    }
                    else
                    {
                        mayBeCheckOut = DateTime.Parse(checkdate.ToString("yyyy-MM-dd") + " " + mBusinessHour.ToTime.Value.Hour.ToString().PadLeft(2, '0') + ":" + mBusinessHour.ToTime.Value.Minute.ToString().PadLeft(2, '0'));
                    }
                }

                //有正常刷卡假日加班
                if (mActualCheckIn != null && mActualCheckOut != null)
                {
                    //------------------------------
                    //檢查是否有上滿一整個班別
                    //若有,則給予班別津貼
                    //------------------------------
                    TimeSpan ts1 = TimeSpan.Parse((mActualCheckOut - mActualCheckIn).ToString());
                    TimeSpan ts2 = TimeSpan.Parse((mayBeCheckOut - mayBeCheckOut).ToString());
                    if (ts1.Minutes >= ts2.Minutes)
                    {
                        mSpecialBonus = Convert.ToDouble(mBusinessHour.SpecialPay);
                    }
                }
            }
            Model.HrDailyEmployeeAttendInfo _hrEA = new Book.Model.HrDailyEmployeeAttendInfo();
            _hrEA.HrDailyEmployeeAttendInfoId = Guid.NewGuid().ToString();
            _hrEA.DutyDate       = checkdate;
            _hrEA.EmployeeId     = emp.EmployeeId;
            _hrEA.ShouldCheckIn  = mShouldCheckIn;
            _hrEA.ShouldCheckOut = mShouldCheckOut;
            _hrEA.ActualCheckIn  = mActualCheckIn;
            _hrEA.ActualCheckOut = mActualCheckOut;
            _hrEA.LateInMinute   = mLateInMinute;
            _hrEA.DayFactor      = mDayFactor;
            _hrEA.MonthFactor    = mMonthFactor;
            _hrEA.SpecialBonus   = Convert.ToInt32(mSpecialBonus);
            _hrEA.IsNormal       = mIsNormal;
            _hrEA.Note           = mNote;
            _hrEA.MBusinessHours = mBusinessHour;
            _hrEA.MLeave         = (mLeaves == null || mLeaves.Count == 0) ? null : mLeaves[0];

            ReattenSave(_hrEA);

            return(_hrEA);
        }
예제 #8
0
 private bool CheckIsExist(Model.LeaveType leaveType)
 {
     return(this.leaveTypeService.CheckIsExist(leaveType));
 }
예제 #9
0
 public Model.LeaveType GetPrev(Model.LeaveType e)
 {
     return(sqlmapper.QueryForObject <Model.LeaveType>("LeaveType.get_prev", e));
 }
예제 #10
0
 public Model.LeaveType GetNext(Model.LeaveType e)
 {
     return(sqlmapper.QueryForObject <Model.LeaveType>("LeaveType.get_next", e));
 }
예제 #11
0
 public bool HasRowsAfter(Model.LeaveType e)
 {
     return(sqlmapper.QueryForObject <bool>("LeaveType.has_rows_after", e));
 }
예제 #12
0
 public bool HasRowsBefore(Model.LeaveType e)
 {
     return(sqlmapper.QueryForObject <bool>("LeaveType.has_rows_before", e));
 }
예제 #13
0
 public bool HasRowsAfter(Model.LeaveType e)
 {
     return(accessor.HasRowsAfter(e));
 }
예제 #14
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void Delete()
        {
            switch (pageindex)
            {
            case 0:
                this.academ = this.bindingSource_Academic.Current as Model.AcademicBackGround;
                if (this.academ != null)
                {
                    this.academmanage.Delete(this.academ.AcademicBackGroundId);
                }
                loadParmeter();
                break;

            case 1:
                this.currentduty = this.bindingSource_duty.Current as Model.Duty;
                if (this.currentduty != null)
                {
                    this.dutymanage.Delete(this.currentduty);
                }
                loadParmeter();
                break;

            case 2:
                this.currentBank = this.bindingSource_bank.Current as Model.Bank;
                if (this.currentBank != null)
                {
                    this.bankmanage.Delete(this.currentBank.BankId);
                }
                loadParmeter();
                break;

            case 3:
                this.currentcompany = this.bindingSource_company.Current as Model.Company;
                if (this.currentcompany != null)
                {
                    this.companymanage.Delete(this.currentcompany.CompanyId);
                }
                loadParmeter();
                break;

            case 4:
                this.currentbusinessHours = this.bindingSource_BusinessHours.Current as Model.BusinessHours;
                if (this.currentbusinessHours != null)
                {
                    this.businesshoursmanage.Delete(this.currentbusinessHours.BusinessHoursId);
                }
                loadParmeter();
                break;

            case 5:
                this.currentleaveType = this.bindingSource_leaveType.Current as Model.LeaveType;
                if (this.currentleaveType != null)
                {
                    this.leaveTypemanage.Delete(this.currentleaveType.LeaveTypeId);
                }
                loadParmeter();
                break;

            case 6:
                this.currentAnnualholiday = this.bindingSource_AnnualHoliday.Current as Model.AnnualHoliday;
                if (this.currentAnnualholiday != null)
                {
                    this.annualholidaymanage.Delete(this.currentAnnualholiday.AnnualHolidayId);
                }
                loadParmeter();
                break;

            case 7:
                break;
            }
        }
예제 #15
0
        /// <summary>
        /// 初始化
        /// </summary>
        public override void Refresh()
        {
            switch (pageindex)
            {
            case 0:
                if (this.academ == null)
                {
                    this.academ = new Book.Model.AcademicBackGround();
                    this.action = "insert";
                }
                this.textEdit_AcademicName.EditValue        = this.academ.AcademicBackGroundName;
                this.memoEdit_AcademicDescription.EditValue = this.academ.Description;

                switch (this.action)
                {
                case "insert":
                    this.textEdit_AcademicName.Properties.ReadOnly        = false;
                    this.memoEdit_AcademicDescription.Properties.ReadOnly = false;
                    break;

                case "update":
                    this.textEdit_AcademicName.Properties.ReadOnly        = false;
                    this.memoEdit_AcademicDescription.Properties.ReadOnly = false;
                    break;

                case "view":
                    this.textEdit_AcademicName.Properties.ReadOnly        = true;
                    this.memoEdit_AcademicDescription.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 1:
                if (this.currentduty == null)
                {
                    this.currentduty = new Book.Model.Duty();
                    this.action      = "insert";
                }
                this.textEdit_DutyName.EditValue = this.currentduty.DutyName;
                this.memoEdit_DutyNote.EditValue = this.currentduty.DutyNote;
                switch (this.action)
                {
                case "insert":
                    this.textEdit_DutyName.Properties.ReadOnly = false;
                    this.memoEdit_DutyNote.Properties.ReadOnly = false;
                    break;

                case "update":
                    this.textEdit_DutyName.Properties.ReadOnly = false;
                    this.memoEdit_DutyNote.Properties.ReadOnly = false;
                    break;

                case "view":
                    this.textEdit_DutyName.Properties.ReadOnly = true;
                    this.memoEdit_DutyNote.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 2:
                if (this.currentBank == null)
                {
                    this.currentBank = new Book.Model.Bank();
                    this.action      = "insert";
                }
                this.textEdit_BankName.EditValue        = this.currentBank.BankName;
                this.textEdit_BankPhone.EditValue       = this.currentBank.BankPhone;
                this.textEdit_BankAddress.EditValue     = this.currentBank.BankAddress;
                this.memoEdit_BankDescription.EditValue = this.currentBank.Description;
                switch (this.action)
                {
                case "insert":
                    this.textEdit_BankName.Properties.ReadOnly        = false;
                    this.textEdit_BankPhone.Properties.ReadOnly       = false;
                    this.textEdit_BankAddress.Properties.ReadOnly     = false;
                    this.memoEdit_BankDescription.Properties.ReadOnly = false;
                    break;

                case "update":
                    this.textEdit_BankName.Properties.ReadOnly        = false;
                    this.textEdit_BankPhone.Properties.ReadOnly       = false;
                    this.textEdit_BankAddress.Properties.ReadOnly     = false;
                    this.memoEdit_BankDescription.Properties.ReadOnly = false;;
                    break;

                case "view":
                    this.textEdit_BankName.Properties.ReadOnly        = true;
                    this.textEdit_BankPhone.Properties.ReadOnly       = true;
                    this.textEdit_BankAddress.Properties.ReadOnly     = true;
                    this.memoEdit_BankDescription.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 3:
                if (this.currentcompany == null)
                {
                    this.currentcompany = new Book.Model.Company();
                    this.action         = "null";
                }
                this.textEdit_CompanyName.EditValue        = this.currentcompany.CompanyName;
                this.memoEdit_CompanyDescription.EditValue = this.currentcompany.Description;
                switch (this.action)
                {
                case "insert":
                    this.textEdit_CompanyName.Properties.ReadOnly        = false;
                    this.memoEdit_CompanyDescription.Properties.ReadOnly = false;
                    break;

                case "update":
                    this.textEdit_CompanyName.Properties.ReadOnly        = false;
                    this.memoEdit_CompanyDescription.Properties.ReadOnly = false;
                    break;

                case "view":
                    this.textEdit_CompanyName.Properties.ReadOnly        = true;
                    this.memoEdit_CompanyDescription.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 4:
                if (this.currentbusinessHours == null)
                {
                    this.currentbusinessHours = new Book.Model.BusinessHours();
                    this.action = "insert";
                }
                this.textEdit_BusinessHoursName.EditValue   = this.currentbusinessHours.BusinessHoursName;
                this.memoEdit_BusinessDescription.EditValue = this.currentbusinessHours.Description;
                this.timeEdit_Formtime.EditValue            = this.currentbusinessHours.Fromtime;
                this.timeEdit_Totime.EditValue     = this.currentbusinessHours.ToTime;
                this.textEdit_SpecialPay.EditValue = this.currentbusinessHours.SpecialPay;
                switch (this.action)
                {
                case "insert":
                    this.textEdit_BusinessHoursName.Properties.ReadOnly   = false;
                    this.memoEdit_BusinessDescription.Properties.ReadOnly = false;
                    break;

                case "update":
                    this.textEdit_BusinessHoursName.Properties.ReadOnly   = false;
                    this.memoEdit_BusinessDescription.Properties.ReadOnly = false;
                    break;

                case "view":
                    this.textEdit_BusinessHoursName.Properties.ReadOnly   = true;
                    this.memoEdit_BusinessDescription.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 5:
                if (this.currentleaveType == null)
                {
                    this.currentleaveType = new Book.Model.LeaveType();
                    this.action           = "insert";
                }
                //this.textEdit_LeaveTypeName.EditValue = this.currentleaveType.LeaveTypeName;
                //this.textEdit_PayRate.EditValue = this.currentleaveType.PayRate;
                //if (this.currentleaveType.IsCountToPunish == true)
                //    this.checkEdit_IsCountToPunish.Checked = true;
                //else
                //    this.checkEdit_IsCountToPunish.Checked = false;
                switch (this.action)
                {
                case "insert":
                    //this.textEdit_LeaveTypeName.Properties.ReadOnly = false;
                    //this.textEdit_PayRate.Properties.ReadOnly = false;
                    //this.checkEdit_IsCountToPunish.Properties.ReadOnly = false;
                    break;

                case "update":
                    // this.textEdit_LeaveTypeName.Properties.ReadOnly = false;
                    // this.textEdit_PayRate.Properties.ReadOnly = false;
                    // this.checkEdit_IsCountToPunish.Properties.ReadOnly = false;
                    break;

                case "view":
                    //this.textEdit_LeaveTypeName.Properties.ReadOnly = true;
                    //this.textEdit_PayRate.Properties.ReadOnly = true;
                    //this.checkEdit_IsCountToPunish.Properties.ReadOnly = true;
                    break;

                default:
                    break;
                }
                break;

            case 6:
                if (this.currentAnnualholiday == null)
                {
                    this.currentAnnualholiday = new Book.Model.AnnualHoliday();
                    this.action = "insert";
                }

                break;

            case 7:
                break;
            }

            base.Refresh();
        }
예제 #16
0
 public Model.LeaveType GetNext(Model.LeaveType e)
 {
     return(accessor.GetNext(e));
 }
예제 #17
0
 public Model.LeaveType GetPrev(Model.LeaveType e)
 {
     return(accessor.GetPrev(e));
 }
예제 #18
0
 public void Update(Model.LeaveType e)
 {
     this.Update <Model.LeaveType>(e);
 }
예제 #19
0
 public bool HasRowsBefore(Model.LeaveType e)
 {
     return(accessor.HasRowsBefore(e));
 }