Ejemplo n.º 1
0
 public int Insert()
 {
     int nResult = 0;
     cBasket objInfor = new cBasket();
     try
     {
         objInfor.AddNew();
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = objInfor.BasketID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Ejemplo n.º 2
0
 public int DeleteById(int ID)
 {
     int nResult = 0;
     cBasket objDAL = new cBasket();
     try
     {
         objDAL.LoadByPrimaryKey(ID);
         objDAL.MarkAsDeleted();
         objDAL.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Ejemplo n.º 3
0
 public int Update(int ID)
 {
     int nResult = 0;
     cBasket objInfor = new cBasket();
     try
     {
         objInfor.LoadByPrimaryKey(ID);
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Ejemplo n.º 4
0
 public DataTable SearchAll()
 {
     DataTable tbResult = new DataTable();
     cBasket objDAL = new cBasket();
     tbResult = objDAL.SearchAll();
     return tbResult;
 }
Ejemplo n.º 5
0
 public void LoadById(int ID)
 {
     cBasket objDAL = new cBasket();
     objDAL.LoadByPrimaryKey(ID);
     ConvertData(objDAL);
 }
Ejemplo n.º 6
0
 private void MappingData(cBasket objInfor)
 {
     try { objInfor.BasketName = Data.BasketName; }
     catch { objInfor.BasketName = ""; }
     try { objInfor.CustomerName = Data.CustomerName; }
     catch { objInfor.CustomerName = ""; }
     try { objInfor.BasketContent = Data.BasketContent; }
     catch { objInfor.BasketContent = ""; }
     try { objInfor.CustomerAddress = Data.CustomerAddress; }
     catch { objInfor.CustomerAddress = ""; }
     try { objInfor.CustomerTel = Data.CustomerTel; }
     catch { objInfor.CustomerTel = ""; }
     try { objInfor.CustomerEmail = Data.CustomerEmail; }
     catch { objInfor.CustomerEmail = ""; }
     try { objInfor.Status = Data.Status; }
     catch { objInfor.Status = 0; }
     try { objInfor.DateCreated = Data.DateCreated; }
     catch { objInfor.DateCreated = ""; }
 }
Ejemplo n.º 7
0
 private void ConvertData(cBasket objInfor)
 {
     try { Data.BasketName = objInfor.BasketName; }
     catch { Data.BasketName = ""; }
     try { Data.CustomerName = objInfor.CustomerName; }
     catch { Data.CustomerName = ""; }
     try { Data.BasketContent = objInfor.BasketContent; }
     catch { Data.BasketContent = ""; }
     try { Data.CustomerAddress = objInfor.CustomerAddress; }
     catch { Data.CustomerAddress = ""; }
     try { Data.CustomerTel = objInfor.CustomerTel; }
     catch { Data.CustomerTel = ""; }
     try { Data.CustomerEmail = objInfor.CustomerEmail; }
     catch { Data.CustomerEmail = ""; }
     try { Data.Status = objInfor.Status; }
     catch { Data.Status = 0; }
     try { Data.DateCreated = objInfor.DateCreated; }
     catch { Data.DateCreated = ""; }
 }
Ejemplo n.º 8
0
        public int UpdateStatus(int ID, int Status)
        {
            int nResult = 0;
            cBasket objDAL = new cBasket();
            try
            {
                objDAL.LoadByPrimaryKey(ID);
                objDAL.Status = Status;

                objDAL.Save();
                nResult = objDAL.BasketID;
            }
            catch
            {
                nResult = 0;
            }
            return nResult;
        }