コード例 #1
0
ファイル: frmBangQuyetToan.cs プロジェクト: hoangtamit/NKV
        private void btnXem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Bạn có muốn xác nhận không", "Cảnh báo", MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                // Create an empty list.
                var rows = new ArrayList();
                // Add the selected rows to the list.
                for (var i = 0; i < gridView1.SelectedRowsCount; i++)
                {
                    if (gridView1.GetSelectedRows()[i] >= 0)
                    {
                        rows.Add(gridView1.GetDataRow(gridView1.GetSelectedRows()[i]));
                    }
                }
                if ((Convert.ToInt32(rows.Count) > 0))
                {
                    try
                    {
                        gridView1.BeginUpdate();
                        foreach (var t in rows)
                        {
                            var row = t as DataRow;
                            // Change the field value.
                            if (row == null)
                            {
                                continue;
                            }
                            var a = row["SCD"];
                            row.ItemArray = new object[4];
                            var db  = new MyDBContextDataContext();
                            var dsx = (from s in db.DonSanXuat_TienTe_View() where s.SCD == a.ToString() select s).Single();
                            dsx.KetChuyen = "1";
                            db.SubmitChanges();
                        }
                    }
                    finally
                    {
                        gridView1.EndUpdate();
                        MessageBox.Show(" Xác nhận thành công");
                        frmBangQuyetToan_Load(sender, e);
                    }
                }
                else
                {
                    MessageBox.Show(" Xác nhận thất bại");
                }
            }
            else
            {
                MessageBox.Show(" Xác nhận thất bại");
            }

            frmBangQuyetToan_Load(sender, e);
        }
コード例 #2
0
        private void frmDonHang_Load(object sender, EventArgs e)
        {
            var db  = new MyDBContextDataContext();
            var lst = (from s in db.DonSanXuat_TienTe_View() where s.KetChuyen == "1" select s).ToList();

            foreach (var item in lst)
            {
                if (item.VAT == 1.1)
                {
                    item.VAT = 1.1;
                }
            }
            tbDonSanXuatGridControl.DataSource = lst;
        }
コード例 #3
0
ファイル: frmBangQuyetToan.cs プロジェクト: hoangtamit/NKV
        public void check()
        {
            var db  = new MyDBContextDataContext();
            var dsx = (from a in db.DonSanXuat_TienTe_View() where a.KetChuyen == null select a).ToList();

            dt = dsxCtr.LoadData_DonSanXuat_TienTe();
            foreach (var item in dsx)
            {
                // ReSharper disable once CompareOfFloatsByEqualityOperator
                if (item.VAT != null && item.VAT == 1.1)
                {
                    item.VAT = 1.1;
                }
            }
            gcDonSanXuat.DataSource = dsx;
            sCDLabel1.DataBindings.Clear();
            sCDLabel1.DataBindings.Add("text", gcDonSanXuat.DataSource, "IDTienTe");
            sCDLabel1.Hide();
        }
コード例 #4
0
ファイル: frmBangQuyetToan.cs プロジェクト: hoangtamit/NKV
 private void hiendonhang_CheckedChanged(object sender, EventArgs e)
 {
     if (hiendonhang.Checked == true)
     {
         var db  = new MyDBContextDataContext();
         var dsx = db.DonSanXuat_TienTe_View().ToList();
         foreach (var item in dsx)
         {
             // ReSharper disable once CompareOfFloatsByEqualityOperator
             if (item.VAT == 1.1)
             {
                 item.VAT = 1.1;
             }
         }
         gcDonSanXuat.DataSource = dsx;
     }
     else
     {
         frmBangQuyetToan_Load(sender, e);
     }
 }