Example #1
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;
        }
Example #2
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;
        }
Example #3
0
    private void GetData(SupplierData supData)
    {
        //-------------------- ª×èͺÃÔÉÑ·/¼Ùé¨Ó˹èÒ ---------------------------------------
        supData.LOID = txtLOID.Text;
        supData.CODE = txtCode.Text.Trim();
        supData.TAXID = txtTaxNumber.Text.Trim();
        supData.SUPPLIERNAME = txtSupplierName.Text.Trim();
        supData.ACTIVE = (chkActive.Checked ? Constz.ActiveStatus.Active : Constz.ActiveStatus.InActive);

        //-------------------- ·ÕèÍÂÙèºÃÔÉÑ·/¼Ùé¨Ó˹èÒ ---------------------------------------
        supData.ADDRESS = txtSupAddress.Text.Trim();
        supData.ROAD = txtSupRoad.Text.Trim();
        supData.PROVINCE = Convert.ToDouble(cmbSupProvince.SelectedItem.Value);
        supData.AMPHUR = Convert.ToDouble(cmbSupAmphur.SelectedItem.Value);
        supData.TAMBOL = Convert.ToDouble(cmbSupDistrict.SelectedItem.Value);
        supData.ZIPCODE = txtSupZipCode.Text.Trim();
        supData.TEL = txtSupTel.Text.Trim();
        supData.FAX = txtSupFax.Text.Trim();
        supData.EMAIL = txtSupEmail.Text.Trim();

        //-------------------- ª×èͼÙéµÔ´µèÍ ---------------------------------------
        supData.CTITLE = Convert.ToDouble(cmbCTitle.SelectedItem.Value);
        supData.CNAME = txtContactFirstname.Text.Trim();
        supData.CLASTNAME = txtContactLastname.Text.Trim();
        supData.CTEL = txtContactTel.Text.Trim();
        supData.CMOBILE = txtContactMobile.Text.Trim();
        supData.CEMAIL = txtContactEmail.Text.Trim();
        supData.CADDRESS = txtContactAddress.Text.Trim();
        supData.CROAD = txtContactRoad.Text.Trim();
        supData.CPROVINCE = Convert.ToDouble(cmbContactProvince.SelectedItem.Value);
        supData.CAMPHUR = Convert.ToDouble(cmbContactAmphur.SelectedItem.Value);
        supData.CTAMBOL = Convert.ToDouble(cmbContactDistrict.SelectedItem.Value);
        supData.CZIPCODE = txtContactZipCode.Text.Trim();

        //-------------------- ËÁÒÂà赯 ---------------------------------------
        supData.REMARK = txtRemark.Text.Trim();
    }
Example #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;
        }
Example #5
0
    private void UpdateData()
    {
        bool ret = true;
        SupplierFlow supFlow = new SupplierFlow();
        SupplierData supData = new SupplierData();

        GetData(supData);

        ret = supFlow.UpdateData(Authz.CurrentUserInfo.UserID, supData);

        if (ret == false)
            Appz.ClientAlert(Page, supFlow.ErrorMessage);
        else
        {
            Appz.ClientAlert(Page, "·Ó¡ÒèѴà¡çº¢éÍÁÙżÙé¨Ó˹èÒÂàÃÕºÃéÍÂ");
            txtLOID.Text = supFlow.GetLOIDbyCODE(supData.CODE).ToString();
        }
    }