Beispiel #1
0
 public DataTable GetPDReturnItemBlank()
 {
     CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL();
     return DALObj.GetPDReturnItemListBlank();
 }
Beispiel #2
0
        public bool UpdateData(string userID, CtrlDeliveryData data)
        {
            bool ret = true;
            if (ValidateData(data))
            {
                OracleDBObj obj = new OracleDBObj();
                obj.CreateConnection();
                obj.CreateTransaction();
                try
                {
                    DALObj.GetDataByLOID(data.LOID, obj.zTrans);

                    //DALObj.CODE = data.CODE;
                    DALObj.CARNO = data.CARNO;
                    DALObj.DELIVERYDATE = data.DELIVERYDATE;
                    DALObj.DELIVERYNAME = data.DELIVERYNAME;

                    if (DALObj.OnDB)
                        ret = DALObj.UpdateCurrentData(userID, obj.zTrans);
                    else
                        ret = DALObj.InsertCurrentData(userID, obj.zTrans);

                    _LOID = DALObj.LOID;
                    if (!ret)
                    {
                        throw new ApplicationException(DALObj.ErrorMessage);
                    }

                    CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL();
                    itemDAL.DeleteDataByCtrlDelivery(data.LOID, obj.zTrans);
                    for (Int16 i = 0; i < data.ITEM.Count; ++i)
                    {
                        CtrlDeliveryItemData item = (CtrlDeliveryItemData)data.ITEM[i];
                        itemDAL.BOXQTY = item.BOXQTY;
                        itemDAL.CADDRESS = item.CADDRESS;
                        itemDAL.CNAME = item.CNAME;
                        itemDAL.CONTACTNAME = item.CONTACTNAME;
                        itemDAL.CTEL = item.CTEL;
                        itemDAL.CTRLDELIVERY = DALObj.LOID;
                        itemDAL.REQUISITION = item.REQUISITION;


                        itemDAL.OnDB = false;
                        ret = itemDAL.InsertCurrentData(userID, obj.zTrans);
                        if (!ret) throw new ApplicationException(itemDAL.ErrorMessage);
                    }
                    obj.zTrans.Commit();
                    obj.CloseConnection();
                }
                catch (Exception ex)
                {
                    obj.zTrans.Rollback();
                    obj.CloseConnection();
                    ret = false;
                    _error = ex.Message;
                }
            }
            else
                ret = false;
            return ret;
        }
Beispiel #3
0
 public DataTable GetDeliveryItem(double ctrldelivery)
 {
     CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL();
     return SearchDAL.GetDeliveryItemList(ctrldelivery);
 }
Beispiel #4
0
 public DataTable GetDeliveryItemBlank()
 {
     CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL();
     return SearchDAL.GetDeliveryItemListBlank();
 }
Beispiel #5
0
 public bool DeleteData(ArrayList arrData)
 {
     bool ret = true;
     OracleDBObj obj = new OracleDBObj();
     obj.CreateConnection();
     obj.CreateTransaction();
     try
     {
         CtrlDeliveryItemDAL itemDAL = new CtrlDeliveryItemDAL();
         for (int i = 0; i < arrData.Count; i++)
         {
             DALObj.GetDataByLOID(Convert.ToDouble(arrData[i]), obj.zTrans);
             itemDAL.DeleteDataByCtrlDelivery(Convert.ToDouble(arrData[i]), obj.zTrans);
             ret = DALObj.DeleteCurrentData(obj.zTrans);
             if (!ret) throw new ApplicationException(DALObj.ErrorMessage);
         }
         obj.zTrans.Commit();
         obj.CloseConnection();
     }
     catch (Exception ex)
     {
         obj.zTrans.Rollback();
         obj.CloseConnection();
         ret = false;
         _error = ex.Message;
     }
     return ret;
 }