Beispiel #1
0
        private void dgvAvailableMetadata_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            // This is the double-click on the available list
            //
            // Get selected row
            if (dgvAvailableMetadata.SelectedRows.Count <= 0)
            {
                return;
            }

            var            selectedRow = dgvAvailableMetadata.SelectedRows;
            ReportMetadata rm          = new ReportMetadata();

            ConvertSelectedRow(rm, selectedRow[0]);

            // Insert into db with client id

            rm.ClientUID  = Utils.ClientID;
            rm.UID        = 0;
            rm.RecordType = "CL";
            rm.Save();

            // Reload lists
            //
            loadList();
        }
Beispiel #2
0
        private void OLDLogoDoubleClick(object sender, EventArgs e)
        {
            // Show file dialog
            var file = openFileDialog1.ShowDialog();

            if (file == DialogResult.OK)
            {
                // Only File Name
                string fileName = openFileDialog1.SafeFileName;
                // Full Path including file name
                string fullPathFileName = openFileDialog1.FileName;

                // Extract File Path
                string pathOnly = fullPathFileName.Replace(fileName, "");

                // Get Company Logo
                //
                ReportMetadata rmd = new ReportMetadata();
                rmd.ClientUID  = Utils.ClientID;
                rmd.RecordType = FCMConstant.MetadataRecordType.CLIENT;
                rmd.FieldCode  = "COMPANYLOGO";

                rmd.Read(clientUID: Utils.ClientID, fieldCode: "COMPANYLOGO");

                rmd.InformationType = MackkadoITFramework.Helper.Utils.InformationType.IMAGE;
                rmd.ClientType      = "";
                rmd.CompareWith     = "";
                rmd.Description     = "Company";
                // rmd.Condition = fullPathFileName;
                var logoFolder =
                    CodeValue.GetCodeValueExtended(FCMConstant.CodeTypeString.SYSTSET, FCMConstant.SYSFOLDER.LOGOFOLDER);

                // rmd.Condition = logoFolder + fileName;

                // The intention is to save the reference path %XXX%
                //
                rmd.Condition = FCMConstant.SYSFOLDER.LOGOFOLDER + fileName;

                txtLogo1Location.Text = rmd.Condition;

                rmd.Save();

                Bitmap MyImage;
                pbxLogo.SizeMode = PictureBoxSizeMode.StretchImage;
                if (rmd.Condition != null)
                {
                    // MyImage = new Bitmap(rmd.Condition);
                    string logoLocation = logoFolder + fileName;
                    MyImage       = new Bitmap(logoLocation);
                    pbxLogo.Image = (Image)MyImage;
                }
            }
        }
Beispiel #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ReportMetadata rmd = new ReportMetadata();

            rmd.UID        = Convert.ToInt32(txtUID.Text);
            rmd.RecordType = txtRecordType.Text;

            if (string.IsNullOrEmpty(txtClientUID.Text))
            {
                rmd.ClientUID = 0;
            }
            else
            {
                rmd.ClientUID = Convert.ToInt32(txtClientUID.Text);
            }

            rmd.ClientType      = txtClientType.Text;
            rmd.Description     = txtDescription.Text;
            rmd.InformationType = cbxType.Text;
            rmd.FieldCode       = txtFieldCode.Text;
            rmd.Condition       = txtCondition.Text;
            rmd.Condition       = txtCondition.Text;
            rmd.CompareWith     = txtCompareWith.Text;
            rmd.Enabled         = checkEnabled.Checked ? 'Y' : 'N';
            rmd.UseAsLabel      = checkUseLabel.Checked ? 'Y' : 'N';

            rmd.Save();

            MessageBox.Show("Code Type Save Successfully.");

            if (uiReportMetadata != null)
            {
                uiReportMetadata.Show();
            }

            this.Visible = false;


            if (_callingFrom != null &&
                _callingFrom.GetType().Name == "UIReportMetadata")
            {
                UIReportMetadata uirmd = (UIReportMetadata)_callingFrom;
                uirmd.refreshList();
            }
        }
Beispiel #4
0
        /// <summary>
        /// Update logo display flag
        /// </summary>
        private static void UpdateLogoStatus(Client.Client eventClient)
        {
            // Update Logo Display Status
            //
            var rmd = new ReportMetadata
            {
                ClientUID  = Utils.ClientID,
                RecordType = Utils.MetadataRecordType.CLIENT,
                FieldCode  = Utils.FieldCode.COMPANYLOGO
            };


            if (rmd.Read(clientUID: Utils.ClientID, fieldCode: Utils.FieldCode.COMPANYLOGO))
            {
                rmd.Enabled = eventClient.DisplayLogo;
                rmd.Save();
            }

            return;
        }
Beispiel #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ReportMetadata rmd = new ReportMetadata();

            rmd.UID        = Convert.ToInt32(txtUID.Text);
            rmd.RecordType = txtRecordType.Text;

            if (string.IsNullOrEmpty(txtClientUID.Text))
            {
                rmd.ClientUID = 0;
            }
            else
            {
                rmd.ClientUID = Convert.ToInt32(txtClientUID.Text);
            }

            rmd.ClientType      = txtClientType.Text;
            rmd.Description     = txtDescription.Text;
            rmd.InformationType = txtInformationType.Text;
            rmd.FieldCode       = txtFieldCode.Text;
            rmd.TableName       = txtTableName.Text;
            rmd.FieldName       = txtFieldName.Text;
            rmd.FilePath        = txtFilePath.Text;
            rmd.FileName        = txtFileName.Text;

            rmd.Save();

            MessageBox.Show("Code Type Save Successfully.");

            if (uiReportMetadata != null)
            {
                uiReportMetadata.loadMetadataList(rmd.UID);
            }

            this.Visible = false;
        }