private void AddAddressControls(String addressline1, String addressline2, String city, String state, String zip)
        {
            PictureBox tbx   = this.Controls.Find("dynamicpbx_chevdown", true).FirstOrDefault() as PictureBox;
            Label      label = this.Controls.Find("dynamiclbl_address", true).FirstOrDefault() as Label;


            if (tbx != null)
            {
                tbx.Dispose();
                label.Dispose();
            }
            this.Size = new Size(627, 470);
            PictureBox pbx = uiBuilder.GeneratePictureBox(17, 293, "dynamicpbx_chevup", Properties.Resources.chevup, 15, 15);

            pbx.Click += new EventHandler(this.RemoveUiClick);
            this.Controls.Add(pbx);
            this.Controls.Add(uiBuilder.GenerateLongTextBox(42, 310, "dynamictxt_addressline1", addressline1));
            this.Controls.Add(uiBuilder.GenerateLongTextBox(330, 310, "dynamictxt_addressline2", addressline2));
            this.Controls.Add(uiBuilder.GenerateShortTextBox(42, 372, "dynamictxt_city", city));
            this.Controls.Add(uiBuilder.GenerateShortTextBox(243, 372, "dynamictxt_state", state));
            this.Controls.Add(uiBuilder.GenerateShortTextBox(451, 372, "dynamictxt_zip", zip));
            this.Controls.Add(uiBuilder.GenerateLabel(40, 293, "dynamiclbl_addressline1", "Address Line 1 "));
            this.Controls.Add(uiBuilder.GenerateLabel(329, 293, "dynamiclbl_addressline2", "Address Line 2 "));
            this.Controls.Add(uiBuilder.GenerateLabel(40, 355, "dynamiclbl_city", "City "));
            this.Controls.Add(uiBuilder.GenerateLabel(241, 355, "dynamiclbl_state", "State "));
            this.Controls.Add(uiBuilder.GenerateLabel(449, 355, "dynamiclbl_zip", "Zip "));
            this.btn_save.Location = new Point(181, 427);
            this.btn_save.Left     = this.Width / 2 - this.btn_save.Width / 2;
            this.CenterToParent();
        }
示例#2
0
        public AddContact()
        {
            InitializeComponent();

            this.lbl_header.AutoSize = false;
            this.lbl_header.Left     = this.Width / 2 - this.lbl_header.Width / 2;

            this.btn_save.AutoSize = false;
            this.btn_save.Left     = this.Width / 2 - this.btn_save.Width / 2;

            this.txt_name.AutoSize = false;
            this.txt_name.Size     = new System.Drawing.Size(250, 30);

            this.txt_email.AutoSize = false;
            this.txt_email.Size     = new System.Drawing.Size(250, 30);

            this.txt_phone.AutoSize = false;
            this.txt_phone.Size     = new System.Drawing.Size(250, 30);

            PictureBox pbx = uiBuilder.GeneratePictureBox(17, 293, "dynamicpbx_chevdown", Properties.Resources.chevdown, 15, 15);

            pbx.Click += new EventHandler(this.AddUiClick);
            this.Controls.Add(pbx);

            Label label = uiBuilder.GenerateLabel(40, 295, "dynamiclbl_address", "Address");

            this.Controls.Add(label);


            this.cpb_userimage.Left     = this.Width / 2 - this.cpb_userimage.Width / 2;
            this.cpb_userimage.SizeMode = PictureBoxSizeMode.StretchImage;
            this.cpb_userimage.Image    = bitmap;
        }
        public AddEvent()
        {
            InitializeComponent();
            this.dtp_endtime.Value           = this.dtp_starttime.Value.AddHours(1);
            this.dtp_starttime.ValueChanged += new EventHandler(startPickerValueChanged);
            this.dtp_startdate.ValueChanged += new EventHandler(startDatePickerValueChanged);
            this.dtp_startdate.ValueChanged += new EventHandler(startDate_ValueChanged);
            this.dtp_enddate.ValueChanged   += new EventHandler(endDate_ValueChanged);
            this.dtp_endtime.ValueChanged   += new EventHandler(endTime_ValueChanged);

            this.lbl_header.AutoSize = false;
            this.lbl_header.Left     = this.Width / 2 - this.lbl_header.Width / 2;


            this.txt_name.AutoSize = false;
            this.txt_name.Size     = new System.Drawing.Size(250, 30);


            PictureBox pbx = uiBuilder.GeneratePictureBox(17, 390, "dynamicpbx_chevdown", Properties.Resources.chevdown, 15, 15);

            pbx.Click += new EventHandler(this.AddUiClick);

            this.Controls.Add(pbx);

            Label label = uiBuilder.GenerateLabel(40, 390, "dynamiclbl_address", "Address");

            this.Controls.Add(label);
        }
        public EditEvent(string eventid)
        {
            InitializeComponent();

            userEvent           = eventHelper.GetUserEvent(eventid);
            txt_name.Text       = userEvent.Title;
            txt_email.Text      = userEvent.Description;
            dtp_startdate.Value = userEvent.StartDate;
            dtp_starttime.Value = userEvent.StartDate;
            dtp_enddate.Value   = userEvent.StartDate;
            dtp_endtime.Value   = userEvent.EndDate;

            allContacts = contactHelper.GetUserContacts();
            allContacts.RemoveAll(x => contacts.Exists(y => y.ContactId == x.ContactId));

            if (userEvent.EventContacts != null)
            {
                foreach (EventContact eventContact in userEvent.EventContacts)
                {
                    ComboBoxItem comboBoxItem = new ComboBoxItem()
                    {
                        Id        = eventContact.Id,
                        ContactId = eventContact.ContactId,
                        Name      = this.GetContactName(eventContact.ContactId),
                    };
                    cmb_evetncollab.DisplayMember = "Name";
                    cmb_evetncollab.ValueMember   = "ContactId";
                    cmb_evetncollab.DisplayMember = "Name";
                    cmb_evetncollab.ValueMember   = "ContactId";
                    cmb_evetncollab.Items.Add(comboBoxItem);
                    comboBoxItems.Add(comboBoxItem);
                }
            }

            if (userEvent.Type.Equals("Task"))
            {
                rb_task.Checked = true;
            }
            else
            {
                rb_appointment.Checked = true;
            }



            if (allContacts != null)
            {
                foreach (Contact eventContact in allContacts)
                {
                    ComboBoxItem comboBoxItem = new ComboBoxItem()
                    {
                        ContactId = eventContact.ContactId,
                        Name      = eventContact.Name,
                    };

                    cmb_contacts.DisplayMember = "Name";
                    cmb_contacts.ValueMember   = "ContactId";
                    cmb_contacts.DisplayMember = "Name";
                    cmb_contacts.ValueMember   = "ContactId";
                    cmb_contacts.Items.Add(comboBoxItem);
                }
                cmb_contacts.Items.Remove("Loading....");
                //cmb_contacts.SelectedIndex = 0;
            }

            if (!userEvent.AddressLine1.Equals("") || !userEvent.AddressLine2.Equals("") || !userEvent.City.Equals("") || !userEvent.State.Equals("") || !userEvent.Zipcode.Equals(""))
            {
                this.AddAddressControls();
                this.changeConrolLocations("add");
            }
            else
            {
                PictureBox pbx = uiBuilder.GeneratePictureBox(17, 390, "dynamicpbx_chevdown", Properties.Resources.chevdown, 15, 15);
                pbx.Click += new EventHandler(this.AddUiClick);

                this.Controls.Add(pbx);

                Label label = uiBuilder.GenerateLabel(40, 390, "dynamiclbl_address", "Address");
                this.Controls.Add(label);
            }

            cmb_repeattype.SelectedItem = userEvent.RepeatType;
        }