Exemplo n.º 1
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();
        }
    }
Exemplo n.º 2
0
    private bool ValidateInput()
    {
        // -------------- ª×èͺÃÔÉÑ·/¼Ùé¨Ó˹èÒ -------------------------------------------
        if (txtCode.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкØÃËÑʼÙé¨Ó˹èÒÂ");
            return false;
        }
        if (txtTaxNumber.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкØàÅ¢»ÃШӵÑǼÙéàÊÕÂÀÒÉÕÍÒ¡Ã");
            return false;
        }
        if (txtSupplierName.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкت×èͼÙé¨Ó˹èÒÂ");
            return false;
        }

        // -------------- ·ÕèÍÂÙèºÃÔÉÑ·/¼Ùé¨Ó˹èÒ -------------------------------------------
        if (txtSupAddress.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкطÕèÍÂÙè");
            return false;
        }
        if (txtSupRoad.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкض¹¹");
            return false;
        }
        if (cmbSupProvince.SelectedIndex == 0)
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкبѧËÇÑ´");
            return false;
        }
        if (cmbSupAmphur.SelectedIndex == 0)
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкØÍÓàÀÍ");
            return false;
        }
        if (txtSupZipCode.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкØÃËÑÊä»ÃɳÕÂì");
            return false;
        }
        if (txtSupTel.Text.Trim() == "")
        {
            Appz.ClientAlert(Page, "¡ÃسÒÃкØàºÍÃìâ·ÃÈѾ·ì");
            return false;
        }

        SupplierFlow supFlow = new SupplierFlow();

        if (supFlow.GetLOIDbyCODE(txtCode.Text) != 0 && supFlow.GetLOIDbyCODE(txtCode.Text) != Convert.ToDouble(txtLOID.Text == "" ? "0" : txtLOID.Text))
        {
            Appz.ClientAlert(Page, "ÃËÑʼÙé¨Ó˹èÒ«éÓ");
            return false;
        }

        if (supFlow.GetLOIDbyTAXID(txtTaxNumber.Text) !=  0 && supFlow.GetLOIDbyTAXID(txtTaxNumber.Text) != Convert.ToDouble(txtLOID.Text == "" ? "0" : txtLOID.Text))
        {
            Appz.ClientAlert(Page, "àÅ¢»ÃШӵÑǼÙéàÊÕÂÀÒÉÕ«éÓ");
            return false;
        }

        if (supFlow.GetLOIDbySUPPLIERNAME(txtSupplierName.Text) != 0 && supFlow.GetLOIDbySUPPLIERNAME(txtSupplierName.Text) != Convert.ToDouble(txtLOID.Text == "" ? "0" : txtLOID.Text))
        {
            Appz.ClientAlert(Page, "ª×èͼÙé¨Ó˹èÒ«éÓ");
            return false;
        }

        return true;

    }