Example #1
0
 public frmNewForm(VWA4Common.DataObject.Formx f)
 {
     InitializeComponent();
     updateProductUI();
     this.form = f;
     this.pop();
     this.loadFormValues();
 }
Example #2
0
        private void loadPrintSeries(FormSeries fs)
        {
            this.activePrintSeriesId = fs.Id;

            this.newFfs = new List <FormFormSeries>();
            ulvPrintSeries.Reset();
            ulvPrintSeries.Width  = pnlPrintSeries.Width;
            ulvPrintSeries.Height = pnlPrintSeries.Height;
            ulvPrintSeries.ViewSettingsDetails.CheckBoxStyle = CheckBoxStyle.CheckBox;
            ulvPrintSeries.View = UltraListViewStyle.Details;
            ulvPrintSeries.ItemSettings.Appearance.Image = imageList1.Images[0];

            ulvPrintSeries.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true;
            ulvPrintSeries.ViewSettingsDetails.AutoFitColumns             = AutoFitColumns.ResizeAllColumns;
            ulvPrintSeries.ItemSettings.SubItemsVisibleInToolTipByDefault = false;
            ulvPrintSeries.ItemSettings.SelectionType = SelectionType.Single;

            UltraListViewMainColumn mainColumn = ulvPrintSeries.MainColumn;

            mainColumn.Text     = "Enabled";
            mainColumn.DataType = typeof(System.Int32);

            UltraListViewSubItemColumn cNumberOfCopies = new UltraListViewSubItemColumn();

            cNumberOfCopies.Text  = "# Copies";
            cNumberOfCopies.Width = 50;
            cNumberOfCopies.VisibleInDetailsView = DefaultableBoolean.True;
            cNumberOfCopies.DataType             = typeof(Int32);

            UltraListViewSubItemColumn cFormId = new UltraListViewSubItemColumn();

            cFormId.Text = "FormId";
            cFormId.VisibleInDetailsView = DefaultableBoolean.False;
            cFormId.DataType             = typeof(Int32);

            ulvPrintSeries.SubItemColumns.Add(cNumberOfCopies);
            ulvPrintSeries.SubItemColumns.Add(cFormId);

            List <FormFormSeries> allffs = FormFormSeriesDAO.DAO.GetAllByFormSeriesId(fs.Id);

            allffs.AddRange(this.newFfs);
            foreach (FormFormSeries ffs in allffs)
            {
                VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(ffs.FormId);
                UltraListViewItem           i = ulvPrintSeries.Items.Add(ffs.Id.ToString(), f.Name);
                i.CheckState        = ffs.Enabled ? CheckState.Checked : CheckState.Unchecked;
                i.SubItems[0].Value = ffs.NumberOfCopies;
                i.SubItems[1].Value = ffs.FormId;
            }

            this.pnlPrintSeries.Controls.Add(ulvPrintSeries);
        }
Example #3
0
 private void btnRemoveForm_Click(object sender, EventArgs e)
 {
     if (this.ulvForms.SelectedItems.Count > 0)
     {
         VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(Convert.ToInt32(this.ulvForms.SelectedItems[0].Key));
         if (MessageBox.Show(string.Format("Are you sure you want to delete Form '{0}'?", f.Name), "Delete Form", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
         {
             FormDAO.DAO.Delete(f);
             this.loadForms();
             this.loadFormSeries();
         }
     }
 }
Example #4
0
 public frmFormProperties(VWA4Common.DataObject.Formx f)
 {
     InitializeComponent();
     updateProductUI();
     this.lblNameValue.Text             += f.Name;
     this.lblDocumentValue.Text         += f.FileName;
     this.lblTypeValue.Text             += f.DocumentType;
     this.lblLocationValue.Text         += f.SavePath.Length > 0 ? f.SavePath : "Database";
     this.lblTemplateValue.Text         += f.DataEntryTemplateId != 0 ? VWA4Common.DB.Retrieve("select DETName from DataEntryTemplates where ID=" + f.DataEntryTemplateId).Rows[0]["DETName"] : "";
     this.lblLastPrintValue.Text        += f.LastPrintedDate;
     this.lblDateCreatedValue.Text      += f.CreateDate.ToShortDateString();
     this.lblLastModifiedDateValue.Text += f.ModifiedDate.ToShortDateString();
 }
Example #5
0
        private void OnDragEnd(UltraListView listView, bool canceled)
        {
            if (canceled == false && this.dragItem != null)
            {
                VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(Convert.ToInt32(dragItem.Key));
                UltraListViewItem           i = new UltraListViewItem();

                List <FormFormSeries> allffs = new List <FormFormSeries>();
                allffs.AddRange(FormFormSeriesDAO.DAO.GetAllByFormSeriesId(this.activePrintSeriesId));
                allffs.AddRange(this.newFfs);

                foreach (FormFormSeries ffs in allffs)
                {
                    if (ffs.FormId == f.Id && ffs.FormSeriesId == this.activePrintSeriesId)
                    {
                        MessageBox.Show("Duplicate forms cannot be added to the same series.", "Manage Forms");
                        return;
                    }
                }

                try
                {
                    FormFormSeries ffs = new FormFormSeries
                    {
                        Id             = FormFormSeriesDAO.DAO.GetNextId() + this.newFfs.Count,
                        FormId         = f.Id,
                        FormSeriesId   = this.activePrintSeriesId,
                        Enabled        = true,
                        NumberOfCopies = 1,
                        SortOrder      = (dropItem == null) ? 0 : dropItem.Index + 1
                    };

                    i.Key   = ffs.Id.ToString();
                    i.Value = f.Name;
                    ulvPrintSeries.Items.Insert((dropItem == null) ? 0 : dropItem.Index + 1, i);

                    this.newFfs.Add(ffs);
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                i.CheckState        = CheckState.Checked;
                i.SubItems[0].Value = 1;
                i.SubItems[1].Value = f.Id;
            }

            this.dragItem      = this.dropItem = null;
            this.lastMouseDown = new Point();
        }
Example #6
0
 private void deleteFormFormSeries_Click(object sender, EventArgs e)
 {
     if (this.ulvPrintSeries.SelectedItems.Count > 0)
     {
         FormFormSeries ffs            = FormFormSeriesDAO.DAO.Load(Convert.ToInt32(ulvPrintSeries.SelectedItems[0].Key));
         VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(ffs.FormId);
         FormSeries fs = FormSeriesDAO.DAO.Load(ffs.FormSeriesId);
         if (MessageBox.Show(string.Format("Are you sure you want to delete Form '{0}' from Form Series '{1}'?", f.Name, fs.Name), "Delete Form", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
         {
             FormFormSeriesDAO.DAO.Delete(ffs);
         }
         this.ulvPrintSeries.Items.Remove(this.ulvPrintSeries.SelectedItems[0]);
     }
 }
Example #7
0
        private void printToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.ulvForms.SelectedItems.Count > 0)
            {
                List <FormFormSeries> ffs = new List <FormFormSeries>();
                FormFormSeries        fs  = new FormFormSeries();
                fs.FormId = Convert.ToInt32(this.ulvForms.SelectedItems[0].Key);
                ffs.Add(fs);

                VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(fs.FormId);
                f.LastPrintedDate = DateTime.Now.ToShortDateString();
                FormDAO.DAO.Update(f);

                rptFormSeries rpt = new rptFormSeries(ffs);
                rpt.Run();
            }
        }
        public frmFormFormSeriesProperties(FormFormSeries ffs)
        {
            InitializeComponent();
            updateProductUI();

            VWA4Common.DataObject.Formx f = FormDAO.DAO.Load(ffs.FormId);
            this.lblNameValue.Text             += f.Name;
            this.lblDocumentValue.Text         += f.FileName;
            this.lblTypeValue.Text             += f.DocumentType;
            this.lblLocationValue.Text         += f.SavePath.Length > 0 ? f.SavePath : "Database";
            this.lblTemplateValue.Text         += f.DataEntryTemplateId != 0 ? VWA4Common.DB.Retrieve("select DETName from DataEntryTemplates where ID=" + f.DataEntryTemplateId).Rows[0]["DETName"] : "";
            this.lblLastPrintDateValue.Text    += f.LastPrintedDate;
            this.lblCreateDateValue.Text       += f.CreateDate.ToShortDateString();
            this.lblLastModifiedDateValue.Text += f.ModifiedDate.ToShortDateString();
            this.lblEnabledValue.Text          += ffs.Enabled ? "Yes" : "No";
            this.lblNumberOfCopiesValue.Text   += ffs.NumberOfCopies.ToString();
        }
Example #9
0
 /// <summary>
 /// Constructors
 /// </summary>
 public UCManageForms(VWA4Common.DataObject.Formx f)
 {
     this.form = f;
     InitializeComponent();
 }