private void ChecklistBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ///New /// string MOSecID = "Test"; string WPID = "Test"; string WPDesc = WPtextBox.Text; DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle handle = DevExpress.XtraSplashScreen.SplashScreenManager.ShowOverlayForm(this); try { MoveToProdind = true; GetFromInfo("1662", MOSecID, WPID, WPDesc); DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); // UpdateSchedule2(SelectedFieldNameDate, SelectedUniqueID); } catch { DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); //MessageBox.Show(@"C:\Mineware\Syncromine\OCRScheduling\OCRApp\OCRWebApiAccess.exe", "Cant Find OCR Application", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void OCRCL_DoubleClick(object sender, EventArgs e) { DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle handle = DevExpress.XtraSplashScreen.SplashScreenManager.ShowOverlayForm(this); try { MoveToProdind = false; GetFromInfo(procs.ExtractBeforeColon(OCRCL.SelectedItem.ToString())); DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); } catch { DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); return; } }
private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ///New DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle handle = DevExpress.XtraSplashScreen.SplashScreenManager.ShowOverlayForm(this); try { MoveToProdind = true; if (SysSettings.Banner == "Doornkop Mine") { GetFromInfo("1273", label5.Text, label4.Text, label6.Text); } if (SysSettings.Banner == "Masimong Mine") { GetFromInfo("1273", label5.Text, label4.Text, label6.Text); } if (SysSettings.Banner == "Joel Mine") { GetFromInfo("1261", label5.Text, label4.Text, label6.Text); } if (SysSettings.Banner == "Kusasalethu Mine") { GetFromInfo("1273", label5.Text, label4.Text, label6.Text); } DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); // UpdateSchedule2(SelectedFieldNameDate, SelectedUniqueID); } catch { DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); //MessageBox.Show(@"C:\Mineware\Syncromine\OCRScheduling\OCRApp\OCRWebApiAccess.exe", "Cant Find OCR Application", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } ///REI ///--All minuses /// ///REM ///--All minuses /// /// }
private void PrintChecklistsBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle handle = DevExpress.XtraSplashScreen.SplashScreenManager.ShowOverlayForm(this); try { DataTable table = ((DataView)viewWorkplaces.DataSource).Table; var myEnumerable = table.AsEnumerable(); _listForms.Clear(); _listForms = (from item in myEnumerable select new ListForms { Section = item.Field <string>("SectionID"), WPID = item.Field <string>("WorkplaceID"), WPName = item.Field <string>("WPName"), FID = item.Field <string>("ChecklistID"), UID = item.Field <int>("UniqueID") }).ToList(); List <string> ChecklistIDList = table.AsEnumerable().Select(x => x["ChecklistID"].ToString()).Distinct().ToList(); foreach (var ID in ChecklistIDList) { string GetFormInfoURL = string.Format(@"/api/Forms/GetFormInfo/"); var client = new Models.ClientConnect(); var param = new Dictionary <string, string>(); param.Add("FormID", ID); var response = System.Threading.Tasks.Task.Run(() => client.GetWithParameters(GetFormInfoURL, param)).Result; _Forms = JsonConvert.DeserializeObject <Models.FormsAPI>(response); _Forms.UniqueDataStructure.TableName = _Forms.TableName; List <ListForms> _FormsL = new List <ListForms>(); _FormsL = _listForms.Where(i => i.FID.Contains(ID.ToString())).ToList(); _Forms.UniqueDataStructure.Rows[0].Delete(); foreach (var form in _FormsL) { try { DataRow row; row = _Forms.UniqueDataStructure.NewRow(); row["MOSectionID"] = form.Section.ToString(); row["Workplaceid"] = form.WPID.ToString(); row["Description"] = form.WPName.ToString(); row["CaptureDate"] = DateTime.Now.ToString("ddMMyyyy"); _Forms.UniqueDataStructure.Rows.Add(row); } catch { continue; } } GetReport(ID); MoveToProd(); //if (MoveToProdind == true) //{ //MovetoProd.DoWork += MovetoProd_DoWork; //MovetoProd.RunWorkerAsync(); // MoveToProd(); foreach (var form in _FormsL) { DateTime dt = (DateTime)DateEdit1.EditValue; UpdateSchedule2("Day" + dt.Day.ToString(), form.UID); } } DateTime it = DateTime.Now; string newFolder = "Mineware_OCR"; string newFolderDay = newFolder + @"\" + it.ToString("yyyy'_'MM'_'dd"); Process.Start("explorer.exe", newFolderDay); } catch { DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); } DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); }
private void NewScanModule_StartingScan(object sender, EventArgs e) { handle = OverlayFormExtensions.ShowProgressPanel(tabControl); barStaticItemStatusMessage.Caption = "Scaning..."; EnablePages(false); }
private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (OCRCL.SelectedIndex == -1) { MessageBox.Show(this, "Please select a Form", "Select a Form"); return; } if (viewWorkplaces.SelectedRowsCount == 0) { MessageBox.Show(this, "Please select at least one workplace to print", "Select a workplace"); return; } DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle handle = DevExpress.XtraSplashScreen.SplashScreenManager.ShowOverlayForm(this); MoveToProdind = true; try { DataTable table = ((DataView)viewWorkplaces.DataSource).Table; Int32[] selectedRowHandles = viewWorkplaces.GetSelectedRows(); _listForms.Clear(); for (int i = 0; i < selectedRowHandles.Length; i++) { int selectedRowHandle = selectedRowHandles[i]; if (selectedRowHandle >= 0) { _listForms.Add(new ListForms { Section = viewWorkplaces.GetRowCellValue(selectedRowHandle, "Sectionid").ToString() , WPID = viewWorkplaces.GetRowCellValue(selectedRowHandle, "WorkplaceID").ToString() , WPName = viewWorkplaces.GetRowCellValue(selectedRowHandle, "Description").ToString() , FID = procs.ExtractBeforeColon(OCRCL.SelectedItem.ToString()) , UID = 0 }); } } string GetFormInfoURL = string.Format(@"/api/Forms/GetFormInfo/"); var client = new Models.ClientConnect(); var param = new Dictionary <string, string>(); param.Add("FormID", procs.ExtractBeforeColon(OCRCL.SelectedItem.ToString())); var response = System.Threading.Tasks.Task.Run(() => client.GetWithParameters(GetFormInfoURL, param)).Result; _Forms = JsonConvert.DeserializeObject <Models.FormsAPI>(response); _Forms.UniqueDataStructure.TableName = _Forms.TableName; List <ListForms> _FormsL = new List <ListForms>(); _FormsL = _listForms.Where(i => i.FID.Contains(procs.ExtractBeforeColon(OCRCL.SelectedItem.ToString()).ToString())).ToList(); _Forms.UniqueDataStructure.Rows[0].Delete(); var allResponses = new List <ListForms>(); for (int i = 0; i < _FormsL.Count; i = i + _PrintBatchNumber) { _Forms.UniqueDataStructure.Rows.Clear(); foreach (var form in _FormsL.Skip(i).Take(_PrintBatchNumber)) { try { DataRow row; row = _Forms.UniqueDataStructure.NewRow(); row["MOSectionID"] = form.Section.ToString(); row["Workplaceid"] = form.WPID.ToString(); row["Description"] = form.WPName.ToString(); row["CaptureDate"] = DateTime.Now.ToString("ddMMyyyy"); _Forms.UniqueDataStructure.Rows.Add(row); } catch { continue; } } GetReport(procs.ExtractBeforeColon(OCRCL.SelectedItem.ToString())); if (MoveToProdind == true) { //MovetoProd.DoWork += MovetoProd_DoWork; //MovetoProd.RunWorkerAsync(); //MovetoProd.RunWorkerCompleted += MovetoProd_RunWorkerCompleted; MoveToProd(); } } DateTime it = DateTime.Now; string newFolder = "Mineware_OCR"; string newFolderDay = newFolder + @"\" + it.ToString("yyyy'_'MM'_'dd") + "_BulkPrint"; Process.Start("explorer.exe", newFolderDay); } catch (Exception error) { DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); } DevExpress.XtraSplashScreen.SplashScreenManager.CloseOverlayForm(handle); }