Пример #1
0
        public LogicResult deleteCustomerLogic(FormSearchCustomerObj obj)
        {
            KhachHangDao khDao     = new KhachHangDao();
            LienHeDao    lienHeDao = new LienHeDao();

            khDao.deleteKhachHang(obj.idKhachHang);
            List <LienHeDto> listLienHeOld = lienHeDao.getListLienHe(obj.idKhachHang);

            if (listLienHeOld.Count > 0)
            {
                lienHeDao.delete(obj.idKhachHang);
            }
            return(new LogicResult(Contanst.MSG_INFO, AppUtils.getAppConfig("MSGINFO005"), null));
        }
Пример #2
0
        public LogicResult updateCustommerLogic(FormAddCustomerObj obj)
        {
            KhachHangDto khDto = createKhachHangDto(obj);

            khDto.createTime = System.DateTime.Now;
            KhachHangDao khDao = new KhachHangDao();

            khDao.update(khDto);
            LienHeDao        lienHeDao     = new LienHeDao();
            List <LienHeDto> listLienHeOld = lienHeDao.getListLienHe(khDto.idKhachHang);

            if (listLienHeOld.Count > 0)
            {
                lienHeDao.delete(khDto.idKhachHang);
            }
            if (obj.listContracts.Count > 0)
            {
                lienHeDao.insertList(obj.listContracts);
            }
            return(new LogicResult(Contanst.MSG_INFO, AppUtils.getAppConfig("MSGINFO004"), null));
        }