Example #1
0
        private void Employees_Load(object sender, EventArgs e)
        {
            SetComponentsByPermisions();

            this.dtDepartments             = Department.GetDepartmentsAsDataTable(this.cnConnection);
            this.dgvDepartments.DataSource = this.dtDepartments;

            this.dtCategories             = Category.GetCategoriesAsDataTable(this.cnConnection);
            this.dgvCategories.DataSource = this.dtCategories;

            this.ciCoInformation = FamSetting.GetCoInformation(this.cnConnection);

            this.tbName.Text          = this.ciCoInformation.strName;
            this.cbTypes.SelectedItem = this.ciCoInformation.strCoType;
            if (this.ciCoInformation.dtRegister.Year != 1)
            {
                this.dtpRegister.Value = this.ciCoInformation.dtRegister;
            }
            this.tbRegisterNumber.Text = this.ciCoInformation.strRegisterCode;
            this.tbCoID.Text           = this.ciCoInformation.strCoID;
            this.tbAddress.Text        = this.ciCoInformation.strAddress;
            this.tbPostalCode.Text     = this.ciCoInformation.strPostalCode;
            this.tbTell.Text           = this.ciCoInformation.strTell;
            this.tbFax.Text            = this.ciCoInformation.strFax;
            this.tbTaxID.Text          = this.ciCoInformation.strTaxID;
            this.tbProvince.Text       = this.ciCoInformation.strProvince;
            this.tbCity.Text           = this.ciCoInformation.strCity;
            this.tbWebSite.Text        = this.ciCoInformation.strWebSite;

            this.btmCoSave.Enabled = false;
        }
Example #2
0
        private void BtmCoSave_Click(object sender, EventArgs e)
        {
            this.ciCoInformation = new FamSetting.CoInformation();

            this.ciCoInformation.strName         = this.tbName.Text.Trim();
            this.ciCoInformation.strCoType       = this.cbTypes.SelectedItem.ToString();
            this.ciCoInformation.dtRegister      = (DateTime)this.dtpRegister.Value;
            this.ciCoInformation.strRegisterCode = this.tbRegisterNumber.Text.Trim();
            this.ciCoInformation.strCoID         = this.tbCoID.Text.Trim();
            this.ciCoInformation.strAddress      = this.tbAddress.Text.Trim();
            this.ciCoInformation.strPostalCode   = this.tbPostalCode.Text.Trim();
            this.ciCoInformation.strTell         = this.tbTell.Text.Trim();
            this.ciCoInformation.strFax          = this.tbFax.Text.Trim();
            this.ciCoInformation.strTaxID        = this.tbTaxID.Text.Trim();
            this.ciCoInformation.strProvince     = this.tbProvince.Text.Trim();
            this.ciCoInformation.strCity         = this.tbCity.Text.Trim();
            this.ciCoInformation.strWebSite      = this.tbWebSite.Text.Trim();

            FamSetting.SetCoInformation(this.cnConnection, this.ciCoInformation);

            this.btmCoSave.Enabled = false;
        }