Пример #1
0
 public CashRegisterData(CashRegister _CashRegister)
 {
     InitializeComponent();
     cashRegister   = _CashRegister;
     installationId = Logic.Config.InstallationIdentifyLogic.InstallationIDInt;
     manager        = new ContextManager();
     context        = manager.Context;
     Logic.Config.ModesLogic modesLogic = new ModesLogic(manager);
     ModesCB.DataSource    = modesLogic.GetAll();
     ModesCB.DisplayMember = "Name";
     ModesCB.ValueMember   = "ID";
     ModesCB.SelectedIndex = 0;
     //id інсталяції
     Fill();
 }
Пример #2
0
        private void Fill()
        {
            ParametersLogic parameters = new ParametersLogic();

            ParametersCB.DataSource    = parameters.GetAll();
            ParametersCB.DisplayMember = "Name";
            ParametersCB.ValueMember   = "ID";

            ModesLogic modes = new ModesLogic(manager);

            ModeCB.DataSource    = modes.GetAll();
            ModeCB.DisplayMember = "Name";
            ModeCB.ValueMember   = "ID";

            SecurityUsersLogic usersLogic = new SecurityUsersLogic(manager);

            UsersCB.DisplayMember = "Login";
            UsersCB.ValueMember   = "ID";

            SecurityUser u0 = new SecurityUser();

            u0.ID    = -1;
            u0.Login = "******";
            UsersCB.Items.Add(u0);
            foreach (SecurityUser sm in usersLogic.GetAll())
            {
                UsersCB.Items.Add(sm);
            }
            UsersCB.SelectedIndex = 0;

            if (mode == "edit")
            {
                if (id != null)
                {
                }
                //WareDiscountType discountTypes = discountTypes.Get(Convert.ToInt32(id));
                //if (currency != null)
                //{
                //   NameTB.Text = currency.Name;
                //}
            }
        }