Beispiel #1
0
 protected override void MoveLast()
 {
     if (this.company == null)
     {
         this.company = this.companyManager.GetLast();
     }
 }
Beispiel #2
0
        public EditForm(Model.FreightedCompany company, string action)
            : this()

        {
            this.company = company;
            this.action  = action;
        }
        public bool ExistsExcept(Model.FreightedCompany e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.FreightedCompanyId).Id);
            return(sqlmapper.QueryForObject <bool>("FreightedCompany.existsexcept", paras));
        }
Beispiel #4
0
 protected override void MoveNext()
 {
     Model.FreightedCompany company = this.companyManager.GetNext(this.company);
     if (company == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.company = company;
 }
 private void Vilidate(Model.FreightedCompany freightedCompany)
 {
     if (string.IsNullOrEmpty(freightedCompany.Id))
     {
         throw new Helper.RequireValueException(Model.FreightedCompany.PROPERTY_ID);
     }
     if (string.IsNullOrEmpty(freightedCompany.FreightedCompanyName))
     {
         throw new Helper.RequireValueException(Model.FreightedCompany.PROPERTY_FREIGHTEDCOMPANYNAME);
     }
 }
 /// <summary>
 /// Update a FreightedCompany.
 /// </summary>
 public void Update(Model.FreightedCompany freightedCompany)
 {
     //
     // todo: add other logic here.
     //
     Vilidate(freightedCompany);
     if (this.ExistsExcept(freightedCompany))
     {
         throw new Helper.InvalidValueException(Model.FreightedCompany.PROPERTY_ID);
     }
     accessor.Update(freightedCompany);
 }
 /// <summary>
 /// Insert a FreightedCompany.
 /// </summary>
 public void Insert(Model.FreightedCompany freightedCompany)
 {
     //
     // todo:add other logic here
     //
     Vilidate(freightedCompany);
     if (this.Exists(freightedCompany.Id))
     {
         throw new Helper.InvalidValueException(Model.FreightedCompany.PROPERTY_ID);
     }
     freightedCompany.FreightedCompanyId = Guid.NewGuid().ToString();
     accessor.Insert(freightedCompany);
 }
Beispiel #8
0
 protected override void Delete()
 {
     if (this.company == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
     {
         return;
     }
     this.companyManager.Delete(this.company.FreightedCompanyId);
     this.company = this.companyManager.GetNext(this.company);
     if (this.company == null)
     {
         this.company = this.companyManager.GetLast();
     }
 }
Beispiel #9
0
        public override void Refresh()
        {
            if (this.company == null)
            {
                this.company = new Book.Model.FreightedCompany();
                this.action  = "insert";
            }
            this.textEditId.Text          = (string.IsNullOrEmpty(this.company.Id) ? this.company.FreightedCompanyId : this.company.Id);
            this.textEditName.Text        = this.company.FreightedCompanyName;
            this.textEditAdd.Text         = this.company.FreightedCompanyAddress;
            this.textEditTel.Text         = this.company.Telphone;
            this.memoEditDescription.Text = this.company.Description;
            switch (this.action)
            {
            case "insert":
                this.textEditId.Properties.ReadOnly          = false;
                this.textEditName.Properties.ReadOnly        = false;
                this.textEditAdd.Properties.ReadOnly         = false;
                this.textEditTel.Properties.ReadOnly         = false;
                this.memoEditDescription.Properties.ReadOnly = false;
                break;

            case "update":

                this.textEditId.Properties.ReadOnly          = false;
                this.textEditName.Properties.ReadOnly        = false;
                this.textEditAdd.Properties.ReadOnly         = false;
                this.textEditTel.Properties.ReadOnly         = false;
                this.memoEditDescription.Properties.ReadOnly = false;
                break;

            case "view":

                this.textEditId.Properties.ReadOnly          = true;
                this.textEditName.Properties.ReadOnly        = true;
                this.textEditAdd.Properties.ReadOnly         = true;
                this.textEditTel.Properties.ReadOnly         = true;
                this.memoEditDescription.Properties.ReadOnly = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
 public bool HasRowsBefore(Model.FreightedCompany e)
 {
     return(accessor.HasRowsBefore(e));
 }
 public void Insert(Model.FreightedCompany e)
 {
     this.Insert <Model.FreightedCompany>(e);
 }
Beispiel #12
0
 public EditForm(Model.FreightedCompany company)
     : this()
 {
     this.company = company;
     this.action  = "update";
 }
Beispiel #13
0
 protected override void MoveFirst()
 {
     this.company = this.companyManager.GetFirst();
 }
 public void Update(Model.FreightedCompany e)
 {
     this.Update <Model.FreightedCompany>(e);
 }
Beispiel #15
0
 protected override void AddNew()
 {
     this.company = new Model.FreightedCompany();
     //this.company.CustomInspectionRuleId = this.companyManager.GetId();
 }
 public bool HasRowsBefore(Model.FreightedCompany e)
 {
     return(sqlmapper.QueryForObject <bool>("FreightedCompany.has_rows_before", e));
 }
 public Model.FreightedCompany GetPrev(Model.FreightedCompany e)
 {
     return(accessor.GetPrev(e));
 }
 public Model.FreightedCompany GetNext(Model.FreightedCompany e)
 {
     return(accessor.GetNext(e));
 }
 public bool HasRowsAfter(Model.FreightedCompany e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public bool HasRowsAfter(Model.FreightedCompany e)
 {
     return(sqlmapper.QueryForObject <bool>("FreightedCompany.has_rows_after", e));
 }
 public bool ExistsExcept(Model.FreightedCompany e)
 {
     return(accessor.ExistsExcept(e));
 }
 public Model.FreightedCompany GetPrev(Model.FreightedCompany e)
 {
     return(sqlmapper.QueryForObject <Model.FreightedCompany>("FreightedCompany.get_prev", e));
 }
 public Model.FreightedCompany GetNext(Model.FreightedCompany e)
 {
     return(sqlmapper.QueryForObject <Model.FreightedCompany>("FreightedCompany.get_next", e));
 }