Example #1
0
 private void button10_Click(object sender, EventArgs e)
 {
     try
     {
         if (dataGridView1.SelectedRows.Count != 0)
         {
             AnbarDataContext anbar = new AnbarDataContext();
             var query = (from table in anbar.Requests
                          where table.ProductID == Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value) && table.RequestDate == dataGridView1.SelectedRows[0].Cells[2].Value.ToString()
                          select table).Single();
             query.ProductID   = Convert.ToInt32(txtcode.Text);
             query.teadad      = Convert.ToInt32(txtteadad.Text);
             query.RequestDate = faDatePicker1.Text;
             query.NeedDate    = faDatePicker2.Text;
             anbar.SubmitChanges();
             clear();
             if (ds.Tables["request"] != null)
             {
                 ds.Tables["request"].Clear();
             }
             da.Fill(ds, "request");
             dataGridView1.DataSource = ds.Tables["request"];
         }
         else
         {
             MessageBox.Show(".هیج رکوردی انتخاب نشده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch
     {
         MessageBox.Show(".عملیات ویرایش موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
        private void btn_delete_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (Convert.ToInt32(dataGridView1.SelectedRows.Count) != 0)
                {
                    DialogResult result;
                    result = MessageBox.Show("آیا قصد حذف رکورد انتخاب شده را دارید ؟", "هشدار", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                    if (result == DialogResult.Yes)
                    {
                        var query = (from tproduct in anbar.Products
                                     where tproduct.ProductID == (int)dataGridView1.SelectedRows[0].Cells[0].Value
                                     select tproduct).Single();
                        anbar.Products.DeleteOnSubmit(query);
                        anbar.SubmitChanges();
                        insertview();
                        clear();
                        if (dataGridView1.SelectedRows.Count != 0)
                        {
                            dataGridView1.SelectedRows[0].Selected = false;
                        }
                    }
                }
                else
                {
                    MessageBox.Show(".هیج رکوردی انتخاب نشده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات حذف موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                Request trequest = new Request();
                trequest.ProductID   = Convert.ToInt32(textBox1.Text);
                trequest.RequestDate = faDatePicker1.Text;
                trequest.NeedDate    = faDatePicker2.Text;
                trequest.teadad      = Convert.ToInt32(textBox3.Text);
                anbar.Requests.InsertOnSubmit(trequest);
                anbar.SubmitChanges();
                FillGridView();
                clear();
                if (dataGridView1.SelectedRows.Count > 0)
                {
                    dataGridView1.SelectedRows[0].Selected = false;
                }
                btn_search.Enabled    = true;
                btn_print.Enabled     = true;
                dataGridView1.Enabled = true;
                btn_cancel.Enabled    = false;
                btn_save.Enabled      = false;
            }
            catch
            {
                MessageBox.Show(".عملیات درج موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #4
0
        private void btn_SaveChenge_Click(object sender, EventArgs e)
        {
            try
            {
                //Update OrderDetails Table
                AnbarDataContext objBank = new AnbarDataContext();
                var query = from table in objBank.OrderDetails
                            select table;
                objDataAdapter.SelectCommand.CommandText = query.ToString() + "where OrderID=" + Program.myOrderID + "";
                SqlCommandBuilder objCommandBuilder = new SqlCommandBuilder(objDataAdapter);
                objDataAdapter.Update(objDataSet, "OrderDetail");

                //Update Orders Table
                var query2 = (from table in objBank.Orders
                              where table.OrderID == Program.myOrderID
                              select table).Single();
                query2.CustomerID = Convert.ToInt32(textBox3.Text);
                query2.Date       = faDatePicker1.Text;
                objBank.SubmitChanges();

                //End Of Update
                ComputePrice();
                MessageBox.Show("Commit Transaction.");
            }
            catch { MessageBox.Show("RollBack Transaction."); }
        }
Example #5
0
        private void btn_edit_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (dataGridView1.SelectedRows.Count != 0)
                {
                    int  i    = 0;
                    bool flag = false;
                    l1 : while (i < dataGridView1.Rows.Count)
                    {
                        if (i == dataGridView1.SelectedRows[0].Index)
                        {
                            i++; goto l1;
                        }
                        if (textBox2.Text == dataGridView1.Rows[i].Cells[1].Value.ToString())
                        {
                            flag = true; goto l2;
                        }
                        i++;
                    }
                    l2 : if (flag == false)
                    {
                        var query = (from table in anbar.Customers
                                     where table.CustomerID == Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value)
                                     select table).Single();
                        query.CustomerID   = Convert.ToInt32(textBox1.Text);
                        query.CustomerName = textBox2.Text;
                        query.CompanyName  = textBox3.Text;
                        query.City         = textBox4.Text;
                        query.PostalCode   = textBox5.Text;
                        query.Phonecompany = textBox6.Text;
                        query.phone        = textBox7.Text;
                        query.Fax          = textBox8.Text;
                        query.Address      = textBox9.Text;
                        anbar.SubmitChanges();
                        insertview();
                        clear();
                        if (dataGridView1.SelectedRows.Count != 0)
                        {
                            dataGridView1.SelectedRows[0].Selected = false;
                        }
                    }
                    else
                    {
                        MessageBox.Show(".این مشتری قبلا به سیستم معرفی شده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show(".هیج رکوردی انتخاب نشده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات ویرایش موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #6
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (checkproductname() == false)
                {
                    Product tproduct = new Product();
                    tproduct.ProductID   = Convert.ToInt32(textBox1.Text);
                    tproduct.ProductName = textBox2.Text;
                    tproduct.CategoryID  = Convert.ToInt32(textBox3.Text);
                    tproduct.Unit        = comboBox1.Text;
                    if (textBox5.Text != "")
                    {
                        tproduct.BuyPrice = Convert.ToInt64(textBox5.Text);
                    }
                    if (textBox6.Text != "")
                    {
                        tproduct.SellPrice = Convert.ToInt64(textBox6.Text);
                    }
                    if (textBox7.Text != "")
                    {
                        tproduct.Mojodi = Convert.ToInt32(textBox7.Text);
                    }
                    if (textBox8.Text != "")
                    {
                        tproduct.St_mojodi = Convert.ToInt16(textBox8.Text);
                    }
                    tproduct.Discountable = checkBox1.Checked;
                    anbar.Products.InsertOnSubmit(tproduct);
                    anbar.SubmitChanges();
                    insertview();
                    clear();
                    if (dataGridView1.SelectedRows.Count != 0)
                    {
                        dataGridView1.SelectedRows[0].Selected = false;
                    }
                    btn_delete.Enabled    = true;
                    btn_search.Enabled    = true;
                    btn_edit.Enabled      = true;
                    btn_cancel.Enabled    = false;
                    btn_save.Enabled      = false;
                    dataGridView1.Enabled = true;
                    //dataGridView1.BindingContext[dataGridView1.DataSource].Position = -1;
                }
                else
                {
                    MessageBox.Show(".این کالا قبلا به سیستم معرفی شده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات درج موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #7
0
        private void button4_Click(object sender, EventArgs e)
        {
            AnbarDataContext Bank = new AnbarDataContext();
            var Query             = (from Table in Bank.Users
                                     where Table.UserName == comboUser.Text
                                     select Table).Single();

            Bank.Users.DeleteOnSubmit(Query);
            Bank.SubmitChanges();
            frmUser_Load(sender, e);
            //comoUser_SelectedIndexChanged(sender, e);
        }
Example #8
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     try
     {
         if (Flag() == true)
         {
             if (txtPass1.Text == txtRePass1.Text)
             {
                 AnbarDataContext Bank      = new AnbarDataContext();
                 User             TableUser = new User();
                 TableUser.Name            = txtName1.Text;
                 TableUser.UserName        = txtUser1.Text;
                 TableUser.PassUser        = txtPass1.Text;
                 TableUser.ManageUser      = chkusers1.Checked;
                 TableUser.SaveImport      = chkSaveImport1.Checked;
                 TableUser.SaveExport      = chkSaveExport1.Checked;
                 TableUser.RemoveImort     = chkRemoveImport1.Checked;
                 TableUser.RemoveExport    = chkRemoveExport1.Checked;
                 TableUser.LockAccountDay  = chkLockAccountDay.Checked;
                 TableUser.AccountCustomer = chkAccountCustomer1.Checked;
                 TableUser.AccountSeller   = chkAccountSeller1.Checked;
                 TableUser.ReachDocument   = chkReach1.Checked;
                 TableUser.AllowReport     = chkReport1.Checked;
                 Bank.Users.InsertOnSubmit(TableUser);
                 Bank.SubmitChanges();
                 frmUser_Load(sender, e);
                 txtName1.Clear();
                 txtUser1.Clear();
                 txtPass1.Clear();
                 txtRePass1.Clear();
                 MessageBox.Show(".اطلاعات كاربر جديد با كوفقيت در سيستم ثبت شد");
                 //MessageBox.Show("/" + txtPass1.Text + "/");
             }
             else
             {
                 MessageBox.Show(".رمز هاي وارد شده شما يكسان نيست", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show(".عمليات ايجاد كاربر جديد ممكن نيست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch
     {
         MessageBox.Show(".عمليات ايجاد كاربر جديد ممكن نيست", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         AnbarDataContext Bank = new AnbarDataContext();
         SellerAccount    objTableSellerAccount = new SellerAccount();
         objTableSellerAccount.EnterID  = Convert.ToInt64(textBox1.Text);
         objTableSellerAccount.Date     = lbl_DateFact.Text;
         objTableSellerAccount.Debit    = Convert.ToInt64(textBox3.Text);
         objTableSellerAccount.Creditor = 0;
         Bank.SellerAccounts.InsertOnSubmit(objTableSellerAccount);
         Bank.SubmitChanges();
         MessageBox.Show("Commit Transaction.");
     }
     catch
     {
         MessageBox.Show("Rollback Transaction.");
     }
 }
Example #10
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (checkcustomername() == false)
                {
                    Customer tcustomer = new Customer();
                    tcustomer.CustomerID   = Convert.ToInt32(textBox1.Text);
                    tcustomer.CustomerName = textBox2.Text;
                    tcustomer.CompanyName  = textBox3.Text;
                    tcustomer.City         = textBox4.Text;
                    tcustomer.PostalCode   = textBox5.Text;
                    tcustomer.Phonecompany = textBox6.Text;
                    tcustomer.phone        = textBox7.Text;
                    tcustomer.Fax          = textBox8.Text;
                    tcustomer.Address      = textBox9.Text;
                    anbar.Customers.InsertOnSubmit(tcustomer);
                    anbar.SubmitChanges();
                    insertview();
                    clear();
                    btn_save.Enabled      = false;
                    btn_cancel.Enabled    = false;
                    btn_delete.Enabled    = true;
                    btn_search.Enabled    = true;
                    btn_edit.Enabled      = true;
                    dataGridView1.Enabled = true;
                    if (dataGridView1.SelectedRows.Count != 0)
                    {
                        dataGridView1.SelectedRows[0].Selected = false;
                    }
                }
                else
                {
                    MessageBox.Show(".این مشتری قبلا به سیستم معرفی شده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات درج موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #11
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         AnbarDataContext Bank = new AnbarDataContext();
         var query             = (from Table in Bank.Users
                                  where Table.UserName == comboUser.Text
                                  select Table).Single();
         if (query != null)
         {
             if (txtPass2.Text == txtRePass2.Text)
             {
                 query.Name            = txtName2.Text;
                 query.PassUser        = txtPass2.Text;
                 query.SaveImport      = chkSaveImport2.Checked;
                 query.SaveExport      = chkSaveExport2.Checked;
                 query.RemoveImort     = ChkRemoveImort2.Checked;
                 query.RemoveExport    = chkRemoveExport2.Checked;
                 query.LockAccountDay  = chkLockAccountDay2.Checked;
                 query.AccountCustomer = ChkAccountCustomer2.Checked;
                 query.AccountSeller   = chkaccountSeller2.Checked;
                 query.ReachDocument   = chkReach2.Checked;
                 query.AllowReport     = chkReport2.Checked;
                 query.ManageUser      = chkUser2.Checked;
                 Bank.SubmitChanges();
                 frmUser_Load(sender, e);
                 //comoUser_SelectedIndexChanged(sender, e);
             }
             else
             {
                 MessageBox.Show(".رمز هاي وارد شده شما يكسان نيست", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
             MessageBox.Show(".عمليات اصلاح كاربر جديد ممكن نيست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch
     {
         MessageBox.Show(".عمليات اصلاح كاربر جديد ممكن نيست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #12
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         AnbarDataContext objBank = new AnbarDataContext();
         CustomerAccount  objTableCustomerAccount = new CustomerAccount();
         objTableCustomerAccount.OrderID  = Convert.ToInt64(textBox7.Text);
         objTableCustomerAccount.Date     = faDatePicker3.Text;
         objTableCustomerAccount.Debit    = 0;
         objTableCustomerAccount.Creditor = Convert.ToInt64(textBox9.Text);
         objBank.CustomerAccounts.InsertOnSubmit(objTableCustomerAccount);
         objBank.SubmitChanges();
         textBox7_Leave(sender, e);
         MessageBox.Show("Commit Transaction.");
     }
     catch
     {
         MessageBox.Show("Rollback Transaction.");
     }
 }
 private void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         AnbarDataContext objBank = new AnbarDataContext();
         EnterDetail      objTableEnterDetails;// = new EnterDetail[objtable.Rows.Count];
         EnterDoc         objTableEnterDoc = new EnterDoc();
         //Insert in Table EnterDocument
         objTableEnterDoc.EnterID  = Convert.ToInt64(textBox1.Text);
         objTableEnterDoc.Date     = Convert.ToString(faDatePicker1.Text);
         objTableEnterDoc.SellerID = Convert.ToInt32(textBox3.Text);
         objTableEnterDoc.Validate = true;
         objBank.EnterDocs.InsertOnSubmit(objTableEnterDoc);
         //Insert Into Table EnterDetails
         for (int i = 0; i < objtable.Rows.Count; i++)
         {
             objTableEnterDetails           = new EnterDetail();
             objTableEnterDetails.EnterID   = Convert.ToInt64(textBox1.Text);
             objTableEnterDetails.ProductID = Convert.ToInt32(objtable.Rows[i][0]);
             objTableEnterDetails.BuyPrice  = Convert.ToInt64(objtable.Rows[i][1]);
             objTableEnterDetails.Teadad    = Convert.ToInt32(objtable.Rows[i][2]);
             objTableEnterDetails.Discount  = Convert.ToSingle(objtable.Rows[i][3]);
             objBank.EnterDetails.InsertOnSubmit(objTableEnterDetails);
         }
         objBank.SubmitChanges();
         MessageBox.Show("Commit Transaction.", "موفق", MessageBoxButtons.OK, MessageBoxIcon.Information);
         //شروع مجدد
         clear();
         textBox1.ReadOnly        = false;
         btn_newfact.Enabled      = true;
         btn_exit.Enabled         = true;
         btn_vieweditfact.Enabled = true;
         btn_newproduct.Enabled   = false;
         btn_save.Enabled         = false;
         btn_cancel.Enabled       = false;
     }
     catch
     {
         MessageBox.Show("Rollback Transaction.", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #14
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (checkgorfeneme() == false)
                {
                    Category tcategory = new Category();
                    tcategory.CategoryID   = Convert.ToInt32(textBox1.Text);
                    tcategory.CategoryName = textBox2.Text;
                    tcategory.Description  = textBox3.Text;
                    anbar.Categories.InsertOnSubmit(tcategory);
                    anbar.SubmitChanges();
                    insertview();
                    clear();
                    btn_save.Enabled      = false;
                    btn_cancel.Enabled    = false;
                    btn_remove.Enabled    = true;
                    btn_search.Enabled    = true;
                    btn_edit.Enabled      = true;
                    dataGridView1.Enabled = true;
                    if (dataGridView1.SelectedRows.Count != 0)
                    {
                        dataGridView1.SelectedRows[0].Selected = false;
                    }
                }
                else
                {
                    MessageBox.Show(".این غرفه قبلا به سیستم معرفی شده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات درج موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #15
0
        private void btn_edit_Click(object sender, EventArgs e)
        {
            AnbarDataContext anbar = new AnbarDataContext();

            try
            {
                if (dataGridView1.SelectedRows.Count != 0)
                {
                    int  i     = 0;
                    bool check = false;
                    l1 : while (i < dataGridView1.Rows.Count)
                    {
                        if (i == dataGridView1.SelectedRows[0].Index)
                        {
                            i++; goto l1;
                        }
                        if (dataGridView1.Rows[i].Cells[1].Value.ToString() == textBox2.Text)
                        {
                            check = true;
                            goto l2;
                        }
                        i++;
                    }
                    l2 : if (check == false)
                    {
                        var query = (from table in anbar.Products
                                     where table.ProductID == Convert.ToInt32(textBox1.Text)
                                     select table).Single();
                        query.ProductID   = Convert.ToInt32(textBox1.Text);
                        query.ProductName = textBox2.Text;
                        query.CategoryID  = Convert.ToInt32(textBox3.Text);
                        query.Unit        = comboBox1.Text;
                        if (textBox5.Text != "")
                        {
                            query.BuyPrice = Convert.ToInt64(textBox5.Text);
                        }
                        if (textBox6.Text != "")
                        {
                            query.SellPrice = Convert.ToInt64(textBox6.Text);
                        }
                        if (textBox7.Text != "")
                        {
                            query.Mojodi = Convert.ToInt32(textBox7.Text);
                        }
                        if (textBox8.Text != "")
                        {
                            query.St_mojodi = Convert.ToInt16(textBox8.Text);
                        }
                        query.Discountable = checkBox1.Checked;
                        anbar.SubmitChanges();
                        insertview();
                        clear();
                        if (dataGridView1.SelectedRows.Count != 0)
                        {
                            dataGridView1.SelectedRows[0].Selected = false;
                        }
                    }
                    else
                    {
                        MessageBox.Show(".این کالا قبلا به سیستم معرفی شده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show(".هیج رکوردی انتخاب نشده است", "دقت کنید", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch
            {
                MessageBox.Show(".عملیات ویرایش موفقیت آمیز نیست", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btn_SaveChenge_Click(object sender, EventArgs e)
        {
            //dataGridView2.DataSource = objDataSet.Tables["EnterDetail"];
            try
            {
                AnbarDataContext objBank = new AnbarDataContext();
                var query = from table in objBank.EnterDetails
                            select table;
                objDataAdapter.SelectCommand.CommandText = query.ToString() + "where EnterId=" + Program.myEnterDocID + "";
                SqlCommandBuilder objCommandBuilder = new SqlCommandBuilder(objDataAdapter);
                objDataAdapter.Update(objDataSet, "EnterDetail");
                ////
                ////Update the mojode in table product code
                ////step 1(search in ObjTable For Deleted Rows
                //bool found = false;
                //for (int i = 0; i < objTable.Rows.Count; i++)
                //{
                //    for (int j = 0; j < dataGridView1.Rows.Count; j++)
                //    {
                //        if (objTable.Rows[i][0] == dataGridView1.Rows[j].Cells[1].Value) { found = true; break; };
                //    }
                //    if (found == false)
                //    {//means that row i Deletet SO I had to mojodi-teadad
                //       var query2 = (from table in objBank.Products
                //                     where table.ProductID == Convert.ToInt32(objTable.Rows[i][0])
                //                     select table).Single();
                //        query2.Mojodi = query2.Mojodi - Convert.ToInt32(objTable.Rows[i][1]);
                //        objBank.SubmitChanges();
                //    }
                //}
                ////
                ////step 2(search the ever of rows in Datagrid with the all rows in ObjTable
                //found = false;

                //for (int i = 0,j=0; i < dataGridView1.Rows.Count; i++)
                //{
                //    for (j = 0; j < objTable.Rows.Count; j++)
                //    {
                //        if (dataGridView1.Rows[i].Cells[1].Value == objTable.Rows[j][0]) { found = true; break;};
                //    }
                //    var query2 = (from table in objBank.Products
                //                  where table.ProductID == Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value)
                //                  select table).Single();
                //    if (found == true)
                //    {//means rows find in objTable
                //        int myint = Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value) - Convert.ToInt32(objTable.Rows[j][0]);
                //        if (myint > 0)
                //            query2.Mojodi = query2.Mojodi + myint;
                //        else if (myint < 0)
                //            query2.Mojodi = query2.Mojodi - myint;
                //    }
                //    else
                //    {
                //        query2.Mojodi = query2.Mojodi + Convert.ToInt32(dataGridView1.Rows[i].Cells[4].Value);
                //    }
                //    objBank.SubmitChanges();
                //}
                ////End Of Edit Mojodi In Table Product
                //objTable.Clear();
                //FillTable();
                compute();
                //Edit EnterDocument Table
                var query3 = (from table in objBank.EnterDocs
                              where table.EnterID == Program.myEnterDocID
                              select table).Single();
                query3.Date     = faDatePicker1.Text;
                query3.SellerID = Convert.ToInt32(textBox3.Text);
                objBank.SubmitChanges();
                MessageBox.Show("Commit Transaction.");
            }
            catch
            {
                MessageBox.Show("RollBack Transaction.");
            }
        }