Ejemplo n.º 1
0
        // ------------------------------------------------------
        //        Return list of images
        // ------------------------------------------------------
        public static ImageList GetImageList()
        {
            // Image list
            //
            var imageList = new ImageList();

            imageList.Images.Add(Properties.Resources.ImageSelected);      // image 0
            imageList.Images.Add(Properties.Resources.ImageWordDocument);  // image 1
            imageList.Images.Add(Properties.Resources.ImageFolder);        // image 2
            imageList.Images.Add(Properties.Resources.ImageClient);        // image 3
            imageList.Images.Add(Properties.Resources.Appendix);           // image 4
            imageList.Images.Add(Properties.Resources.Excel);              // image 5
            imageList.Images.Add(Properties.Resources.PDF);                // image 6
            imageList.Images.Add(Properties.Resources.Undefined);          // image 7
            imageList.Images.Add(Properties.Resources.Checked);            // image 8
            imageList.Images.Add(Properties.Resources.Unchecked);          // image 9

            imageList.Images.Add(Properties.Resources.WordFile32);         // image 10
            imageList.Images.Add(Properties.Resources.WordFileExists32);   // image 11
            imageList.Images.Add(Properties.Resources.WordFileNotFound32); // image 12

            // Word Images
            imageList.Images.Add(Properties.Resources.WordFileSourceNoDestinationNo);   // image 13
            imageList.Images.Add(Properties.Resources.WordFileSourceNoDestinationYes);  // image 14
            imageList.Images.Add(Properties.Resources.WordFileSourceYesDestinationNo);  // image 15
            imageList.Images.Add(Properties.Resources.WordFileSourceYesDestinationYes); // image 16

            // Excel Images
            imageList.Images.Add(Properties.Resources.ExcelFileSourceNoDestinationNo);   // image 17
            imageList.Images.Add(Properties.Resources.ExcelFileSourceNoDestinationYes);  // image 18
            imageList.Images.Add(Properties.Resources.ExcelFileSourceYesDestinationNo);  // image 19
            imageList.Images.Add(Properties.Resources.ExcelFileSourceYesDestinationYes); // image 20

            // PDF Images
            imageList.Images.Add(Properties.Resources.PDFFileSourceNoDestinationNo);   // image 21
            imageList.Images.Add(Properties.Resources.PDFFileSourceNoDestinationYes);  // image 22
            imageList.Images.Add(Properties.Resources.PDFFileSourceYesDestinationNo);  // image 23
            imageList.Images.Add(Properties.Resources.PDFFileSourceYesDestinationYes); // image 24

            Utils.ImageLogoStartsFrom = 25;

            // load client's logo images
            //
            int logoClientNum = 25;

            foreach (var client in Utils.ClientList)
            {
                // Get Company Logo
                //
                string logoLocation = RepClient.GetClientLogoLocation(client.UID, HeaderInfo.Instance);

                // Check if location exists
                if (!File.Exists(logoLocation))
                {
                    LogFile.WriteToTodaysLogFile(
                        " FCMERR00000009 (02)" +
                        " Error. Client logo not found. " +
                        logoLocation +
                        " Client : " + client.UID,
                        Utils.UserID);
                    return(imageList);
                }

                Bitmap clientImage;
                clientImage = new Bitmap(logoLocation);
                imageList.Images.Add((Image)clientImage);

                client.LogoImageSeqNum = logoClientNum;
                logoClientNum++;
            }

            return(imageList);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Show Client Details
        /// </summary>
        public void ShowClientDetails()
        {
            if (dgvClientList.SelectedRows.Count <= 0)
            {
                return;
            }

            var selectedRow = dgvClientList.SelectedRows;

            txtUID.Text              = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.UID].Value.ToString();
            txtABN.Text              = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.ABN].Value.ToString();
            txtName.Text             = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.Name].Value.ToString();
            txtPhone.Text            = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.Phone].Value.ToString();
            txtFax.Text              = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.Fax].Value.ToString();
            txtAddress.Text          = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.Address].Value.ToString();
            txtContactPerson.Text    = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.MainContactPersonName].Value.ToString();
            txtEmailAddress.Text     = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.EmailAddress].Value.ToString();
            comboUserID.Text         = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.FKUserID].Value.ToString();
            comboContractorSize.Text = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.DocSetUIDDisplay].Value.ToString();
            var dispLogo = selectedRow[0].Cells["dgv" + FCMDBFieldName.Client.DisplayLogo].Value.ToString();

            checkDisplayLogo.Checked = dispLogo == "Y" ? true : false;

            // Store original client data
            //
            original.Name                  = txtName.Text;
            original.ABN                   = txtABN.Text;
            original.Address               = txtAddress.Text;
            original.EmailAddress          = txtEmailAddress.Text;
            original.Fax                   = txtFax.Text;
            original.MainContactPersonName = txtContactPerson.Name;
            original.Phone                 = txtPhone.Text;
            original.FKUserID              = comboUserID.Text;
            original.DocSetUIDDisplay      = comboContractorSize.Text;
            original.DisplayLogo           = Convert.ToChar(dispLogo);

            Utils.ClientID = Convert.ToInt32(txtUID.Text);
            original.UID   = Utils.ClientID;

            // Get Company Logo
            //
            string logoLocation = RepClient.GetClientLogoLocation(Utils.ClientID, HeaderInfo.Instance);
            Bitmap MyImage;

            MyImage       = new Bitmap(logoLocation);
            pbxLogo.Image = (Image)MyImage;


            // Store selected client data
            //
            client.UID                   = Utils.ClientID;
            client.Name                  = txtName.Text;
            client.ABN                   = txtABN.Text;
            client.Address               = txtAddress.Text;
            client.EmailAddress          = txtEmailAddress.Text;
            client.Fax                   = txtFax.Text;
            client.MainContactPersonName = txtContactPerson.Name;
            client.Phone                 = txtPhone.Text;
            client.FKUserID              = comboUserID.Text;
            client.DisplayLogo           = Convert.ToChar(dispLogo);

            // List contracts

            ListClientContract();
        }