Exemplo n.º 1
0
        private void btnDeleteOut_Click(object sender, EventArgs e)
        {
            VOut  vOut  = this.GetFirstSelectedVOut();
            InOut inOut = DAL.GetInOutByVOut(vOut);

            if (vOut != null)
            {
                if (DAL.DeleteInOut(inOut))
                {
                    this.ViewAll();
                }
            }
        }
Exemplo n.º 2
0
        private void btnEditOut_Click(object sender, EventArgs e)
        {
            VOut vOut = this.GetFirstSelectedVOut();

            if (vOut != null)
            {
                InOut    inOut  = DAL.GetInOutByVOut(vOut);
                int      oldId  = inOut.ID;
                frmInOut editor = new frmInOut(inOut);
                if (editor.ShowDialog() == DialogResult.OK)
                {
                    if (DAL.EditInOut(oldId, inOut))
                    {
                        this.ViewAll();
                    }
                }
            }
        }
Exemplo n.º 3
0
 public static InOut GetInOutByVOut(VOut vOut)
 {
     try
     {
         using (WareHouseEntities en = new WareHouseEntities())
         {
             return(en.InOuts.Include(p => p.Material).First(x =>
                                                             !x.IsIn &&
                                                             x.Material.Name == vOut.Name &&
                                                             x.Quantity == vOut.Quantity &&
                                                             x.Date == vOut.Date));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(null);
     }
 }