コード例 #1
0
 /// <summary>
 /// Update a BusinessHours.
 /// </summary>
 public void Update(Model.BusinessHours businessHours)
 {
     //
     // todo: add other logic here.
     //
     Validate(businessHours);
     businessHours.UpdateTime = DateTime.Now;
     accessor.Update(businessHours);
 }
コード例 #2
0
 /// <summary>
 /// Insert a BusinessHours.
 /// </summary>
 public void Insert(Model.BusinessHours businessHours)
 {
     //
     // todo:add other logic here
     //
     Validate(businessHours);
     businessHours.InsertTime      = DateTime.Now;
     businessHours.BusinessHoursId = Guid.NewGuid().ToString();
     accessor.Insert(businessHours);
 }
コード例 #3
0
 /// <summary>
 /// gridview5单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView5_Click(object sender, EventArgs e)
 {
     Model.BusinessHours business = this.bindingSource_BusinessHours.Current as Model.BusinessHours;
     if (business != null)
     {
         this.currentbusinessHours = business;
         this.action = "view";
         this.Refresh();
     }
 }
コード例 #4
0
 private void Validate(Model.BusinessHours businessHours)
 {
     if (string.IsNullOrEmpty(businessHours.BusinessHoursName))
     {
         throw new Helper.RequireValueException(Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
     }
     if (accessor.IsExistsBusinessName(businessHours.BusinessHoursId, businessHours.BusinessHoursName))
     {
         throw new Helper.InvalidValueException(Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
     }
 }
コード例 #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 Model.BusinessHours GetNext(Model.BusinessHours e)
 {
     return(sqlmapper.QueryForObject <Model.BusinessHours>("BusinessHours.get_next", e));
 }
コード例 #7
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();
        }
コード例 #8
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;
            }
        }
コード例 #9
0
 public Model.BusinessHours GetNext(Model.BusinessHours e)
 {
     return(accessor.GetNext(e));
 }
コード例 #10
0
 public Model.BusinessHours GetPrev(Model.BusinessHours e)
 {
     return(accessor.GetPrev(e));
 }
コード例 #11
0
 public bool HasRowsAfter(Model.BusinessHours e)
 {
     return(accessor.HasRowsAfter(e));
 }
コード例 #12
0
 public bool HasRowsBefore(Model.BusinessHours e)
 {
     return(accessor.HasRowsBefore(e));
 }
コード例 #13
0
 public Model.BusinessHours GetPrev(Model.BusinessHours e)
 {
     return(sqlmapper.QueryForObject <Model.BusinessHours>("BusinessHours.get_prev", e));
 }
コード例 #14
0
 public bool HasRowsAfter(Model.BusinessHours e)
 {
     return(sqlmapper.QueryForObject <bool>("BusinessHours.has_rows_after", e));
 }
コード例 #15
0
 public bool HasRowsBefore(Model.BusinessHours e)
 {
     return(sqlmapper.QueryForObject <bool>("BusinessHours.has_rows_before", e));
 }
コード例 #16
0
 public void Update(Model.BusinessHours e)
 {
     this.Update <Model.BusinessHours>(e);
 }
コード例 #17
0
 public void Insert(Model.BusinessHours e)
 {
     this.Insert <Model.BusinessHours>(e);
 }