Exemple #1
0
        public static string Insert(DmucDichvuclsChitiet objClsChitiet, QheCamchidinhChungphieuCollection lstQhe, QheDichvuMauketquaCollection lstqhemauKq)
        {
            try
            {
                using (var scope = new TransactionScope())
                {
                    using (var sh = new SharedDbConnectionScope())
                    {
                        objClsChitiet.Save();
                        if (!objClsChitiet.IsNew)
                        {
                            new Update(KcbChidinhclsChitiet.Schema)
                            .Set(KcbChidinhclsChitiet.Columns.IdDichvu).EqualTo(objClsChitiet.IdDichvu)
                            .Where(KcbChidinhclsChitiet.Columns.IdChitietdichvu).IsEqualTo(objClsChitiet.IdChitietdichvu)
                            .Execute();

                            //new Update(KcbThanhtoanChitiet.Schema)
                            //    .Set(KcbThanhtoanChitiet.Columns.IdDichvu).EqualTo(objClsChitiet.IdDichvu)
                            //    .Set(KcbThanhtoanChitiet.Columns.TenChitietdichvu).EqualTo(objClsChitiet.TenChitietdichvu)
                            //    .Where(KcbThanhtoanChitiet.Columns.IdLoaithanhtoan).IsEqualTo(2)
                            //    .And(KcbThanhtoanChitiet.Columns.IdChitietdichvu).IsEqualTo(objClsChitiet.IdChitietdichvu)
                            //    .Execute();
                        }
                        new Delete().From(QheDichvuMauketqua.Schema)
                        .Where(QheDichvuMauketqua.Columns.IdDichvuChitiet).IsEqualTo(objClsChitiet.IdChitietdichvu)
                        .Execute();
                        new Delete().From(QheCamchidinhChungphieu.Schema)
                        .Where(QheCamchidinhChungphieu.Columns.IdDichvu).IsEqualTo(objClsChitiet.IdChitietdichvu)
                        .And(QheCamchidinhChungphieu.Columns.Loai).IsEqualTo(0)
                        .Execute();
                        new Delete().From(QheCamchidinhChungphieu.Schema)
                        .Where(QheCamchidinhChungphieu.Columns.IdDichvuCamchidinhchung).IsEqualTo(objClsChitiet.IdChitietdichvu)
                        .And(QheCamchidinhChungphieu.Columns.Loai).IsEqualTo(0)
                        .Execute();
                        foreach (QheCamchidinhChungphieu obj in lstQhe)
                        {
                            obj.IdDichvu = objClsChitiet.IdChitietdichvu;
                        }
                        lstQhe.SaveAll();
                        foreach (QheDichvuMauketqua obj in lstqhemauKq)
                        {
                            obj.IdDichvuChitiet = objClsChitiet.IdChitietdichvu;
                        }
                        lstqhemauKq.SaveAll();
                    }
                    scope.Complete();
                }
                return(string.Empty);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
        public void Insert(string MaChitietdichvu,string MaChitietdichvuBhyt,string TenChitietdichvu,string TenChitietdichvuBhyt,short IdDichvu,string MaDonvitinh,string BinhthuongNam,string BinhthuongNu,byte? TrangThai,byte? HienThi,decimal? DonGia,string MotaThem,int? SttHthi,short? IdKhoaThuchien,short? IdPhongThuchien,string ChiDan,string NhomBaocao,DateTime? NgayTao,string NguoiTao,DateTime? NgaySua,string NguoiSua,string MaKhoathuchien,byte? TuTuc,decimal? GiaBhyt,decimal? PhuthuDungtuyen,decimal? PhuthuTraituyen,byte? CoChitiet,int? IdCha,int? IdVungkhaosat,string Bodypart,string ViewPosition,string MauChuan,string MauCanhan,byte? LaChiphithem,int? SoluongChitieu,string MaPhuongphapthu,string KihieuDinhtinhDat,string IdCamchidinhchungphieu,byte? SingleService)
        {
            DmucDichvuclsChitiet item = new DmucDichvuclsChitiet();

            item.MaChitietdichvu = MaChitietdichvu;

            item.MaChitietdichvuBhyt = MaChitietdichvuBhyt;

            item.TenChitietdichvu = TenChitietdichvu;

            item.TenChitietdichvuBhyt = TenChitietdichvuBhyt;

            item.IdDichvu = IdDichvu;

            item.MaDonvitinh = MaDonvitinh;

            item.BinhthuongNam = BinhthuongNam;

            item.BinhthuongNu = BinhthuongNu;

            item.TrangThai = TrangThai;

            item.HienThi = HienThi;

            item.DonGia = DonGia;

            item.MotaThem = MotaThem;

            item.SttHthi = SttHthi;

            item.IdKhoaThuchien = IdKhoaThuchien;

            item.IdPhongThuchien = IdPhongThuchien;

            item.ChiDan = ChiDan;

            item.NhomBaocao = NhomBaocao;

            item.NgayTao = NgayTao;

            item.NguoiTao = NguoiTao;

            item.NgaySua = NgaySua;

            item.NguoiSua = NguoiSua;

            item.MaKhoathuchien = MaKhoathuchien;

            item.TuTuc = TuTuc;

            item.GiaBhyt = GiaBhyt;

            item.PhuthuDungtuyen = PhuthuDungtuyen;

            item.PhuthuTraituyen = PhuthuTraituyen;

            item.CoChitiet = CoChitiet;

            item.IdCha = IdCha;

            item.IdVungkhaosat = IdVungkhaosat;

            item.Bodypart = Bodypart;

            item.ViewPosition = ViewPosition;

            item.MauChuan = MauChuan;

            item.MauCanhan = MauCanhan;

            item.LaChiphithem = LaChiphithem;

            item.SoluongChitieu = SoluongChitieu;

            item.MaPhuongphapthu = MaPhuongphapthu;

            item.KihieuDinhtinhDat = KihieuDinhtinhDat;

            item.IdCamchidinhchungphieu = IdCamchidinhchungphieu;

            item.SingleService = SingleService;

            item.Save(UserName);
        }
        public void Insert(string MaChitietdichvu,string TenChitietdichvu,string TenBhyt,short IdDichvu,string MaDonvitinh,string BinhthuongNam,string BinhthuongNu,byte? TrangThai,byte? HienThi,decimal? DonGia,string MotaThem,int? SttHthi,short? IdKhoaThuchien,short? IdPhongThuchien,string ChiDan,string NhomBaocao,DateTime? NgayTao,string NguoiTao,DateTime? NgaySua,string NguoiSua,string MaKhoathuchien,byte? TuTuc,decimal? GiaBhyt,decimal? PhuthuDungtuyen,decimal? PhuthuTraituyen,byte? CoChitiet,int? IdCha,int? IdVungkhaosat)
        {
            DmucDichvuclsChitiet item = new DmucDichvuclsChitiet();

            item.MaChitietdichvu = MaChitietdichvu;

            item.TenChitietdichvu = TenChitietdichvu;

            item.TenBhyt = TenBhyt;

            item.IdDichvu = IdDichvu;

            item.MaDonvitinh = MaDonvitinh;

            item.BinhthuongNam = BinhthuongNam;

            item.BinhthuongNu = BinhthuongNu;

            item.TrangThai = TrangThai;

            item.HienThi = HienThi;

            item.DonGia = DonGia;

            item.MotaThem = MotaThem;

            item.SttHthi = SttHthi;

            item.IdKhoaThuchien = IdKhoaThuchien;

            item.IdPhongThuchien = IdPhongThuchien;

            item.ChiDan = ChiDan;

            item.NhomBaocao = NhomBaocao;

            item.NgayTao = NgayTao;

            item.NguoiTao = NguoiTao;

            item.NgaySua = NgaySua;

            item.NguoiSua = NguoiSua;

            item.MaKhoathuchien = MaKhoathuchien;

            item.TuTuc = TuTuc;

            item.GiaBhyt = GiaBhyt;

            item.PhuthuDungtuyen = PhuthuDungtuyen;

            item.PhuthuTraituyen = PhuthuTraituyen;

            item.CoChitiet = CoChitiet;

            item.IdCha = IdCha;

            item.IdVungkhaosat = IdVungkhaosat;

            item.Save(UserName);
        }
        private int CreateServiceDetail()
        {
            try
            {
                DmucDichvuclsChitiet objServiceDetail = new DmucDichvuclsChitiet();
                objServiceDetail.DonGia = Utility.DecimaltoDbnull(txtDongia.Text, 0);
                objServiceDetail.GiaBhyt = Utility.DecimaltoDbnull(txtGiaBHYT.Text, 0);
                objServiceDetail.PhuthuDungtuyen = Utility.DecimaltoDbnull(txtPTDT.Text, 0);
                objServiceDetail.PhuthuTraituyen = Utility.DecimaltoDbnull(txtPTTT.Text, 0);

                objServiceDetail.IdChitietdichvu = Utility.Int32Dbnull(txtID.Text, -1);
                objServiceDetail.IdDichvu = Utility.Int16Dbnull(cboService.SelectedValue, -1);
                objServiceDetail.TenChitietdichvu = Utility.DoTrim(txtServiceDetailName.Text);
                objServiceDetail.TenBhyt = Utility.DoTrim(txtTenBHYT.Text);
                objServiceDetail.MaChitietdichvu = Utility.sDbnull(txtServiceDetailCode.Text, "");
                objServiceDetail.SttHthi = Utility.Int32Dbnull(txtIntOrder.Value);
                objServiceDetail.MaDonvitinh = txtDonvitinh.myCode;
                objServiceDetail.NgayTao = globalVariables.SysDate;
                objServiceDetail.NguoiTao = globalVariables.UserName;
                objServiceDetail.MotaThem = Utility.DoTrim(txtMotathem.Text);
                objServiceDetail.BinhthuongNam = Utility.DoTrim(txtBTNam.Text);
                objServiceDetail.BinhthuongNu = Utility.DoTrim(txtBTNu.Text);
                objServiceDetail.ChiDan = Utility.DoTrim(txtchidan.Text);
                objServiceDetail.TrangThai =(byte)( chkTrangthai.Checked ? 1 : 0);
                objServiceDetail.TuTuc = Utility.Bool2byte(chkTutuc.Checked);
                objServiceDetail.LaChiphithem = Utility.Bool2byte(chkLachiphithem.Checked);
                objServiceDetail.IdCha = Utility.Int32Dbnull(cboParent.SelectedValue,-1);
                objServiceDetail.CoChitiet = Utility.Bool2byte(chkCochitiet.Checked);
                objServiceDetail.NhomBaocao = Utility.sDbnull(cbonhombaocao.SelectedValue, "-1");
                objServiceDetail.IdKhoaThuchien = Utility.Int16Dbnull(cboDepartment.SelectedValue, -1);
                objServiceDetail.IdPhongThuchien = Utility.Int16Dbnull(cboDepartment.SelectedValue, -1);
                objServiceDetail.IsNew = true;
                objServiceDetail.Save();
                return objServiceDetail.IdChitietdichvu;
            }
            catch
            {
                return -1;
            }
        }
        public void Insert(string MaChitietdichvu, string MaChitietdichvuBhyt, string MaQd, string SttDmbhyt, string TenChitietdichvu, string TenChitietdichvuBhyt, short IdDichvu, string MaDonvitinh, string BinhthuongNam, string BinhthuongNu, byte?TrangThai, byte?HienThi, decimal?DonGia, string MotaThem, int?SttHthi, short?IdKhoaThuchien, short?IdPhongThuchien, string ChiDan, string NhomBaocao, DateTime?NgayTao, string NguoiTao, DateTime?NgaySua, string NguoiSua, string MaKhoathuchien, byte?TuTuc, decimal?GiaBhyt, decimal?PhuthuDungtuyen, decimal?PhuthuTraituyen, byte?CoChitiet, int?IdCha, int?IdVungkhaosat, string Bodypart, string ViewPosition, string MauChuan, string MauCanhan, byte?LaChiphithem, int?SoluongChitieu, string MaPhuongphapthu, string KihieuDinhtinhDat, string IdCamchidinhchungphieu, byte?SingleService, string NhomInphoiBHYT, byte?LaDvuKiemnghiem, string LoaiPttt, string PpVocam, DateTime?NgayBatdau, DateTime?NgayCongbo, DateTime?NgayKetthuc)
        {
            DmucDichvuclsChitiet item = new DmucDichvuclsChitiet();

            item.MaChitietdichvu = MaChitietdichvu;

            item.MaChitietdichvuBhyt = MaChitietdichvuBhyt;

            item.MaQd = MaQd;

            item.SttDmbhyt = SttDmbhyt;

            item.TenChitietdichvu = TenChitietdichvu;

            item.TenChitietdichvuBhyt = TenChitietdichvuBhyt;

            item.IdDichvu = IdDichvu;

            item.MaDonvitinh = MaDonvitinh;

            item.BinhthuongNam = BinhthuongNam;

            item.BinhthuongNu = BinhthuongNu;

            item.TrangThai = TrangThai;

            item.HienThi = HienThi;

            item.DonGia = DonGia;

            item.MotaThem = MotaThem;

            item.SttHthi = SttHthi;

            item.IdKhoaThuchien = IdKhoaThuchien;

            item.IdPhongThuchien = IdPhongThuchien;

            item.ChiDan = ChiDan;

            item.NhomBaocao = NhomBaocao;

            item.NgayTao = NgayTao;

            item.NguoiTao = NguoiTao;

            item.NgaySua = NgaySua;

            item.NguoiSua = NguoiSua;

            item.MaKhoathuchien = MaKhoathuchien;

            item.TuTuc = TuTuc;

            item.GiaBhyt = GiaBhyt;

            item.PhuthuDungtuyen = PhuthuDungtuyen;

            item.PhuthuTraituyen = PhuthuTraituyen;

            item.CoChitiet = CoChitiet;

            item.IdCha = IdCha;

            item.IdVungkhaosat = IdVungkhaosat;

            item.Bodypart = Bodypart;

            item.ViewPosition = ViewPosition;

            item.MauChuan = MauChuan;

            item.MauCanhan = MauCanhan;

            item.LaChiphithem = LaChiphithem;

            item.SoluongChitieu = SoluongChitieu;

            item.MaPhuongphapthu = MaPhuongphapthu;

            item.KihieuDinhtinhDat = KihieuDinhtinhDat;

            item.IdCamchidinhchungphieu = IdCamchidinhchungphieu;

            item.SingleService = SingleService;

            item.NhomInphoiBHYT = NhomInphoiBHYT;

            item.LaDvuKiemnghiem = LaDvuKiemnghiem;

            item.LoaiPttt = LoaiPttt;

            item.PpVocam = PpVocam;

            item.NgayBatdau = NgayBatdau;

            item.NgayCongbo = NgayCongbo;

            item.NgayKetthuc = NgayKetthuc;


            item.Save(UserName);
        }