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

            return;
        }
Beispiel #2
0
        public bool ExistsExcept(Model.AtProject e)
        {
            Hashtable paras = new Hashtable();

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

            this.AtProject = AtProject;
        }
Beispiel #6
0
 private void Validate(Model.AtProject atProject)
 {
     if (string.IsNullOrEmpty(atProject.Id))
     {
         throw new Helper.RequireValueException(Model.AtProject.PRO_Id);
     }
     if (string.IsNullOrEmpty(atProject.ProjectName))
     {
         throw new Helper.RequireValueException(Model.AtProject.PRO_ProjectName);
     }
 }
Beispiel #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.AtProject productEpiboly = this.bindingSource1.Current as Model.AtProject;
                if (productEpiboly != null)
                {
                    this.AtProject = productEpiboly;
                    this.action    = "view";
                    this.Refresh();
                }
            }
        }
Beispiel #8
0
 protected override void MoveLast()
 {
     this.AtProject = this.AtProjectManager.GetLast();
 }
Beispiel #9
0
 public Model.AtProject GetPrev(Model.AtProject e)
 {
     return(sqlmapper.QueryForObject <Model.AtProject>("AtProject.get_prev", e));
 }
Beispiel #10
0
 public bool HasRowsAfter(Model.AtProject e)
 {
     return(accessor.HasRowsAfter(e));
 }
Beispiel #11
0
 public bool HasRowsAfter(Model.AtProject e)
 {
     return(sqlmapper.QueryForObject <bool>("AtProject.has_rows_after", e));
 }
Beispiel #12
0
 public Model.AtProject GetNext(Model.AtProject e)
 {
     return(sqlmapper.QueryForObject <Model.AtProject>("AtProject.get_next", e));
 }
Beispiel #13
0
 public bool HasRowsBefore(Model.AtProject e)
 {
     return(sqlmapper.QueryForObject <bool>("AtProject.has_rows_before", e));
 }
Beispiel #14
0
 public bool HasRowsBefore(Model.AtProject e)
 {
     return(accessor.HasRowsBefore(e));
 }
Beispiel #15
0
 protected override void AddNew()
 {
     this.AtProject = new Model.AtProject();
 }
Beispiel #16
0
 public Model.AtProject GetPrev(Model.AtProject e)
 {
     return(accessor.GetPrev(e));
 }
Beispiel #17
0
 public Model.AtProject GetNext(Model.AtProject e)
 {
     return(accessor.GetNext(e));
 }
Beispiel #18
0
 public void Insert(Model.AtProject e)
 {
     this.Insert <Model.AtProject>(e);
 }
Beispiel #19
0
 public void Update(Model.AtProject e)
 {
     this.Update <Model.AtProject>(e);
 }
Beispiel #20
0
        public override void Refresh()
        {
            if (this.AtProject == null)
            {
                this.AtProject = new Book.Model.AtProject();
                this.action    = "insert";
            }
            this.bindingSource1.DataSource = this.AtProjectManager.Select();

            this.textEditProjectId.Text       = this.AtProject.Id;
            this.textEditProjectName.Text     = this.AtProject.ProjectName;
            this.textEditProjectAddressd.Text = this.AtProject.ProjectAddressd;
            this.memoEditMark.Text            = this.AtProject.Mark;
            if (global::Helper.DateTimeParse.DateTimeEquls(this.AtProject.StartDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditStartDate.EditValue = null;
            }
            else
            {
                this.dateEditStartDate.EditValue = this.AtProject.StartDate;
            }
            if (global::Helper.DateTimeParse.DateTimeEquls(this.AtProject.EndDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditEndDate.EditValue = null;
            }
            else
            {
                this.dateEditEndDate.EditValue = this.AtProject.EndDate;
            }
            switch (this.action)
            {
            case "insert":
                this.textEditProjectId.Properties.ReadOnly           = false;
                this.textEditProjectName.Properties.ReadOnly         = false;
                this.textEditProjectAddressd.Properties.ReadOnly     = false;
                this.memoEditMark.Properties.ReadOnly                = false;
                this.dateEditStartDate.Properties.ReadOnly           = false;
                this.dateEditStartDate.Properties.Buttons[0].Visible = true;
                this.dateEditEndDate.Properties.ReadOnly             = false;
                this.dateEditEndDate.Properties.Buttons[0].Visible   = true;
                break;

            case "update":
                this.textEditProjectId.Properties.ReadOnly           = false;
                this.textEditProjectName.Properties.ReadOnly         = false;
                this.textEditProjectAddressd.Properties.ReadOnly     = false;
                this.memoEditMark.Properties.ReadOnly                = false;
                this.dateEditStartDate.Properties.ReadOnly           = false;
                this.dateEditStartDate.Properties.Buttons[0].Visible = true;
                this.dateEditEndDate.Properties.ReadOnly             = false;
                this.dateEditEndDate.Properties.Buttons[0].Visible   = true;
                break;

            case "view":
                this.textEditProjectId.Properties.ReadOnly           = true;
                this.textEditProjectName.Properties.ReadOnly         = true;
                this.textEditProjectAddressd.Properties.ReadOnly     = true;
                this.memoEditMark.Properties.ReadOnly                = true;
                this.dateEditStartDate.Properties.ReadOnly           = true;
                this.dateEditStartDate.Properties.Buttons[0].Visible = false;
                this.dateEditEndDate.Properties.ReadOnly             = true;
                this.dateEditEndDate.Properties.Buttons[0].Visible   = false;
                break;

            default:
                break;
            }
            base.Refresh();
        }
Beispiel #21
0
 public bool ExistsExcept(Model.AtProject e)
 {
     return(accessor.ExistsExcept(e));
 }