Beispiel #1
0
        public bool DeleteData(ArrayList arrLOID)
        {
            bool ret = true;
            OracleDBObj objDB = new OracleDBObj();

            objDB.CreateConnection();
            objDB.CreateTransaction();

            try
            {
                foreach (double LOID in arrLOID)
                {
                    SupplierDAL oDAL = new SupplierDAL();
                    oDAL.GetDataByLOID(LOID, objDB.zTrans);
                    oDAL.DeleteCurrentData(objDB.zTrans);
                }
                objDB.zTrans.Commit();
                ret = true;
            }
            catch (Exception ex)
            {
                objDB.zTrans.Rollback();
                _error = ex.Message;
                ret = false;
            }

            objDB.CloseConnection();
            return ret;
        }
Beispiel #2
0
        public bool UpdateData(string UserID, SupplierData supData)
        {
            Boolean ret = true;
            SupplierDAL oDAL = new SupplierDAL();

            oDAL.OnDB = false;
            oDAL.GetDataByLOID(Convert.ToDouble(supData.LOID == "" ? "0" : supData.LOID), null);
            SetDataToDAL(oDAL, supData);

            if (oDAL.OnDB)
            {
                ret = oDAL.UpdateCurrentData(UserID, null);
            }
            else
            {
                ret = oDAL.InsertCurrentData(UserID, null);
            }

            if (ret == false)
                _error = oDAL.ErrorMessage;

            return ret;
        }
Beispiel #3
0
        private void SetDataToDAL(SupplierDAL oDAL, SupplierData supData)
        {
            oDAL.ACTIVE = supData.ACTIVE;

            //-------------------- к╫ш═║├╘╔╤╖/╝┘щи╙╦╣ш╥┬ ---------------------------------------
            oDAL.CODE = supData.CODE;
            oDAL.SUPPLIERNAME = supData.SUPPLIERNAME;
            oDAL.TAXID = supData.TAXID;

            //-------------------- ╖╒ш═┬┘ш║├╘╔╤╖/╝┘щи╙╦╣ш╥┬ ---------------------------------------
            oDAL.ADDRESS = supData.ADDRESS;
            oDAL.ROAD = supData.ROAD;
            oDAL.PROVINCE = supData.PROVINCE;
            oDAL.AMPHUR = supData.AMPHUR;
            oDAL.TAMBOL = supData.TAMBOL;
            oDAL.ZIPCODE = supData.ZIPCODE;
            oDAL.TEL = supData.TEL;
            oDAL.FAX = supData.FAX;
            oDAL.EMAIL = supData.EMAIL;

            //-------------------- к╫ш═╝┘щ╡╘┤╡ш═ ---------------------------------------
            oDAL.CTITLE = supData.CTITLE;
            oDAL.CNAME = supData.CNAME;
            oDAL.CLASTNAME = supData.CLASTNAME;
            oDAL.CTEL = supData.CTEL;
            oDAL.CMOBILE = supData.CMOBILE;
            oDAL.CEMAIL = supData.CEMAIL;
            oDAL.CADDRESS = supData.CADDRESS;
            oDAL.CROAD = supData.CROAD;
            oDAL.CPROVINCE = supData.CPROVINCE;
            oDAL.CAMPHUR = supData.CAMPHUR;
            oDAL.CTAMBOL = supData.CTAMBOL;
            oDAL.CZIPCODE = supData.CZIPCODE;

            //-------------------- ╦┴╥┬р╦╡╪ ---------------------------------------
            oDAL.REMARK = supData.REMARK;
        }
Beispiel #4
0
        //public bool NewRequisition(string userID, ProductReturnData data)
        //{
        //    bool ret = true;
        //    OracleDBObj obj = new OracleDBObj();
        //    obj.CreateConnection();
        //    obj.CreateTransaction();
        //    try
        //    {

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


        //        ret = DALObj.InsertCurrentData(userID, obj.zTrans);

        //        _LOID = DALObj.LOID;
        //        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;
        //}

        public SupplierData GetSupplierData(double supplier)
        {
            SupplierDAL sDAL = new SupplierDAL();
            sDAL.GetDataByLOID(supplier, null);
            SupplierData data = new SupplierData();
            data.SUPPLIERNAME = sDAL.SUPPLIERNAME;
            data.CNAME = sDAL.CNAME;
            data.CLASTNAME = sDAL.CLASTNAME;
            data.CADDRESS = sDAL.CADDRESS;
            data.CTEL = sDAL.CTEL;
            data.CFAX = sDAL.CFAX;
            //return DALObj.GetSupplierData(supplier);
            return data;
        }