Exemple #1
0
 public void EditPrice(int ID, pk_Price price)
 {
     pk_Price _object = PKData.pk_Prices.FirstOrDefault(x => x.ID == ID);
     _object.VehicleType = price.VehicleType;
     _object.Price = price.Price;
     _object.Note = price.Note;
     PKData.SubmitChanges();
 }
Exemple #2
0
 public void EditPrice(int ID, string type, decimal price, string note)
 {
     pk_Price _object = new pk_Price();
     _object.VehicleType = type;
     _object.Price = price;
     _object.Note = note;
     exec.EditPrice(ID, _object);
 }
        private void btnCheckIDCard_Click(object sender, EventArgs e)
        {
            try
            {
                PKDataContext pkdata = new PKDataContext(clsDeclare.gblConnectStringLinQ);
                //Kiem tra xem thẻ này là thế nào
                //pk_In_Out pkIn = new pk_In_Out();
                var pkIn = new Execute(pkdata).GetSinglePKIn(txtRFID.Text);

                //pk_In_Out pkOut = new pk_In_Out();
                var pkOut = new Execute(pkdata).GetSinglePKOut(txtRFID.Text);
                if (pkIn != null)
                {
                    if (pkIn.IsOut == false)
                    {
                        decimal price = new Execute(pkdata).GetPriceByID(pkIn.VehicleTypeID ?? 0);
                        txtPrice.Text = string.Format("{0}", price);
                        txtNumber.Text = pkIn.Number;
                        teTimeIn.EditValue = pkIn.TimeIn;
                        labelControl1.Enabled = true;
                        labelControl1.Text = "Xe này chưa ra khỏi bãi";
                        btnOK.Enabled = true;
                    }
                }
                if (pkOut != null)
                {
                    if (pkOut.IsOut == true)
                    {
                        //Lấy hết dữ liệu ra --- mới vào chưa ra
                        //Nếu tồn tại ID này đã ra -- có trong danh sách xe đã ra
                        pk_Price pkPice = new pk_Price();
                        decimal price = new Execute(pkdata).GetPriceByID(pkOut.VehicleTypeID ?? 0);
                        txtPrice.Text = string.Format("{0}", price);
                        txtNumber.Text = pkOut.Number;
                        teTimeIn.EditValue = pkOut.TimeIn;
                        teTimeOut.EditValue = pkOut.TimeOut; //xe nay da ra khỏi bãi
                        labelControl1.Enabled = true;
                        labelControl1.Text = "Xe này đã ra khỏi bãi";
                        btnOK.Enabled = false;
                    }
                }

            }

            catch
            {
                MessageBox.Show("Co loi ne");
            }
        }
Exemple #4
0
 public void SavePrice(pk_Price price)
 {
     PKData.pk_Prices.InsertOnSubmit(price);
     PKData.SubmitChanges();
 }
Exemple #5
0
 public void SavePrice(string type, decimal price, string note)
 {
     pk_Price _object = new pk_Price();
     _object.VehicleType = type;
     _object.Price = price;
     _object.Note = note;
     SavePrice(_object);
 }
Exemple #6
0
 public void SavePrice(pk_Price price)
 {
     _dataContext.pk_Prices.InsertOnSubmit(price);
     _dataContext.SubmitChanges();
 }