Ejemplo n.º 1
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;
            }

            if (Utilities.IsNullOrEmpty(this.serial.Text))
            {
                vehicle = new Vehicle();

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

                this.setControlReadOnly(false);

                this.isUpdate = false;
            }
            else
            {
                vehicle = VehicleDao.GetBySerial(this.serial.Text);
                if (vehicle != null)
                {
                    this.setControlReadOnly(false);

                    this.isUpdate = true;

                    SetVehicleInfo(vehicle);

                    this.SetOriginCustomer(vehicle.OriginCustomer);

                    this.SetCurrentCustomer(vehicle.CurrentCustomer);
                }
                else
                {
                    this.serial.Focus();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 点击复制按钮时,取得最新流水号,并置控件为可编辑状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void copyBtn_Click(object sender, EventArgs e)
        {
            this.serial.Text = VehicleDao.GetLatestSerial();
            this.setControlReadOnly(false);
            this.originPic.Image   = global::VTMS.Properties.Resources.NoneImage;
            this.currentPic.Image  = global::VTMS.Properties.Resources.NoneImage;
            this.pictureBox1.Image = null;
            this.pictureBox2.Image = null;
            this.pictureBox3.Image = null;
            this.pictureBox4.Image = null;

            this.Isrecorded.Checked   = false;
            this.Ischarged.Checked    = false;
            this.Isprstringed.Checked = false;
            this.Isrefund.Checked     = false;
            this.Isgrant.Checked      = false;

            vehicle             = new Vehicle();
            vehicle.Vehicletype = new Vehicletype();
            vehicle.Company     = new Company();

            this.invoice.Focus();
            this.isUpdate = false;
        }