Пример #1
0
 public frmTakeForLong(int br, string sl)
 {
     shortLong = sl;
     bra       = br;//סניף
     InitializeComponent();
     curentCardTable = new CreditCardTable();
     Suport.FillCombox(cmbCity, ct.GetTable(), "nameCity", "coudeCity");
     Suport.FillCombox(cmbLicenseKind, curentL.GetTable(), "nameLicense", "coudeLicense");
     curentBranch   = new Branch(br);
     txtBranch.Text = Convert.ToString(curentBranch.BranchName);
     btnOk.Visible  = true;
 }
        public frmAddShowClient(string st)
        {
            InitializeComponent();
            CityTable ct = new CityTable();

            Suport.FillCombox(cmbCity, ct.GetTable(), "nameCity", "coudeCity");
            KindLicenseTable k = new KindLicenseTable();

            Suport.FillCombox(cmbLicenseKind, k.GetTable(), "nameLicense", "coudeLicense");
            str = st;
            if (st == "add")
            {
                lblMessage.Visible = true;
                btnOK.Visible      = true;
            }
            if (st == "update")
            {
                lblmessageupdate.Visible = true;
                btnUpdate.Visible        = true;
                lblSearch.Visible        = true;
                txtSearch.Visible        = true;
                btnSearch.Visible        = true;
            }
            if (st == "search")
            {
                txtAddress.Enabled     = false;
                txtDate.Enabled        = false;
                txtFName.Enabled       = false;
                txtID.Enabled          = false;
                txtLicenseD1.Enabled   = false;
                txtLicenseD2.Enabled   = false;
                txtLicenseNum.Enabled  = false;
                txtLName.Enabled       = false;
                txtNum.Enabled         = false;
                txtPhone.Enabled       = false;
                txtTel.Enabled         = false;
                lblSearch.Visible      = true;
                txtSearch.Visible      = true;
                btnSearch.Visible      = true;
                lblSearch.Enabled      = true;
                txtSearch.Enabled      = true;
                btnSearch.Enabled      = true;
                cmbCity.Enabled        = false;
                cmbLicenseKind.Enabled = false;
            }
            //else
            //{
            //   // txtSearch.Text = st;
            //    txtSearch.Enabled = false;
            //    txtAddress.Enabled = false;
            //    txtDate.Enabled = false;
            //    txtFName.Enabled = false;
            //    txtID.Enabled = false;
            //    txtLicenseD1.Enabled = false;
            //    txtLicenseD2.Enabled = false;
            //    txtLicenseNum.Enabled = false;
            //    txtLName.Enabled = false;
            //    txtNum.Enabled = false;
            //    txtPhone.Enabled = false;
            //    txtTel.Enabled = false;
            //    lblSearch.Visible = true;
            //    txtSearch.Visible = true;
            //    btnSearch.Visible = true;
            //    lblSearch.Enabled = true;
            //    txtSearch.Enabled = true;
            //    btnSearch.Enabled = true;
            //    cmbCity.Enabled = false;
            //    cmbLicenseKind.Enabled = false;
            //}
        }