コード例 #1
0
        public override void Refresh()
        {
            if (this.academic == null)
            {
                this.academic = new Book.Model.AcademicBackGround();
                this.action   = "insert";
            }
            this.bindingSourceAcademic.DataSource = this.academickManager.Select();
            this.textEditName.Text        = this.academic.AcademicBackGroundName;
            this.textEditDescription.Text = this.academic.Description;

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

            case "update":
                this.textEditName.Properties.ReadOnly        = false;
                this.textEditDescription.Properties.ReadOnly = false;
                break;

            case "view":
                this.textEditName.Properties.ReadOnly        = true;
                this.textEditDescription.Properties.ReadOnly = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
コード例 #2
0
        protected override void Delete()
        {
            if (this.academic == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.academickManager.Delete(this.academic.AcademicBackGroundId);
                this.academic = this.academickManager.GetNext(this.academic);
                if (this.academic == null)
                {
                    this.academic = this.academickManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
コード例 #3
0
 /// <summary>
 /// Update a AcademicBackGround.
 /// </summary>
 public void Update(Model.AcademicBackGround academicBackGround)
 {
     //
     // todo: add other logic here.
     //
     Validate(academicBackGround);
     academicBackGround.UpdateTime = DateTime.Now;
     accessor.Update(academicBackGround);
 }
コード例 #4
0
 /// <summary>
 /// gridview1单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void gridView1_Click(object sender, EventArgs e)
 {
     Model.AcademicBackGround academic = this.bindingSource_Academic.Current as Model.AcademicBackGround;
     if (academic != null)
     {
         this.academ = academic;
         this.action = "view";
         this.Refresh();
     }
 }
コード例 #5
0
        protected override void MoveNext()
        {
            Model.AcademicBackGround academic = this.academickManager.GetNext(this.academic);
            if (academic == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.academic = academic;
        }
コード例 #6
0
        public void MyClick(ref ChooseItem item)
        {
            ChooseAcademicBackGroundForm f = new ChooseAcademicBackGroundForm();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.AcademicBackGround academic = f.SelectedItem as Model.AcademicBackGround;
                item = new ChooseItem(academic, academic.AcademicBackGroundId, academic.AcademicBackGroundName);
            }
        }
コード例 #7
0
 private void Validate(Model.AcademicBackGround academic)
 {
     if (string.IsNullOrEmpty(academic.AcademicBackGroundName))
     {
         throw new Helper.RequireValueException(Model.AcademicBackGround.PROPERTY_ACADEMICBACKGROUNDNAME);
     }
     if (accessor.IsExistName(academic.AcademicBackGroundId, academic.AcademicBackGroundName))
     {
         throw new Helper.InvalidValueException(Model.AcademicBackGround.PROPERTY_ACADEMICBACKGROUNDNAME);
     }
 }
コード例 #8
0
        /// <summary>
        /// Insert a AcademicBackGround.
        /// </summary>
        public void Insert(Model.AcademicBackGround academicBackGround)
        {
            //
            // todo:add other logic here
            //
            Validate(academicBackGround);
            academicBackGround.InsertTime           = DateTime.Now;
            academicBackGround.AcademicBackGroundId = Guid.NewGuid().ToString();

            accessor.Insert(academicBackGround);
        }
コード例 #9
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.AcademicBackGroundManager academicManager = new Book.BL.AcademicBackGroundManager();
     Model.AcademicBackGround     academic        = academicManager.Get(item.ButtonText);
     if (academic != null)
     {
         item.EditValue  = academic;
         item.LabelText  = academic.AcademicBackGroundName;
         item.ButtonText = academic.AcademicBackGroundId;
     }
     else
     {
         item.ErrorMessage = Properties.Resources.ChooseEmployeeError;
     }
 }
コード例 #10
0
        private void gridView1_Click_1(object sender, EventArgs e)
        {
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position));

            if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle))
            {
                Model.AcademicBackGround academic = this.bindingSourceAcademic.Current as Model.AcademicBackGround;
                if (academic != null)
                {
                    this.academic = academic;
                    this.action   = "view";
                    this.Refresh();
                }
            }
        }
コード例 #11
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;
            }
        }
コード例 #12
0
 protected override void AddNew()
 {
     this.academic = new Model.AcademicBackGround();
 }
コード例 #13
0
 /// <summary>
 /// 函數名稱EditForm
 /// </summary>
 /// <param name="academic">學歷對象</param>
 /// <param name="action">動作</param>
 public EditForm(Model.AcademicBackGround academic, string action)
 {
     this.academic = academic;
     this.action   = action;
 }
コード例 #14
0
 /// <summary>
 ///  函數名稱EditForm
 /// </summary>
 /// <param name="academic">學歷</param>
 public EditForm(Model.AcademicBackGround academic)
 {
     this.academic = academic;
     this.action   = "update";
 }
コード例 #15
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;
            }
        }
コード例 #16
0
 public bool HasRowsBefore(Model.AcademicBackGround e)
 {
     return(sqlmapper.QueryForObject <bool>("AcademicBackGround.has_rows_before", e));
 }
コード例 #17
0
 public Model.AcademicBackGround GetNext(Model.AcademicBackGround e)
 {
     return(accessor.GetNext(e));
 }
コード例 #18
0
 public bool HasRowsBefore(Model.AcademicBackGround e)
 {
     return(accessor.HasRowsBefore(e));
 }
コード例 #19
0
 public Model.AcademicBackGround GetPrev(Model.AcademicBackGround e)
 {
     return(sqlmapper.QueryForObject <Model.AcademicBackGround>("AcademicBackGround.get_prev", e));
 }
コード例 #20
0
 public Model.AcademicBackGround GetNext(Model.AcademicBackGround e)
 {
     return(sqlmapper.QueryForObject <Model.AcademicBackGround>("AcademicBackGround.get_next", e));
 }
コード例 #21
0
 public bool HasRowsAfter(Model.AcademicBackGround e)
 {
     return(sqlmapper.QueryForObject <bool>("AcademicBackGround.has_rows_after", e));
 }
コード例 #22
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();
        }
コード例 #23
0
 public void Insert(Model.AcademicBackGround e)
 {
     this.Insert <Model.AcademicBackGround>(e);
 }
コード例 #24
0
 protected override void MoveLast()
 {
     this.academic = this.academickManager.GetLast();
 }
コード例 #25
0
 public bool HasRowsAfter(Model.AcademicBackGround e)
 {
     return(accessor.HasRowsAfter(e));
 }
コード例 #26
0
 public void Update(Model.AcademicBackGround e)
 {
     this.Update <Model.AcademicBackGround>(e);
 }