Example #1
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            WayBill wayBill = new WayBill();

            wayBill.ID            = Guid.NewGuid();
            wayBill.DriverID      = (Guid)cmb_driver.SelectedValue;
            wayBill.SenderID      = (Guid)cmb_sender.SelectedValue;
            wayBill.ReceiverID    = (Guid)cmb_receiver.SelectedValue;
            wayBill.VehicleID     = (Guid)cmb_vechile.SelectedValue;
            wayBill.ShipmentDate  = dtp_shipmentDate.Value;
            wayBill.DeliveryDate  = dtp_deliveryDate.Value;
            wayBill.BillType      = Convert.ToByte(cmb_billType.SelectedValue);
            wayBill.CreatedDate   = DateTime.Now;
            wayBill.CreatedUserID = Session.CurrentUser.ID;


            foreach (var item in _wayBillDetail)
            {
                wayBill.WayBillDetails.Add(item);
            }
            Db.Context.WayBills.Add(wayBill);
            Db.Context.KontrolluKaydet();
            _wayBillDetail.Clear();
            WayBillLoad();
        }
Example #2
0
 private void SeciliCombo()
 {
     _wayBill = cmbIrsaliyeID.SelectedItem as WayBill;
     cmb_billType.SelectedValue = Convert.ToInt32(_wayBill.BillType);
     cmb_driver.SelectedValue   = _wayBill.DriverID;
     cmb_receiver.SelectedValue = _wayBill.ReceiverID;
     cmb_sender.SelectedValue   = _wayBill.SenderID;
     cmb_vechile.SelectedValue  = _wayBill.VehicleID;
     _wayBillDetail             = (from w in Db.Context.WayBillDetails where w.WaybillID == _wayBill.ID select w).ToList();
     WayBillLoad();
     cmbProduct.SelectedValue = _wayBillDetail.Select(p => p.ProductID);
 }
Example #3
0
 public FormWayBillUpdate()
 {
     InitializeComponent();
     _wayBill       = new WayBill();
     _wayBillDetail = new List <WayBillDetail>();
 }