Exemple #1
0
        private void EAccountForm_SetupData()
        {
            PluralizationService ps = PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-us"));
            String cap = VLookupProvider.DataSetLookup(VLookupProvider.dstAccountTypes, "Id", Parameters.Find(p => p.Name == "AccountTypeId").Value, "Name").ToString();

            Caption = ps.Singularize(cap);

            MasterColumns.Find(mc => mc.Name == "AccountTypeId").DefaultValue = Parameters.Find(p => p.Name == "AccountTypeId").Value;
        }
Exemple #2
0
 private void EUserForm_BeforeSave()
 {
     if (PasswordModified)
     {
         txtPassword.Text = ISecurityHandler.Encrypt(txtPassword.Text);
     }
     else
     {
         txtPassword.Text = MasterColumns.Find(mc => mc.Name == "Password").Value.ToString();
     }
 }
        protected virtual void OnLoad()
        {
            if (Mode == ListFormMode.List)
            {
                WindowState = FormWindowState.Maximized;
                ActionButtonPanel.Visible = false;
                ChooseButton.Enabled      = ChooseButton.Visible = false;
                CloseButton.Enabled       = CloseButton.Visible = false;
                SplitContainer.Dock       = DockStyle.Fill;
            }
            else if (Mode == ListFormMode.Choose)
            {
                MinimumSize = Size;
                MinimizeBox = false;
                MaximizeBox = false;
            }

            MasterColumns.ForEach(c => MasterDataGridView.Columns.Add(c));
            DetailColumns.ForEach(c => DetailDataGridView.Columns.Add(c));
        }
Exemple #4
0
        private void SetFormFooter()
        {
            lblMode.Text = "Mode: " + FormState.ToString().Substring(2);

            if (FormState == FormStates.fsNew)
            {
                return;
            }

            if (MasterColumns.Find(col => col.Name == "DateCreated") != null)
            {
                lblCreatedBy.Text =
                    String.Format("Created By:     {0} on {1}",
                                  VLookupProvider.DataSetLookup(VLookupProvider.dstSystemUsers, "Id", MasterColumns.Find(col => col.Name == "CreatedById").Value, "FormalName"),
                                  Convert.ToDateTime(MasterColumns.Find(col => col.Name == "DateCreated").Value).ToString("MM'/'dd'/'yyyy 'at' hh:mm:ss tt")
                                  );
            }

            if (MasterColumns.Find(col => col.Name == "DateModified") != null)
            {
                lblModifiedBy.Text =
                    String.Format("Modified By:   {0} on {1}",
                                  VLookupProvider.DataSetLookup(VLookupProvider.dstSystemUsers, "Id", MasterColumns.Find(col => col.Name == "ModifiedById").Value, "FormalName"),
                                  Convert.ToDateTime(MasterColumns.Find(col => col.Name == "DateModified").Value).ToString("MM'/'dd'/'yyyy 'at' hh:mm:ss tt")
                                  );

                if (MasterColumns.Find(col => col.Name == "DateCreated").Value.ToString() == MasterColumns.Find(col => col.Name == "DateModified").Value.ToString())
                {
                    lblCreatedBy.Visible  = true;
                    lblModifiedBy.Visible = false;
                    lblCreatedBy.Padding  = new Padding(5, 5, 5, 5);
                }
                else
                {
                    lblCreatedBy.Visible  = true;
                    lblModifiedBy.Visible = true;
                    lblCreatedBy.Padding  = new Padding(5, 0, 0, 0);
                    lblModifiedBy.Padding = new Padding(5, 0, 0, 0);
                }
            }
        }
Exemple #5
0
        protected override void UpdateControls()
        {
            base.UpdateControls();

            btnPreview.Visible = (FormState == FormStates.fsView) &&
                                 (VLookupProvider.DataSetLookup(VLookupProvider.dstSystemPrintouts, "FormCaption", this.Caption, "FormCaption") != null);
            toolStripSeparatorPreview.Visible = btnPreview.Visible;

            btnFirstRecord.Enabled    = btnFirstRecord.Enabled && KeyId != 0;
            btnPreviousRecord.Enabled = btnPreviousRecord.Enabled && KeyId != 0;
            btnNextRecord.Enabled     = btnLastRecord.Enabled && KeyId != KeyList.Count - 1;
            btnLastRecord.Enabled     = btnLastRecord.Enabled && KeyId != KeyList.Count - 1;

            lblCreatedBy.Visible  = (MasterColumns.Find(col => col.Name == "CreatedById") != null) && (FormState != FormStates.fsNew);
            lblModifiedBy.Visible = (MasterColumns.Find(col => col.Name == "ModifiedById") != null) && (FormState != FormStates.fsNew);

            if (FormState != FormStates.fsNew)
            {
                KeyId = _KeyId;
            }
        }
Exemple #6
0
        private void CreateMasterColumns()
        {
            ITransactionHandler VTransactionHandler = new ITransactionHandler();
            DataTable           table = new DataTable();

            VTransactionHandler.LoadData(CommandText, ref table, this.Parameters);
            foreach (DataColumn dc in table.Columns)
            {
                if (!dc.AutoIncrement)
                {
                    JkMasterColumn column = new JkMasterColumn();
                    column.Name         = dc.ColumnName;
                    column.DataType     = IAppHandler.ConvertTypeToSqlType(dc.DataType);
                    column.Required     = !dc.AllowDBNull;
                    column.DefaultValue = IAppHandler.SetColumnsDefaultValue(dc.ColumnName);

                    if (MasterColumns.Find(col => col.Name == column.Name) == null)
                    {
                        _MasterColumns.Add(column);
                    }
                }
            }
        }