Ejemplo n.º 1
0
        private void dgvRollersInColor_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            PercentageDataGrid senderGrid = (PercentageDataGrid)sender;

            if (senderGrid.SelectedRows.Count == 0)
            {
                return;
            }

            if (senderGrid.Columns[e.ColumnIndex].Name == "Column1" && e.RowIndex >= 0)
            {
                bool OKSplit            = false;
                int  ManufactureStoreID = 0;
                int  NewCount           = 0;
                int  OldCount           = 0;

                if (senderGrid.SelectedRows[0].Cells["ManufactureStoreID"].Value != DBNull.Value)
                {
                    ManufactureStoreID = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["ManufactureStoreID"].Value);
                }
                if (senderGrid.SelectedRows[0].Cells["CurrentCount"].Value != DBNull.Value)
                {
                    OldCount = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["CurrentCount"].Value);
                }
                PhantomForm PhantomForm = new Infinium.PhantomForm();
                PhantomForm.Show();

                SplitAssignmentRequestMenu SplitAssignmentRequestMenu = new SplitAssignmentRequestMenu(true, OldCount);
                TopForm = SplitAssignmentRequestMenu;
                SplitAssignmentRequestMenu.ShowDialog();

                OKSplit  = SplitAssignmentRequestMenu.OKSplit;
                NewCount = SplitAssignmentRequestMenu.Count;

                PhantomForm.Close();
                PhantomForm.Dispose();
                SplitAssignmentRequestMenu.Dispose();
                TopForm = null;
                if (OKSplit)
                {
                    ProfileAssignmentsManager.AddTransferredRoller(DecorAssignmentID, ManufactureStoreID, NewCount);
                    //ProfileAssignmentsManager.WriteOffFromManufactureStoreByManufactureStoreID(ManufactureStoreID, NewCount);
                    ProfileAssignmentsManager.SaveTransferredRollers();
                    ProfileAssignmentsManager.GetTransferredRollers(DecorAssignmentID);
                    ProfileAssignmentsManager.GetRollersInColorOnStorage(CoverID);
                    InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
                }
            }
        }
Ejemplo n.º 2
0
        private void dgvTransferredRollers_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            PercentageDataGrid senderGrid = (PercentageDataGrid)sender;

            if (senderGrid.SelectedRows.Count == 0)
            {
                return;
            }

            if (senderGrid.Columns[e.ColumnIndex].Name == "Column1" && e.RowIndex >= 0)
            {
                bool    OKSplit     = false;
                decimal NewDiameter = 0;
                decimal NewWidth    = 0;
                int     NewCount    = 0;

                PhantomForm PhantomForm = new Infinium.PhantomForm();
                PhantomForm.Show();

                SplitAssignmentRequestMenu SplitAssignmentRequestMenu = new SplitAssignmentRequestMenu(false, 0);
                TopForm = SplitAssignmentRequestMenu;
                SplitAssignmentRequestMenu.ShowDialog();

                OKSplit     = SplitAssignmentRequestMenu.OKSplit;
                NewDiameter = SplitAssignmentRequestMenu.Diameter;
                NewWidth    = SplitAssignmentRequestMenu.iWidth;
                NewCount    = SplitAssignmentRequestMenu.Count;

                PhantomForm.Close();
                PhantomForm.Dispose();
                SplitAssignmentRequestMenu.Dispose();
                TopForm = null;

                //int StoreItemID = -1;
                //decimal Length = -1;
                //decimal Width = -1;
                //decimal Height = -1;
                //decimal Thickness = -1;
                //decimal Diameter = -1;
                //decimal Admission = -1;
                //decimal Capacity = -1;
                //decimal Weight = -1;
                //int ColorID = -1;
                //int PatinaID = -1;
                ////int CoverID = -1;
                //int FactoryID = 1;
                //string Notes = string.Empty;

                //if (senderGrid.SelectedRows[0].Cells["Width"].Value != DBNull.Value)
                //    Width = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["Width"].Value);
                //if (senderGrid.SelectedRows[0].Cells["Thickness"].Value != DBNull.Value)
                //    Thickness = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["Thickness"].Value);
                //if (senderGrid.SelectedRows[0].Cells["Diameter"].Value != DBNull.Value)
                //    Diameter = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["Diameter"].Value);
                //if (senderGrid.SelectedRows[0].Cells["StoreItemID"].Value != DBNull.Value)
                //    StoreItemID = Convert.ToInt32(senderGrid.SelectedRows[0].Cells["StoreItemID"].Value);

                if (OKSplit)
                {
                    ProfileAssignmentsManager.AddReturnRoller(DecorAssignmentID, NewDiameter, NewWidth, NewCount);
                    ProfileAssignmentsManager.SaveTransferredRollers();
                    int ReturnedRollerID = ProfileAssignmentsManager.GetTransferredRollers(DecorAssignmentID);

                    //ProfileAssignmentsManager.AssignmentsStoreManager.AddToManufactureStore(DecorAssignmentID, StoreItemID, Length, NewWidth, Height, Thickness,
                    //    NewDiameter, Admission, Capacity, Weight, ColorID, PatinaID, -1, NewCount, FactoryID, Notes, ReturnedRollerID);
                    ProfileAssignmentsManager.GetRollersInColorOnStorage(CoverID);
                    InfiniumTips.ShowTip(this, 50, 85, "Сохранено", 1700);
                }
            }
            if (senderGrid.Columns[e.ColumnIndex].Name == "Column2" && e.RowIndex >= 0)
            {
                bool OKCancel = Infinium.LightMessageBox.Show(ref TopForm, true,
                                                              "Продолжить?",
                                                              "Удаление");

                if (!OKCancel)
                {
                    return;
                }
                ProfileAssignmentsManager.RemoveTransferredRoller();
                ProfileAssignmentsManager.SaveTransferredRollers();
                ProfileAssignmentsManager.GetTransferredRollers(DecorAssignmentID);
                ProfileAssignmentsManager.GetRollersInColorOnStorage(CoverID);
                InfiniumTips.ShowTip(this, 50, 85, "Удалено", 1700);
            }
        }