Exemplo n.º 1
0
        private void btnDelIn_Click(object sender, EventArgs e)
        {
            VIn   vIn   = this.GetFirstSelectedVIn();
            InOut inOut = DAL.GetInOutByVIn(vIn);

            if (vIn != null)
            {
                if (DAL.DeleteInOut(inOut))
                {
                    this.ViewAll();
                }
            }
        }
Exemplo n.º 2
0
        private void btnEditIn_Click(object sender, EventArgs e)
        {
            VIn vIn = this.GetFirstSelectedVIn();

            if (vIn != null)
            {
                InOut    inOut  = DAL.GetInOutByVIn(vIn);
                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 GetInOutByVIn(VIn vIn)
 {
     try
     {
         using (WareHouseEntities en = new WareHouseEntities())
         {
             return(en.InOuts.Include(p => p.Material).First(x =>
                                                             x.IsIn &&
                                                             x.Material.Name == vIn.Name &&
                                                             x.Quantity == vIn.Quantity &&
                                                             x.Date == vIn.Date));
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(null);
     }
 }