예제 #1
0
        public ProdListDiscount()
        {
            InitializeComponent();

            products    = DBclass.DS.product;
            discountpDa = new discountproductsTableAdapter();
            discountpDa.Fill(DBclass.DS.discountproducts);

            discountDA = new discountsTableAdapter();
            discountDA.Fill(DBclass.DS.discounts);

            discountpr = DBclass.DS.discountproducts;
            discounts  = DBclass.DS.discounts;

            DataView discount_view   = new DataView(discounts);
            DataView discountpr_view = new DataView(discountpr);

            vdisDa = new v_discountTableAdapter();
            vdisDa.Fill(DBclass.DS.v_discount, -1);

            DataView dvDiscount = new DataView(DBclass.DS.v_discount);

            dgvDiscount.DataSource = dvDiscount;
            dvDiscount.RowFilter   = "";

            DataView dvDiscounts = new DataView(DBclass.DS.discounts);

            dgvGroup.DataSource    = dvDiscounts;
            discounts.TableNewRow += Discounts_TableNewRow;
        }
예제 #2
0
        public SettingsForm(string config)
        {
            InitializeComponent();
            settings = Properties.Settings.Default;


            if (Configs.GetConfig("IsPercentAll") != "" && Configs.GetConfig("IsPercentAll") == "True")
            {
                chbRebate.Checked = true;
            }
            else
            {
                chbRebate.Checked = false;
            }
            cbxDiscount.Enabled = settings.discount;
            chbDiscount.Checked = settings.discount;


            if (Configs.GetConfig("PercentAll") != "")
            {
                tbxPercent.Text = Configs.GetConfig("PercentAll");
            }
            else
            {
                tbxPercent.Text = "0";
            }

            tbxOrgName.Text = settings.orgName;
            tbxCom.Text     = settings.SerialPort;
            chbCOM.Checked  = settings.IsCom;
            kassaTbx.Text   = settings.kassa;
            //if (settings.IsCom)
            //{

            //    tbxCom.Enabled = false;
            //}

            tbxSN.Text         = settings.SN;
            chbPrinter.Checked = settings.isPrinter;
            dtpExpDate.Value   = settings.ExpDate;
            tbxDB.Text         = settings.testConnectionString;
            if (config == "-config")
            {
                tbxSN.Enabled      = true;
                dtpExpDate.Enabled = true;
                lblDB.Visible      = true;
                tbxDB.Visible      = true;
            }
            DataSetTposTableAdapters.discountsTableAdapter discountDa = new DataSetTposTableAdapters.discountsTableAdapter();
            discountDa.Fill(Classes.DB.DBclass.DS.discounts);

            cbxDiscount.DataSource    = Classes.DB.DBclass.DS.discounts;
            cbxDiscount.DisplayMember = "discountName";
            cbxDiscount.ValueMember   = "discountId";
        }