Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void Delete()
        {
            if (this.AtInvoiceSet == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.AtInvoiceSetManager.Delete(this.AtInvoiceSet.Id);
                this.AtInvoiceSet = this.AtInvoiceSetManager.GetNext(this.AtInvoiceSet);
                if (this.AtInvoiceSet == null)
                {
                    this.AtInvoiceSet = this.AtInvoiceSetManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
Exemple #2
0
        public override void Refresh()
        {
            if (this.AtInvoiceSet == null)
            {
                this.AtInvoiceSet = new Book.Model.AtInvoiceSet();
                this.action       = "insert";
            }
            this.bindingSource1.DataSource         = this.AtInvoiceSetManager.Select();
            this.comboBoxEditInvoiceYear.EditValue = this.AtInvoiceSet.InvoiceYear;
            this.comboBoxEditStartMaths.EditValue  = this.AtInvoiceSet.StartMaths;
            this.comboBoxEditEndMaths.EditValue    = this.AtInvoiceSet.EndMaths;
            this.comboBoxEditInvoiceForm.EditValue = this.AtInvoiceSet.InvoiceForm;
            this.textEditStartInvoiceId.Text       = this.AtInvoiceSet.StartInvoiceId;
            this.textEditEndInvoiceId.Text         = this.AtInvoiceSet.EndInvoiceId;
            this.textEditTheId.Text             = this.AtInvoiceSet.TheId;
            this.textEditInvoiceWord.Text       = this.AtInvoiceSet.InvoiceWord;
            this.spinEditInvoiceCount.EditValue = this.AtInvoiceSet.InvoiceCount;
            switch (this.action)
            {
            case "insert":
                this.comboBoxEditInvoiceYear.Properties.ReadOnly = false;
                this.comboBoxEditStartMaths.Properties.ReadOnly  = false;
                this.comboBoxEditEndMaths.Properties.ReadOnly    = false;
                this.comboBoxEditInvoiceForm.Properties.ReadOnly = false;
                this.textEditStartInvoiceId.Properties.ReadOnly  = false;
                this.textEditEndInvoiceId.Properties.ReadOnly    = false;
                this.textEditTheId.Properties.ReadOnly           = false;
                this.textEditInvoiceWord.Properties.ReadOnly     = false;
                this.spinEditInvoiceCount.Properties.ReadOnly    = false;
                break;

            case "update":
                this.comboBoxEditInvoiceYear.Properties.ReadOnly = false;
                this.comboBoxEditStartMaths.Properties.ReadOnly  = false;
                this.comboBoxEditEndMaths.Properties.ReadOnly    = false;
                this.comboBoxEditInvoiceForm.Properties.ReadOnly = false;
                this.textEditStartInvoiceId.Properties.ReadOnly  = false;
                this.textEditEndInvoiceId.Properties.ReadOnly    = false;
                this.textEditTheId.Properties.ReadOnly           = false;
                this.textEditInvoiceWord.Properties.ReadOnly     = false;
                this.spinEditInvoiceCount.Properties.ReadOnly    = false;
                break;

            case "view":
                this.comboBoxEditInvoiceYear.Properties.ReadOnly = true;
                this.comboBoxEditStartMaths.Properties.ReadOnly  = true;
                this.comboBoxEditEndMaths.Properties.ReadOnly    = true;
                this.comboBoxEditInvoiceForm.Properties.ReadOnly = true;
                this.textEditStartInvoiceId.Properties.ReadOnly  = true;
                this.textEditEndInvoiceId.Properties.ReadOnly    = true;
                this.textEditTheId.Properties.ReadOnly           = true;
                this.textEditInvoiceWord.Properties.ReadOnly     = true;
                this.spinEditInvoiceCount.Properties.ReadOnly    = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
        public bool ExistsExcept(Model.AtInvoiceSet e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.Id) == null?null:Get(e.Id).Id);
            return(sqlmapper.QueryForObject <bool>("AtInvoiceSet.existsexcept", paras));
        }
 /// <summary>
 /// Update a AtInvoiceSet.
 /// </summary>
 public void Update(Model.AtInvoiceSet atInvoiceSet)
 {
     //
     // todo: add other logic here.
     //
     atInvoiceSet.UpdateTime = DateTime.Now;
     accessor.Update(atInvoiceSet);
 }
 /// <summary>
 /// Insert a AtInvoiceSet.
 /// </summary>
 public void Insert(Model.AtInvoiceSet atInvoiceSet)
 {
     //
     // todo:add other logic here
     //
     atInvoiceSet.Id         = Guid.NewGuid().ToString();
     atInvoiceSet.InsertTime = DateTime.Now;
     accessor.Insert(atInvoiceSet);
 }
Exemple #6
0
        protected override void MoveNext()
        {
            Model.AtInvoiceSet AtInvoiceSet = this.AtInvoiceSetManager.GetNext(this.AtInvoiceSet);
            if (AtInvoiceSet == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.AtInvoiceSet = AtInvoiceSet;
        }
Exemple #7
0
        private void gridView1_Click(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.AtInvoiceSet productEpiboly = this.bindingSource1.Current as Model.AtInvoiceSet;
                if (productEpiboly != null)
                {
                    this.AtInvoiceSet = productEpiboly;
                    this.action       = "view";
                    this.Refresh();
                }
            }
        }
Exemple #8
0
 public bool HasRowsBefore(Model.AtInvoiceSet e)
 {
     return(accessor.HasRowsBefore(e));
 }
Exemple #9
0
 protected override void AddNew()
 {
     this.AtInvoiceSet = new Model.AtInvoiceSet();
 }
 public void Insert(Model.AtInvoiceSet e)
 {
     this.Insert <Model.AtInvoiceSet>(e);
 }
Exemple #11
0
 protected override void MoveLast()
 {
     this.AtInvoiceSet = this.AtInvoiceSetManager.GetLast();
 }
Exemple #12
0
 public Model.AtInvoiceSet GetPrev(Model.AtInvoiceSet e)
 {
     return(accessor.GetPrev(e));
 }
Exemple #13
0
 public Model.AtInvoiceSet GetNext(Model.AtInvoiceSet e)
 {
     return(accessor.GetNext(e));
 }
 public void Update(Model.AtInvoiceSet e)
 {
     this.Update <Model.AtInvoiceSet>(e);
 }
Exemple #15
0
 public bool HasRowsAfter(Model.AtInvoiceSet e)
 {
     return(accessor.HasRowsAfter(e));
 }
Exemple #16
0
 public bool ExistsExcept(Model.AtInvoiceSet e)
 {
     return(accessor.ExistsExcept(e));
 }
 public Model.AtInvoiceSet GetPrev(Model.AtInvoiceSet e)
 {
     return(sqlmapper.QueryForObject <Model.AtInvoiceSet>("AtInvoiceSet.get_prev", e));
 }
 public Model.AtInvoiceSet GetNext(Model.AtInvoiceSet e)
 {
     return(sqlmapper.QueryForObject <Model.AtInvoiceSet>("AtInvoiceSet.get_next", e));
 }
 public bool HasRowsAfter(Model.AtInvoiceSet e)
 {
     return(sqlmapper.QueryForObject <bool>("AtInvoiceSet.has_rows_after", e));
 }
 public bool HasRowsBefore(Model.AtInvoiceSet e)
 {
     return(sqlmapper.QueryForObject <bool>("AtInvoiceSet.has_rows_before", e));
 }