public winEmployeesRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.e               = (Employees)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            this.cmbDepartment.Items.Add("Leads service");
            this.cmbDepartment.Items.Add("Creative");
            this.cmbDepartment.Items.Add("Media");
            this.cmbDepartment.Items.Add("Production");
            this.cmbDepartment.Items.Add("Courier");
            this.cmbDepartment.SelectedIndex = 0;
            UpdateDepartmentList();
            this.cmbDepartment.DropDownClosed += cmbDepartment_DropDownClosed;

            SetupRedirector();

            this.Title          = "employee";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                this.lblPassw.Visibility       = Visibility.Collapsed;
                this.txtPassw.Visibility       = Visibility.Collapsed;
                this.lblPasswRepeat.Visibility = Visibility.Collapsed;
                this.txtPasswRepeat.Visibility = Visibility.Collapsed;

                if (this.e == null)
                {
                    throw new NullReferenceException();
                }

                this.txtFirstName.Text  = this.e.name_first;
                this.txtLastName.Text   = this.e.name_last;
                this.txtPatronymic.Text = this.e.patronymic;
                this.txtEmail.Text      = this.e.email;
                this.txtPhone.Text      = this.e.phone;

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            SetupWindow();
        }
        public winContractorsMediaRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.cm              = (ContractorsMedia)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (Leads l in Context.ctx.Leads)
            {
                this.cmbLeads.Items.Add(string.Format("({0}) {1}{2} {3}",
                                                      l.id,
                                                      Utils.Denull(l.name_last),
                                                      l.name_first,
                                                      Utils.Denull(l.patronymic)));
            }

            this.cmbLeads.SelectedIndex = 0;
            this.Title          = "media contractor";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.cm == null)
                {
                    throw new NullReferenceException();
                }

                this.txtFirstName.Text  = this.cm.name_first;
                this.txtLastName.Text   = this.cm.name_last;
                this.txtPatronymic.Text = this.cm.patronymic;
                this.txtEmail.Text      = this.cm.email;
                this.txtPhone.Text      = this.cm.phone;
                this.txtPrice.Text      = this.cm.price + "";
                Utils.SetComboBoxItem(this.cmbLeads, (long)this.cm.lid);

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
        public winContractorsProductionRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.cp              = (ContractorsProduction)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (OrdReqs r in Context.ctx.OrdReqs)
            {
                this.cmbOrdReqs.Items.Add(string.Format("({0}) {1} {2} {3}",
                                                        r.id, r.prod_name, r.prod_quantity, r.period_date));
            }

            this.cmbOrdReqs.SelectedIndex = 0;
            this.Title          = "production contractor";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.cp == null)
                {
                    throw new NullReferenceException();
                }

                this.txtFirstName.Text  = this.cp.name_first;
                this.txtLastName.Text   = this.cp.name_last;
                this.txtPatronymic.Text = this.cp.patronymic;
                this.txtEmail.Text      = this.cp.email;
                this.txtPhone.Text      = this.cp.phone;
                this.txtPrice.Text      = this.cp.price + "";
                Utils.SetComboBoxItem(this.cmbOrdReqs, this.cp.ordid);

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
Exemplo n.º 4
0
        public winStockRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.s               = (Stock)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (OrdReqs r in Context.ctx.OrdReqs)
            {
                this.cmbOrdReqs.Items.Add(string.Format("({0}) {1} {2} {3}",
                                                        r.id, r.prod_name, r.prod_quantity, r.period_date));
            }

            this.cmbOrdReqs.SelectedIndex = 0;
            this.Title          = "good";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.dtpRecDate.SelectedDate = DateTime.Now;

                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.s == null)
                {
                    throw new NullReferenceException();
                }

                this.dtpRecDate.SelectedDate = this.s.rec_date;

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
Exemplo n.º 5
0
        public winLeadsRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.l               = (Leads)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            this.Title          = "lead";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.dtpAppealDate.SelectedDate = DateTime.Now;

                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.l == null)
                {
                    throw new NullReferenceException();
                }

                this.txtFirstName.Text          = this.l.name_first;
                this.txtLastName.Text           = this.l.name_last;
                this.txtPatronymic.Text         = this.l.patronymic;
                this.txtEmail.Text              = this.l.email;
                this.txtPhone.Text              = this.l.phone;
                this.txtPromTime.Text           = this.l.prom_time + "";
                this.dtpAppealDate.SelectedDate = this.l.appeal_date;

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
        public winCampaignsRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.c = (Campaigns)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (Groups g in Context.ctx.Groups)
            {
                string item = string.Format("({0}) {1} {2}",
                                            g.id,
                                            g.pid,
                                            g.Leads.id);

                this.cmbGroups.Items.Add(item);
            }

            this.cmbGroups.SelectedIndex = 0;
            this.Title          = "campaign";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.c == null)
            {
                throw new NullReferenceException();
            }

            Utils.SetComboBoxItem(this.cmbGroups, this.c.gid);
            this.dtpCompDate.SelectedDate = this.c.comp_date;
            this.txtBudgetStarting.Text   = this.c.budget_starting + "";

            this.Title           = this.Title.Insert(0, "Modification of the ");
            this.btnDone.Content = "Modify";
            this.btnDone.Width   = 65;

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
Exemplo n.º 7
0
        public winOrdReqsRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.r               = (OrdReqs)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (Employees e in Context.ctx.Employees.Where(i => i.Positions.position == "Producer"))
            {
                this.cmbProducers.Items.Add(string.Format("({0}) {1} {2} {3}",
                                                          e.id,
                                                          e.name_last,
                                                          e.name_first,
                                                          Utils.Denull(e.patronymic)));
            }

            foreach (Leads l in Context.ctx.Leads)
            {
                this.cmbLeads.Items.Add(string.Format("({0}) {1}{2} {3}",
                                                      l.id,
                                                      Utils.Denull(l.name_last),
                                                      l.name_first,
                                                      Utils.Denull(l.patronymic)));
            }

            this.cmbProducers.SelectedIndex = 0;
            this.cmbLeads.SelectedIndex     = 0;
            this.Title          = "order request";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.dtpPeriodDate.SelectedDate = DateTime.Now;

                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.r == null)
                {
                    throw new NullReferenceException();
                }

                this.txtProdName.Text           = this.r.prod_name;
                this.txtProdQuantity.Text       = this.r.prod_quantity + "";
                this.dtpPeriodDate.SelectedDate = this.r.period_date;
                this.cmbProducers.Text          = this.r.pid + "";
                this.cmbLeads.Text = this.r.lid + "";

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }
Exemplo n.º 8
0
        public winGroupsRowManipulator(RowManipulatorContainer container)
        {
            InitializeComponent();

            this.action          = container.action;
            this.g               = (Groups)container.itemSel;
            DataGridMergeVirtual = container.DataGridMergeVirtual;
            DataGridChanged      = container.DataGridChanged;
            this.btnSave         = container.btnSave;

            foreach (Positions p in Context.ctx.Positions.Where(i =>
                                                                new List <string> {
                "Producer", "Artist designer", "Graphics specialist", "Copywriter"
            }.Contains(i.position)))
            {
                Employees e    = Context.ctx.Employees.First(i => i.id == p.eid);
                string    item = string.Format("({0}) {1} {2} {3}",
                                               e.id,
                                               e.name_last,
                                               e.name_first,
                                               Utils.Denull(e.patronymic));

                if (p.position == "Producer")
                {
                    this.cmbProducers.Items.Add(item);
                }
                else if (p.position == "Artist designer")
                {
                    this.cmbArtists.Items.Add(item);
                }
                else if (p.position == "Graphics specialist")
                {
                    this.cmbGraphics.Items.Add(item);
                }
                else if (p.position == "Copywriter")
                {
                    this.cmbCopywriters.Items.Add(item);
                }
            }

            foreach (Leads l in Context.ctx.Leads)
            {
                this.cmbLeads.Items.Add(string.Format("({0}) {1}{2} {3}",
                                                      l.id,
                                                      Utils.Denull(l.name_last),
                                                      l.name_first,
                                                      Utils.Denull(l.patronymic)));
            }

            this.cmbProducers.SelectedIndex   = 0;
            this.cmbArtists.SelectedIndex     = 0;
            this.cmbGraphics.SelectedIndex    = 0;
            this.cmbCopywriters.SelectedIndex = 0;
            this.cmbLeads.SelectedIndex       = 0;
            this.Title          = "group";
            this.btnDone.Margin = new Thickness(0, 7, 0, 7);

            if (this.action == Actions.Addition)
            {
                this.dtpCompDate.SelectedDate = DateTime.Now;

                this.Title           = this.Title.Insert(0, "Adding a new ");
                this.btnDone.Content = "Add";
                this.btnDone.Width   = 50;
            }
            else if (this.action == Actions.Modification)
            {
                if (this.g == null)
                {
                    throw new NullReferenceException();
                }

                Utils.SetComboBoxItem(this.cmbProducers, this.g.pid);
                Utils.SetComboBoxItem(this.cmbArtists, this.g.adid);
                Utils.SetComboBoxItem(this.cmbGraphics, this.g.gsid);
                Utils.SetComboBoxItem(this.cmbCopywriters, this.g.cid);
                Utils.SetComboBoxItem(this.cmbLeads, (long)this.g.lid);
                this.txtBudget.Text           = this.g.Campaigns.budget_starting + "";
                this.dtpCompDate.SelectedDate = this.g.Campaigns.comp_date;

                this.Title           = this.Title.Insert(0, "Modification of the ");
                this.btnDone.Content = "Modify";
                this.btnDone.Width   = 65;
            }

            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this.ResizeMode            = ResizeMode.CanMinimize;
            this.UseLayoutRounding     = true;
        }