Ejemplo n.º 1
0
 private static void UpdateWaitForm(CustomWaitForm waitForm, string description)
 {
     waitForm.SetDescription(description);
     if (totalLength > 0 && currentLength <= totalLength)
     {
         int currentValue = (currentLength * 100) / totalLength;
         waitForm.pbcMain.Position = currentValue;
     }
     currentLength++;
 }
Ejemplo n.º 2
0
        public static void LoadSystemBuffer(ref CustomWaitForm waitForm)
        {
            currentLength                     = 1;
            totalLength                       = 14;
            waitForm.UseWaitCursor            = true;
            waitForm.progWaitForm.ShowCaption = false;
            waitForm.tableLayoutPanel1.RowStyles[0].SizeType = SizeType.Absolute;
            waitForm.tableLayoutPanel1.RowStyles[0].Height   = 0;
            waitForm.pictureBox1.Visible = false;
            openedNotes = new List <Note>();
            UpdateWaitForm(waitForm, "Loading Current Company Detail . . . ");
            currentCompany = DataManager.OrganizationSelectByID(Constants.companyCode);
            UpdateWaitForm(waitForm, "Loading Registered Devices . . . ");
            allDevice = DataManager.DeviceSelectAll();
            UpdateWaitForm(waitForm, "Loading System Constants . . . ");
            allSystemConstant = DataManager.SystemConstantSelectAll();
            UpdateWaitForm(waitForm, "Loading System Lookup Defintions . . . ");
            allLookupDefinition = DataManager.LookupDefinitionSelectAll();
            UpdateWaitForm(waitForm, "Loading System Category Defintions . . . ");
            allCategoryDefintion = DataManager.CategoryDefinitionSelectAll();
            UpdateWaitForm(waitForm, "Populating default data . . . ");
            defaultCategory   = allCategoryDefintion.FirstOrDefault(p => p.ID == Constants.DefaultCategory);
            headOfficeBranch  = allCategoryDefintion.FirstOrDefault(p => p.ID == Constants.HeadOffice);
            mainStore         = allCategoryDefintion.FirstOrDefault(p => p.ID == Constants.MainStore);
            adminRole         = allCategoryDefintion.FirstOrDefault(p => p.ID == Constants.AdminRole);
            defaultDepartment = allCategoryDefintion.FirstOrDefault(p => p.ID == Constants.DefaultDepartment);
            currentBranch     = allCategoryDefintion.FirstOrDefault(p => p.ID == currentDevice.branch);
            if (currentCompany != null)
            {
                if (File.Exists(currentCompany.mediaURL))
                {
                    companyLogo = new Bitmap(currentCompany.mediaURL);
                }
            }
            UpdateWaitForm(waitForm, "Loading System ID Settings . . . ");
            allIDSetting = DataManager.IDSettingSelectAll();
            UpdateWaitForm(waitForm, "Loading System Settings . . . ");
            allSettings = DataManager.SettingSelectAll();
            UpdateWaitForm(waitForm, "Loading System User Details . . . ");
            allUserDetail = DataManager.UserDetailSelectAll();
            UpdateWaitForm(waitForm, "Loading System Item Master . . . ");
            allItemMaster = DataManager.ItemMasterSelectAll();
            UpdateWaitForm(waitForm, "Loading System Person . . . ");
            allPerson = DataManager.PersonSelectAll();
            UpdateWaitForm(waitForm, "Loading System Organizations . . . ");
            allOrganization = DataManager.OrganizationSelectAll();
            UpdateWaitForm(waitForm, "Loading ReferenceList . . . ");
            allReferenceList = PopulateReferenceList();

            currentLength = totalLength;
            UpdateWaitForm(waitForm, "Ready to Go!");
            waitForm.UseWaitCursor = false;
            waitForm.progWaitForm.LineAnimationElementHeight = 0;
            waitForm.progWaitForm.WaitAnimationType          = DevExpress.Utils.Animation.WaitingAnimatorType.Line;
        }