Ejemplo n.º 1
0
        void DoView(string invno)
        {
             
            txtinvoiceno.Caption = invno;
            dsInventory1.Clear();

            var bl = new BLSales();
            bl.GetSalesInvDetail(invno);
            var salesdt = bl.GetSalesInvMainBySinvno(invno);

            dsInventory1.Merge(bl.Salesinvdetail);

            foreach(DsInventory.SALESMAINRow dr  in salesdt.Rows)
            {
               if(! dr.IsSDISCNull() )
               {
                  txtdiscount.EditValue = dr.SDISC;
               }
                if (!dr.IsCUSTOMERIDNull())
                {
                    lookupcustomer.EditValue = dr.CUSTOMERID;
                    if (!dr.IsCARDIDNull())
                        txtfileno.EditValue = dr.CARDID;
                    if(!dr.IsCARDDISCNull())
                         cutomerpayment.EditValue = dr.CARDDISC;
                    if (!dr.IsGRADENull())
                        cmbclass.EditValue = dr.GRADE;
                }
                else
                {
                    lookupcustomer.EditValue = null;
                    txtfileno.EditValue = null;
                    txtvisitno.EditValue = null;
                    cmbclass.EditValue = null;
                    cutomerpayment.EditValue = null;
                    txtpatname.EditValue = null;
                    txtrounding.EditValue = 0;
                    panelinsurance.Visible = false;
                    panelnormalcustomer.Visible = false; 
                }
            }
          

            foreach (DsInventory.SALESINVDETAILRow dr in dsInventory1.SALESINVDETAIL.Rows)
            {
                if (!dr.IsEXPDATENull())
                    dr["EXPDATE1"] = dr.EXPDATE.ToString("MM-yy");
            }
            bl.DoUnHold(invno);
            UpdateTotal();
        }