public int Insert()
 {
     int nResult = 0;
     cBasketDetail objInfor = new cBasketDetail();
     try
     {
         objInfor.AddNew();
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = 1;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
 public int DeleteById(int ID)
 {
     int nResult = 0;
     cBasketDetail objDAL = new cBasketDetail();
     try
     {
         objDAL.LoadByPrimaryKey(ID);
         objDAL.MarkAsDeleted();
         objDAL.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
 public int Update(int ID)
 {
     int nResult = 0;
     cBasketDetail objInfor = new cBasketDetail();
     try
     {
         objInfor.LoadByPrimaryKey(ID);
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
 public DataTable Search_BasketDetail_by_BasketID(int BasketID)
 {
     DataTable tbResult = new DataTable();
     cBasketDetail objDAL = new cBasketDetail();
     tbResult = objDAL.Search_BasketDetail_by_BasketID(BasketID);
     return tbResult;
 }
 public void LoadById(int ID)
 {
     cBasketDetail objDAL = new cBasketDetail();
     objDAL.LoadByPrimaryKey(ID);
     ConvertData(objDAL);
 }
 private void MappingData(cBasketDetail objInfor)
 {
     try { objInfor.Quantity = Data.Quantity; }
     catch { objInfor.Quantity = 0; }
     try { objInfor.BasketID = Data.BasketID; }
     catch { objInfor.BasketID = 0; }
     try { objInfor.ProductID2 = Data.ProductID2; }
     catch { objInfor.ProductID2 = 0; }
 }
 private void ConvertData(cBasketDetail objInfor)
 {
     try { Data.Quantity = objInfor.Quantity; }
     catch { Data.Quantity = 0; }
     try { Data.BasketID = objInfor.BasketID; }
     catch { Data.BasketID = 0; }
     try { Data.ProductID2 = objInfor.ProductID2; }
     catch { Data.ProductID2 = 0; }
 }