protected void lbtnSaveDetail_Click(object sender, EventArgs e) { try { var orderDeliDetail = _OrderDeliDetailRepo.GetByProductDetailId(Utils.CIntDef(ddlProductDetail.SelectedValue), Utils.CIntDef(ddlProductDetailSize.SelectedValue), id); if (orderDeliDetail != null) { orderDeliDetail.ORDER_DELI_ID = id; orderDeliDetail.PRODUCT_DETAIL_ID = Utils.CIntDef(ddlProductDetail.SelectedValue); orderDeliDetail.PRODUCT_DETAIL_SIZE_ID = Utils.CIntDef(ddlProductDetailSize.SelectedValue); orderDeliDetail.QUANTITY = Utils.CIntDef(txtQuantity.Text.Replace(",", "")); _OrderDeliDetailRepo.Update(orderDeliDetail); } else { orderDeliDetail = new ORDER_DELI_DETAIL(); orderDeliDetail.ORDER_DELI_ID = id; orderDeliDetail.PRODUCT_DETAIL_ID = Utils.CIntDef(ddlProductDetail.SelectedValue); orderDeliDetail.PRODUCT_DETAIL_SIZE_ID = Utils.CIntDef(ddlProductDetailSize.SelectedValue); orderDeliDetail.QUANTITY = Utils.CIntDef(txtQuantity.Text.Replace(",", "")); _OrderDeliDetailRepo.Create(orderDeliDetail); } Response.Redirect("xuat-san-pham.aspx?id=" + id + "&activetab=" + 1); } catch { } }
public virtual void Remove(ORDER_DELI_DETAIL user) { try { db.ORDER_DELI_DETAILs.DeleteOnSubmit(user); db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Remove(int id) { try { ORDER_DELI_DETAIL user = this.GetById(id); this.Remove(user); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Create(ORDER_DELI_DETAIL user) { try { this.db.ORDER_DELI_DETAILs.InsertOnSubmit(user); db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual int Delete(int id) { try { ORDER_DELI_DETAIL user = this.GetById(id); return(this.Delete(user)); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Update(ORDER_DELI_DETAIL user) { try { ORDER_DELI_DETAIL userOld = this.GetById(user.ID); userOld = user; db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual int Delete(ORDER_DELI_DETAIL user) { try { //user.IsDelete = true; db.SubmitChanges(); return(0); } catch (Exception e) { throw new Exception(e.Message); } }