private void dgvAdvDetail_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            FormAddAudit        form     = new FormAddAudit();
            SupplierAuditMaster supplier = new SupplierAuditMaster();

            supplier.SupplierNo      = int.Parse(tbSupNo.Text);
            supplier.SupplierAddress = tbAddress.Text;
            supplier.SupplierName    = tbName.Text;
            supplier.SupplierStatus  = 1;
            supplier.SupplierTP01    = tbTPNo1.Text;
            supplier.SupplierTP02    = tbTpNo2.Text;
            supplier.PayMode         = tbPayMode.Text;
            supplier.RouteName       = tbRoute.Text;
            SupplierAudit audit = new SupplierAudit();

            audit.Amount     = float.Parse(dgvAdvDetail.Rows[e.RowIndex].Cells["Advance"].Value.ToString()); //Trn.Date
            audit.TrnDate    = DateTime.Parse(dgvAdvDetail.Rows[e.RowIndex].Cells["Trn.Date"].Value.ToString());
            audit.TrnNumber  = dgvAdvDetail.Rows[e.RowIndex].Cells["VoucherNo"].Value.ToString();
            form.selSupplier = supplier;
            form.audit       = audit;
            form.Owner       = this;

            form.StartPosition = FormStartPosition.CenterParent;
            form.ShowDialog();
        }
Beispiel #2
0
        public List <SupplierAuditMaster> GetSupplierAuditMasters()
        {
            List <SupplierAuditMaster> suppliers = new List <SupplierAuditMaster>();

            sql = " Select * from SupplierAUditMaster";
            //SqlCommand sqlcmd = new SqlCommand(sql);
            dB = new DBAccess();

            DataTable           suptable = dB.GetDataTable(sql, DBAccess.AUDIT);
            SupplierAuditMaster all      = new SupplierAuditMaster();

            all.SupplierName = "All";
            all.id           = -1;
            suppliers.Add(all);
            foreach (DataRow dr in suptable.Rows)
            {
                SupplierAuditMaster master = new SupplierAuditMaster();
                master.id              = int.Parse(dr["id"].ToString());
                master.SupplierName    = dr["SupplierName"].ToString();
                master.SupplierAddress = dr["SupplierAddress"].ToString();
                master.SupplierNo      = int.Parse(dr["SupplierNo"].ToString());
                master.SupplierTP01    = dr["SupplierTP01"].ToString();
                master.SupplierTP02    = dr["SupplierTP02"].ToString();
                master.PayMode         = dr["PayMode"].ToString();
                master.RouteName       = dr["RouteName"].ToString();
                master.SupplierStatus  = int.Parse(dr["SupplierStatus"].ToString());
                suppliers.Add(master);
            }
            dB = null;
            return(suppliers);
        }
Beispiel #3
0
 public DataTable GetAuditReport(SupplierAuditMaster supplier)
 {
     if (supplier == null)
     {
         sql = "Select * from SupplierAUditMaster m inner join SupplierAuditDetail d on m.id = d.SupplierId";
     }
     else
     {
         sql = "Select * from SupplierAUditMaster m inner join SupplierAuditDetail d on m.id = d.SupplierId where m.SupplierNo = " + supplier.SupplierNo;
     }
     dB = new DBAccess();
     return(dB.GetDataTable(sql, DBAccess.AUDIT));
 }
Beispiel #4
0
 public FormAddAudit()
 {
     InitializeComponent();
     selSupplier = new SupplierAuditMaster();
     auditEntry  = new SupplierAuditEntry();
 }