Exemplo n.º 1
0
 public bool AddNewProduct(T_Product product)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.T_Product.Add(product);
         return db.SaveChanges() > 0 ? true : false;
     }
 }
Exemplo n.º 2
0
 protected override void AddObject()
 {
     m_product = new T_Product();
     getData();
     m_client.AddNewProduct(m_product);
     saveCraft();
     base.AddObject();
 }
Exemplo n.º 3
0
 public bool AddNewProduct(T_Product product)
 {
     try
     {
         ph = new ProductHelper();
         return ph.AddNewProduct(product);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
 public bool UpdateProduct(T_Product product)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(product).State = EntityState.Modified;
         return db.SaveChanges() > 0 ? true : false;
     }
 }
Exemplo n.º 5
0
        protected override void FormLoad()
        {
            var customerlst = m_client.getCustomerList();
            foreach (var customer in customerlst)
            {
                cmb_cst.Properties.Items.Add(customer.customername);
            }
            cmb_cst.Properties.Tag = customerlst;

            if (formmode == frmmodetype.edit)
            {
                m_product = m_client.getProductbyId(m_pid);
                setData();
                List<T_Crafts> craftlst = m_client.getProductCraft(m_pid);
                gccraft.DataSource = craftlst;
            }
            else if (formmode == frmmodetype.delete)
            {
                m_product = m_client.getProductbyId(m_pid);
                setData();
                List<T_Crafts> craftlst = m_client.getProductCraft(m_pid);
                gccraft.DataSource = craftlst;
            }
            base.FormLoad();
        }