Esempio n. 1
0
 public static void Update(Register entity)
 {
     using (ISession session = SessionFactory.OpenSession())
     {
         session.Update(entity);
         session.Flush();
     }
 }
Esempio n. 2
0
 public static object Add(Register entity)
 {
     entity.Serial = GetLatestSerial();
     using (ISession session = SessionFactory.OpenSession())
     {
         var id = session.Save(entity);
         session.Flush();
         return id;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 根据获得的注册信息设置控件内容
 /// </summary>
 /// <param name="register"></param>
 private void setRegisterInfo(Register register)
 {
     this.category.Text = register.Category;
     this.license.Text = register.License;
     this.apply.Text = register.Apply;
     this.revoke.Text = register.Revoke;
     this.brand.Text = register.Brand;
     this.vin.Text = register.Vin;
     this.obtain.Text = register.Obtain;
     this.purpose.Text = register.Purpose;
     this.ownerName.Text = register.OwnerName;
     this.ownerAddress.Text = register.OwnerAddress;
     this.ownerPostcode.Text = register.OwnerPostcode;
     this.ownerPhone.Text = register.OwnerPhone;
     this.ownerEmail.Text = register.OwnerEmail;
     this.ownerMobile.Text = register.OwnerMobile;
     this.province.Text = register.Province;
     this.department.Text = register.Department;
     this.agentName.Text = register.AgentName;
     this.agentPhone.Text = register.AgentPhone;
     this.agentPostcode.Text = register.AgentPostcode;
     this.agentAddress.Text = register.AgentAddress;
     this.agentEmail.Text = register.AgentEmail;
     this.handlerName.Text = register.HandlerName;
     this.handlerPhone.Text = register.HandlerPhone;
 }
Esempio n. 4
0
        /// <summary>
        /// 当光标焦点至于流水号时,用户回车产生新的流水号或获取流水号对应数据信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void serial_Leave(object sender, EventArgs e)
        {
            if (this.serial.ReadOnly || (this.serial.Text.Length != 11 && this.serial.Text.Length != 0))
                return;

            //InitComboBox();

            if (Utilities.IsNullOrEmpty(this.serial.Text))
            {
                register = new Register();

                this.serial.Text = RegisterDao.GetLatestSerial();

                this.setControlReadOnly(false);

                this.category.Focus();

                this.isUpdate = false;
            }
            else
            {
                register = RegisterDao.GetBySerial(this.serial.Text);

                if (register != null)
                {
                    this.setControlReadOnly(false);

                    this.isUpdate = true;

                    setRegisterInfo(register);

                    this.category.Focus();
                }
                else
                {
                    this.serial.Focus();
                }
            }
        }