Пример #1
0
 private void radGridView1_CellDoubleClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex > -1)
         {
             if (screen.Equals(1) || //เปิดจากหน้า CreatePart
                 screen.Equals(3) // เปิดจากหน้า Bom โดยเลือกแค่ตัวเดียว
                 )
             {
                 CodeNo_tt.Text = Convert.ToString(e.Row.Cells["InternalNo"].Value);
                 this.Close();
             }
             else if (screen.Equals(2))
             {
                 return;
             }
             else
             {
                 CreatePart sc = new CreatePart(Convert.ToString(e.Row.Cells["InternalNo"].Value));
                 this.Cursor = Cursors.Default;
                 sc.Show();
             }
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Пример #2
0
        private void radButtonElement1_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            CreatePart sc = new CreatePart();

            this.Cursor = Cursors.Default;
            sc.ShowDialog();
            GC.Collect();
            GC.WaitForPendingFinalizers();

            ClassLib.Memory.SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
            ClassLib.Memory.Heap();
        }
Пример #3
0
        private void radButtonElement1_Click(object sender, EventArgs e)
        {
            if (screen == 2)
            {
                try
                {
                    radGridView1.EndEdit();

                    //foreach (var rd1 in radGridView1.Rows)
                    //{
                    //    if(StockControl.dbClss.TBo(rd1.Cells["S"].Value).Equals(true))
                    //    {
                    //        RetDT.Add(rd1);
                    //    }
                    //}
                    foreach (GridViewRowInfo rowinfo in radGridView1.Rows.Where(o => Convert.ToBoolean(o.Cells["S"].Value)))
                    {
                        RetDT.Add(rowinfo);
                    }

                    this.Close();
                }
                catch (Exception ex) { MessageBox.Show(ex.Message); }
            }
            else if (screen == 1 || screen == 3)
            {
                if (radGridView1.Rows.Count > 0)
                {
                    CodeNo_tt.Text = Convert.ToString(radGridView1.CurrentRow.Cells["InternalNo"].Value);
                    this.Close();
                }
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;
                CreatePart sc = new CreatePart();
                this.Cursor = Cursors.Default;
                sc.ShowDialog();
                GC.Collect();
                GC.WaitForPendingFinalizers();

                ClassLib.Memory.SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
                ClassLib.Memory.Heap();
            }
        }
Пример #4
0
 private void radGridView1_CellDoubleClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
 {
     try
     {
         if (screen.Equals(1))
         {
             CodeNo_tt.Text = Convert.ToString(e.Row.Cells["CodeNo"].Value);
             this.Close();
         }
         else
         {
             CreatePart sc = new CreatePart(Convert.ToString(e.Row.Cells["CodeNo"].Value));
             this.Cursor = Cursors.Default;
             sc.Show();
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }