Beispiel #1
0
        private void radGridView1_CellDoubleClick(object sender, GridViewCellEventArgs e)
        {
            try
            {
                if (MessageBox.Show("สร้างรายการสั่งซื้อ ?", "บันทึก", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    dgvData.EndEdit();
                    //dt_createPR
                    List <GridViewRowInfo> dgvRow_List = new List <GridViewRowInfo>();

                    dgvRow_List.Add(dgvData.CurrentRow);

                    if (dgvRow_List.Count() > 0)
                    {
                        CreatePR MS = new CreatePR(dgvRow_List);
                        MS.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("กรุณาเลือกรายการ");
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Beispiel #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("สร้างรายการสั่งซื้อ ?", "บันทึก", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                dgvData.EndEdit();
                //dt_createPR
                List <GridViewRowInfo> dgvRow_List = new List <GridViewRowInfo>();
                string CodeNo = "";
                foreach (GridViewRowInfo rowinfo in dgvData.Rows.Where(o => Convert.ToBoolean(o.Cells["S"].Value)))
                {
                    CodeNo = Convert.ToString(rowinfo.Cells["CodeNo"].Value);

                    if (CheckDuplicate(CodeNo))
                    {
                        MessageBox.Show("ไม่สามารถสั่งซื้อต่างผู้ขายได้");
                        break;
                    }
                    else
                    {
                        dgvRow_List.Add(rowinfo);
                    }
                }

                if (dgvRow_List.Count() > 0)
                {
                    CreatePR MS = new CreatePR(dgvRow_List);
                    MS.ShowDialog();
                }
                else
                {
                    MessageBox.Show("กรุณาเลือกรายการ");
                }
            }
        }
Beispiel #3
0
        private void openPRToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (dgvData.Rows.Count <= 0)
                {
                    return;
                }

                string TempNo1 = dbClss.TSt(dgvData.CurrentRow.Cells["TempNo"].Value);

                if (dbClss.TSt(dgvData.CurrentRow.Cells["PRNo"].Value) != "") //&& ddlTypeReceive.Text =="PR")
                {
                    //string TEmpPR = "";
                    //using (DataClasses1DataContext db = new DataClasses1DataContext())
                    //{
                    //    var g = (from ix in db.tb_PurchaseRequests select ix)
                    //   .Where(a => a.PRNo == dbClss.TSt(dgvData.CurrentRow.Cells["PRNo"].Value)
                    //    && (a.Status != "Cancel")
                    //    ).ToList();
                    //    if (g.Count() > 0)
                    //    {
                    //        TEmpPR = dbClss.TSt(g.FirstOrDefault().TEMPNo);
                    //    }
                    //}
                    if (TempNo1 != "")
                    {
                        CreatePR op = new CreatePR(TempNo1);
                        op.ShowDialog();
                    }
                }
                else if (dbClss.TSt(dgvData.CurrentRow.Cells["PRNo"].Value) != "")// && ddlTypeReceive.Text == "PO")
                {
                    //string TEmpPR = "";
                    //using (DataClasses1DataContext db = new DataClasses1DataContext())
                    //{
                    //    var g = (from ix in db.tb_PurchaseOrders select ix)
                    //   .Where(a => a.PONo == dbClss.TSt(dgvData.CurrentRow.Cells["PRNo"].Value)
                    //    && (a.Status != "Cancel")
                    //    ).ToList();
                    //    if (g.Count() > 0)
                    //    {
                    //        TEmpPR = dbClss.TSt(g.FirstOrDefault().TempPNo);
                    //    }
                    //}
                    if (TempNo1 != "")
                    {
                        CreatePO op = new CreatePO(TempNo1);
                        op.ShowDialog();
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Beispiel #4
0
        private void radButtonElement1_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            CreatePR sc = new CreatePR();

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

            ClassLib.Memory.SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
            ClassLib.Memory.Heap();
        }
Beispiel #5
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["TempNo"].Value);
             this.Close();
         }
         else
         {
             CreatePR a = new CreatePR(Convert.ToString(e.Row.Cells["TempNo"].Value));
             a.ShowDialog();
             this.Close();
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Beispiel #6
0
        private void radButtonElement1_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    if (screen.Equals(1))
            //    {
            //        CodeNo_tt.Text = Convert.ToString(e.Row.Cells["TempNo"].Value);
            //        this.Close();
            //    }
            //    else
            //    {
            //        CreatePR a = new CreatePR(Convert.ToString(e.Row.Cells["TempNo"].Value));
            //        a.ShowDialog();
            //        //this.Close();
            //    }

            //}
            //catch (Exception ex) { MessageBox.Show(ex.Message); }

            if (screen.Equals(1))
            {
                if (radGridView1.Rows.Count > 0)
                {
                    CodeNo_tt.Text = Convert.ToString(radGridView1.CurrentRow.Cells["TempNo"].Value);
                    this.Close();
                }
            }
            else
            {
                this.Cursor = Cursors.WaitCursor;
                CreatePR sc = new CreatePR();
                this.Cursor = Cursors.Default;
                sc.ShowDialog();
                GC.Collect();
                GC.WaitForPendingFinalizers();

                ClassLib.Memory.SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
                ClassLib.Memory.Heap();
            }
        }