private void btnFull_Click(object sender, EventArgs e) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { Int32 activeCount = 0; switch (tcDetail.SelectedIndex) { case 0: Int32 totalCount; Int32 predCount; ClassFactory.DataBase.GetCountParamsQty((Int32)LocateCurrentRow["Id_PlacementActivityLine"], out totalCount, out predCount, out activeCount); if (predCount + activeCount < totalCount) { EnterItemQuantity(PickFactory.Locate, (Int32)LocateCurrentRow["Id_PlacementActivityLine"], totalCount - predCount - activeCount); } break; case 1: activeCount = ClassFactory.DataBase.GetCountCurrentActivityLine((Int32)ProcessedCurrentRow["Id_ActivityLine"]); EnterItemQuantity(PickFactory.Processed, (Int32)ProcessedCurrentRow["Id_ActivityLine"], activeCount); break; case 2: break; default: break; } CheckActiveTab(); } }
private void RegisterDocument() { using (CursorWait cw = CursorWait.CreateWaitCursor()) { if (ObjectFactory.ActivityLine().Count > 0) { if (!ClassFactory.DataBase.ActiveLineIsBinCodeEmpty()) { if (ClassFactory.Logic.RegisterPlacement(false)) { ClassFactory.Logic.DeleteActivityData(); ClassFactory.Logic.LoadDocPlacementDetails(ObjectFactory.PlacementActivityHeader().No); InitEnterItem(); } } else { MyClass.ShowWarning("Регистрация невозможна. Укажите ячейки"); } } else { ClassFactory.Logic.DeleteActivityData(); InitEnterItem(); } CheckActiveTab(); } }
private void ChangeProcessedRowGrid() { using (CursorWait cw = CursorWait.CreateWaitCursor()) { mDetails.Text = String.Concat((String)ProcessedCurrentRow["ItemNo"], "\r\n", (String)ProcessedCurrentRow["UnitOfMeasure"], "\r\n", (String)ProcessedCurrentRow["Description"]); } }
private void grDetail_CurrentCellChanged(object sender, EventArgs e) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { ShowLineDetailFromGrid(((DataGrid)sender)); } }
private void InitPlacementActivity(String aDocumentNo) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { PrepareComponentPlacementActivity(); if (ClassFactory.Logic.LoadDocPlacementDetails(aDocumentNo)) { ObjectPlacementActivityHeader pah = ObjectFactory.PlacementActivityHeader(); if (pah.Id_PlacementActivityHeader != 0) { cmbBarCode.Tag = pah; ClassFactory.DataBase.BindingSource.AssignDetail(bsDetail); btnSubmit.Enabled = true; if (bsDetail.Count > 0) { grDetail.CurrentRowIndex = 0; ShowLineDetailFromGrid(grDetail); } } else { MyClass.ShowWarning("Заданий на раскладку не найдено"); PrepareComponentPlacementActivity(); cmbBarCode.Focus(); } } else { PrepareComponentPlacementActivity(); cmbBarCode.Focus(); } } }
private void ChangeLocateRowGrid() { using (CursorWait cw = CursorWait.CreateWaitCursor()) { edtBinCode.Tag = LocateCurrentRow; edtBinCode.Text = (String)LocateCurrentRow["BinCode"]; mDetails.Text = String.Concat((String)LocateCurrentRow["ItemNo"], " ", (String)LocateCurrentRow["UnitOfMeasure"], "\r\n", (String)LocateCurrentRow["Description"], "\r\n", Convert.ToString((Int32)LocateCurrentRow["BinContQty"])); } }
private void FormDetail_Closing(object sender, CancelEventArgs e) { e.Cancel = false; using (CursorWait cw = CursorWait.CreateWaitCursor()) { if (ObjectFactory.ActivityLine().Count != 0) { e.Cancel = true; MyClass.ShowWarning("Остались незарегистрированные строки!"); } } }
private void InitLogin(String aUserBarCode) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { GC.Collect(); Boolean correctLogin = true; if (ClassFactory.DataBase.IsDataExists()) { correctLogin = ClassFactory.Logic.ProcessedLiveExpiredData(); } if (correctLogin) { if (!FFirstLogin) { ClassFactory.Logic.Logout(); } if (ClassFactory.Logic.DeleteAllData()) { if (ClassFactory.Logic.Login(aUserBarCode)) { FFirstLogin = false; ObjectEmployee employee = ObjectFactory.Employee(); edtName.Tag = employee; edtName.Text = employee.UserName; if (ClassFactory.Logic.LoadDocNumbers()) { FillDocumentNumbers(); } cmbBarCode.Enabled = true; cmbBarCode.BackColor = SystemColors.Window; cmbBarCode.Focus(); PrepareComponentPlacementActivity(); } else { PrepareComponentLogin(); } } else { MyClass.ShowWarning("Данные не очищенны для работы."); } } } }
private void FormMain_Closing(object sender, CancelEventArgs e) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { e.Cancel = false; if (ObjectFactory.Session().Id_Session > 0) { if (!ClassFactory.Logic.Logout()) { if (!MyClass.ShowQuestion("Не удалось корректно завершить сессию. Продолжить выход из программы?")) { e.Cancel = true; } } } } }
private void CheckScan(String aText) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { switch (FStatus) { case 1: EnterBarCodeItem(aText); break; case 2: EnterItemOrCountOrCell(aText); break; default: MyClass.ShowError("Неизвестный статус"); break; } CheckActiveTab(); } }
private void btnOne_Click(object sender, EventArgs e) { using (CursorWait cw = CursorWait.CreateWaitCursor()) { switch (tcDetail.SelectedIndex) { case 0: EnterItemQuantity(PickFactory.Locate, (Int32)LocateCurrentRow["Id_PlacementActivityLine"], 1); break; case 1: EnterItemQuantity(PickFactory.Processed, (Int32)ProcessedCurrentRow["Id_ActivityLine"], 1); break; case 2: break; default: break; } CheckActiveTab(); } }
private void CheckActiveTab() { using (CursorWait cw = CursorWait.CreateWaitCursor()) { GC.Collect(); CheckInfo(edtItemNo2.Text); RefreshLocateGrid(); bsItemCell.DataSource = null; cbChangeCell.Checked = false; switch (tcDetail.SelectedIndex) { case 0: btnOne.Text = "+1"; btnFull.Text = "+N"; break; case 1: btnOne.Text = "-1"; btnFull.Text = "-N"; RefreshProcessedGrid(); break; case 2: btnOne.Text = ""; btnFull.Text = ""; RefreshItemCellGrid(); break; default: btnOne.Text = ""; btnFull.Text = ""; break; } UpdateAction(); } }