Ejemplo n.º 1
0
        /// <summary>
        /// Insert a TempCard.
        /// </summary>
        public void Insert(Model.TempCard tempCard)
        {
            //
            // todo:add other logic here
            //
            Validate(tempCard);



            tempCard.InsertTime = DateTime.Now;

            try
            {
                BL.V.BeginTransaction();
                accessor.Insert(tempCard);
                if (DateTime.Now.Date > tempCard.DutyDate.Value.Date)
                {
                    hrDatilyManager.ReCheck(tempCard.DutyDate.Value.Date, tempCard.Employee);
                }
                BL.V.CommitTransaction();
            }
            catch (Exception ex)
            {
                BL.V.RollbackTransaction();
                throw ex;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Update a TempCard.
 /// </summary>
 public void Update(Model.TempCard tempCard)
 {
     //
     // todo: add other logic here.
     //
     Validate(tempCard);
     tempCard.UpdateTime = DateTime.Now;
     accessor.Update(tempCard);
 }
Ejemplo n.º 3
0
 private void TempCardSource1_CurrentChanged(object sender, EventArgs e)
 {
     Model.TempCard tempcard = this.TempCardSource1.Current as Model.TempCard;
     if (tempcard != null)
     {
         this.currentTempcard = tempcard;
         this.action          = "view";
         this.Refresh();
     }
 }
Ejemplo n.º 4
0
 public void Validate(Model.TempCard tempcard)
 {
     if (string.IsNullOrEmpty(tempcard.CardNo))
     {
         throw new Helper.RequireValueException(Model.TempCard.PROPERTY_CARDNO);
     }
     if (string.IsNullOrEmpty(tempcard.EmployeeId))
     {
         throw new Helper.RequireValueException(Model.TempCard.PROPERTY_EMPLOYEEID);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 删除
 /// </summary>
 protected override void Delete()
 {
     this.currentTempcard = this.TempCardSource1.Current as Model.TempCard;
     if (this.currentTempcard != null)
     {
         if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             this.tempcardmanage.Delete(this.currentTempcard.TempCardId);
         }
         this.TempCardSource1.DataSource = tempcardmanage.SelectbyDateTop();
     }
 }
Ejemplo n.º 6
0
 public void Delete(Model.TempCard tempCard)
 {
     try
     {
         BL.V.BeginTransaction();
         this.Delete(tempCard.TempCardId);
         if (DateTime.Now.Date > tempCard.DutyDate.Value.Date)
         {
             hrDatilyManager.ReCheck(tempCard.DutyDate.Value.Date, tempCard.Employee);
         }
         BL.V.CommitTransaction();
     }
     catch (Exception ex)
     {
         BL.V.RollbackTransaction();
         throw ex;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 初始化
        /// </summary>
        public override void Refresh()
        {
            if (this.currentTempcard == null)
            {
                this.currentTempcard = new Book.Model.TempCard();
                this.action          = "insert";
            }

            //this.lookUpEdit_IDNO.EditValue = this.currentTempcard.EmployeeId;
            //this.textEdit_CardNo.EditValue = this.currentTempcard.CardNo;

            this.newChooseEmployeeId.EditValue = this.currentTempcard.Employee;
            this.textEdit_CardNo.EditValue     = this.currentTempcard.CardNo;
            this.dateEdit_DutyDate.EditValue   = this.currentTempcard.DutyDate;

            switch (this.action)
            {
            case "insert":
                this.barButtonItem2.Enabled = false;
                this.textEdit_CardNo.Properties.ReadOnly   = false;
                this.dateEdit_DutyDate.Properties.ReadOnly = false;
                break;

            case "update":
                this.barButtonItem2.Enabled = false;
                this.textEdit_CardNo.Properties.ReadOnly   = false;
                this.dateEdit_DutyDate.Properties.ReadOnly = false;
                break;

            case "view":
                this.barButtonItem2.Enabled = true;
                this.textEdit_CardNo.Properties.ReadOnly   = true;
                this.dateEdit_DutyDate.Properties.ReadOnly = true;
                break;
            }
            base.Refresh();
        }
Ejemplo n.º 8
0
 //新增
 protected override void AddNew()
 {
     this.currentTempcard            = new Book.Model.TempCard();
     this.currentTempcard.TempCardId = Guid.NewGuid().ToString();
     this.currentTempcard.DutyDate   = DateTime.Now.Date;
 }
Ejemplo n.º 9
0
 public Model.TempCard GetNext(Model.TempCard e)
 {
     return(sqlmapper.QueryForObject <Model.TempCard>("TempCard.get_next", e));
 }
Ejemplo n.º 10
0
 public bool HasRowsBefore(Model.TempCard e)
 {
     return(sqlmapper.QueryForObject <bool>("TempCard.has_rows_before", e));
 }
Ejemplo n.º 11
0
 public Model.TempCard GetNext(Model.TempCard e)
 {
     return(accessor.GetNext(e));
 }
Ejemplo n.º 12
0
 public Model.TempCard GetPrev(Model.TempCard e)
 {
     return(accessor.GetPrev(e));
 }
Ejemplo n.º 13
0
 public bool HasRowsAfter(Model.TempCard e)
 {
     return(accessor.HasRowsAfter(e));
 }
Ejemplo n.º 14
0
 public bool HasRowsBefore(Model.TempCard e)
 {
     return(accessor.HasRowsBefore(e));
 }
Ejemplo n.º 15
0
 public void Insert(Model.TempCard e)
 {
     this.Insert <Model.TempCard>(e);
 }
Ejemplo n.º 16
0
 public void Update(Model.TempCard e)
 {
     this.Update <Model.TempCard>(e);
 }
Ejemplo n.º 17
0
 protected override void MoveNext()
 {
     this.currentTempcard = tempcardmanage.GetNext(this.currentTempcard);
 }
Ejemplo n.º 18
0
 public bool HasRowsAfter(Model.TempCard e)
 {
     return(sqlmapper.QueryForObject <bool>("TempCard.has_rows_after", e));
 }
Ejemplo n.º 19
0
 protected override void MoveLast()
 {
     this.currentTempcard = tempcardmanage.GetLast();
 }
Ejemplo n.º 20
0
 public Model.TempCard GetPrev(Model.TempCard e)
 {
     return(sqlmapper.QueryForObject <Model.TempCard>("TempCard.get_prev", e));
 }
Ejemplo n.º 21
0
 protected override void MovePrev()
 {
     this.currentTempcard = tempcardmanage.GetPrev(this.currentTempcard);
 }