private void InsertCTPhieuThu(int ma)
 {
     Info.CTPHIEUTHU info = new Info.CTPHIEUTHU();
     if (rdKH.Checked == true)
     {
         for (int i = 0; i < lvThu.Items.Count; i++)
         {
             try
             {
                 info = SetInfoCTPIEUTHU(ma, lvThu.Items[i].SubItems[1].Text, float.Parse(lvThu.Items[i].SubItems[2].Text));
                 BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
                 tPhieuThu.InsertCT_PHIEUTHU(info);
             }
             catch (Exception ex)
             {
                 TLog.WriteErr("frmPHIEUTHU_InsertCTPhieuThu", ex.Message + "|" + ex.StackTrace);
             }
         }
     }
     else
     {
         try
         {
             info = SetInfoCTPIEUTHU(ma, DBNull.Value.ToString(), float.Parse(txtTongTien.Text));
             BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
             tPhieuThu.InsertCT_PHIEUTHU(info);
         }
         catch (Exception ex)
         {
             TLog.WriteErr("frmPHIEUTHU_InsertCTPhieuThu", ex.Message + "|" + ex.StackTrace);
         }
     }
 }
 private void InsertPhieuThu()
 {
     if (rdKH.Checked == true)
     {
         infoPhieuThu = SetInfoPHIEUXUAT();
     }
     else
     {
         infoPhieuThu = SetInfoPHIEUXUAT_Khac();
     }
     BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
     infoPhieuThu.Ma = tPhieuThu.InsertPHIEUTHU(infoPhieuThu);
 }
Пример #3
0
 private void InsertPhieuThu()
 {
     if (rdKH.Checked == true)
         infoPhieuThu = SetInfoPHIEUXUAT();
     else
         infoPhieuThu = SetInfoPHIEUXUAT_Khac();
     BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
     infoPhieuThu.Ma = tPhieuThu.InsertPHIEUTHU(infoPhieuThu);
 }
Пример #4
0
        private void InsertCTPhieuThu(int ma)
        {
            Info.CTPHIEUTHU info = new Info.CTPHIEUTHU();
            if (rdKH.Checked == true)
            {
                for (int i = 0; i < lvThu.Items.Count; i++)
                {
                    try
                    {
                        info = SetInfoCTPIEUTHU(ma, lvThu.Items[i].SubItems[1].Text, float.Parse(lvThu.Items[i].SubItems[2].Text));
                        BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
                         tPhieuThu.InsertCT_PHIEUTHU(info);

                    }
                    catch (Exception ex)
                    {
                        TLog.WriteErr("frmPHIEUTHU_InsertCTPhieuThu", ex.Message + "|" + ex.StackTrace);
                    }

                }
            }
            else {
                try
                {
                    info = SetInfoCTPIEUTHU(ma, DBNull.Value.ToString(), float.Parse(txtTongTien.Text));
                    BLL.TPhieuThu tPhieuThu = new BLL.TPhieuThu();
                   tPhieuThu.InsertCT_PHIEUTHU(info);
                }
                catch (Exception ex)
                {
                    TLog.WriteErr("frmPHIEUTHU_InsertCTPhieuThu", ex.Message + "|" + ex.StackTrace);
                }

            }
        }