예제 #1
0
        public async Task <IHttpActionResult> FilterCustomerData(string strKey)
        {
            var result   = new TransferObj();
            var unitCode = _serviceCustomer.GetCurrentUnitCode();

            try
            {
                var serviceProcedure = new ProcedureService <MdCustomerVm.CustomerDto>();
                var data             = ProcedureCollection.QueryCustomer(unitCode, strKey);
                if (data.Count > 0)
                {
                    result.Data    = data;
                    result.Status  = true;
                    result.Message = "Truy vấn thành công";
                }
                else
                {
                    result.Data    = null;
                    result.Status  = false;
                    result.Message = "Không tìm thấy";
                }
            }
            catch (Exception ex)
            {
                result.Data    = null;
                result.Status  = false;
                result.Message = "Không tìm thấy";
            }
            return(Ok(result));
        }
예제 #2
0
        /// <summary>
        /// Users the change PWD by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="pwd">The PWD.</param>
        /// <returns></returns>
        public bool ModifyPwdById(int id, string pwd, Sys_AdminUser operUser)
        {
            bool b = false;

            pwd = iPow.Infrastructure.Crosscutting.Function.StringHelper.Tomd5(pwd);
            int res = ProcedureService.UserChangePwdById(id, pwd);

            if (res > 0)
            {
                b = true;
                var log = new Sys_AdminUserLog();
                log.AddTime     = System.DateTime.Now;
                log.IpAddress   = iPow.Infrastructure.Crosscutting.Function.StringHelper.GetRealIP();
                log.PageUrl     = iPow.Infrastructure.Crosscutting.Function.StringHelper.GetCurrentUrl();
                log.ReferrerUrl = iPow.Infrastructure.Crosscutting.Function.StringHelper.GetReferrerUrl();
                log.State       = true;
                log.TypeId      = 1;
                if (operUser != null)
                {
                    log.UserId       = operUser.id;
                    log.ShortMessage = "用户Id:" + operUser.id + " 改变用户Id号:" + id.ToString() + " 的密码";
                    log.FullMessage  = "UserChangePwdById 用户:" + operUser.username + " 用户Id:" + operUser.id.ToString()
                                       + " 改变用户Id号:" + id.ToString() + " 的密码:" + pwd;
                }
                else
                {
                    log.UserId       = 0;
                    log.ShortMessage = "用户Id号:" + id.ToString() + " 的密码被修改";
                    log.FullMessage  = "UserChangePwdById " + "用户Id号:" + id.ToString() + " 的密码被修改";
                }
            }
            return(b);
        }
예제 #3
0
        public ActionResult Index()
        {
            ProcedureService service = NewMethod();
            var model = service.GetProcedures();

            return(View(model));
        }
예제 #4
0
        public ActionResult Delete(int id)
        {
            ProcedureService service = new ProcedureService();
            var model = service.GetProcedureById(id);

            return(View(model));
        }
 public EditPatientView(CombinedPatientViewModel originalModel,
                        CombinedPatientViewModel patientModel,
                        PatientService patientService,
                        PersonService personService,
                        WardService wardService,
                        BedService bedService,
                        VisitService visitService,
                        TreatmentService treatmentService,
                        ProcedureService procedureService,
                        PhysicianService physicianService,
                        DiagnosisService diagnosisService,
                        ConditionService conditionService,
                        VitalRecordService vitalRecordService,
                        EmployeeService nurseService,
                        OrderServiceLayer orderServiceLayer,
                        OrderServiceService orderServiceService,
                        PatientOrderService patientOrderService,
                        OrderItemService orderItemService)
 {
     InitializeComponent();
     InfoTab.Content = new PatientInfoView(originalModel, patientModel, patientService, personService, wardService,
                                           bedService, visitService);
     TreatmentTab.Content = new TreatmentView(treatmentService, originalModel.PatientModel.PersonId, procedureService, physicianService);
     DiagnosisTab.Content = new DiagnosisView(diagnosisService, originalModel.PatientModel.PersonId,
                                              conditionService, physicianService);
     VitalRecordTab.Content =
         new VitalRecordView(vitalRecordService, originalModel.PatientModel.PersonId, nurseService);
     OrderTab.Content = new OrderView(orderServiceLayer, originalModel.PatientModel.PersonId, orderServiceService,
                                      physicianService);
     PatientOrderTab.Content = new PatientOrderView(patientOrderService, originalModel.PatientModel.PersonId, orderItemService);
 }
예제 #6
0
        public async Task <IHttpActionResult> BindingDataHangHoa(string strKey)
        {
            var result   = new TransferObj();
            var unitCode = _serviceRetails.GetCurrentUnitCode();

            try
            {
                var serviceProcedure = new ProcedureService <MdMerchandiseVm.FilterData>();
                var data             = ProcedureCollection.QueryFilterMerchandise(unitCode, strKey);
                if (data.Count > 0)
                {
                    result.Data    = data;
                    result.Status  = true;
                    result.Message = "Truy vấn thành công";
                }
                else
                {
                    result.Data    = null;
                    result.Status  = false;
                    result.Message = "Không tìm thấy";
                }
            }
            catch (Exception ex)
            {
                result.Data    = null;
                result.Status  = false;
                result.Message = "Không tìm thấy";
            }
            return(Ok(result));
        }
        private ProcedureService CreateProcedureService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new ProcedureService(userId);

            return(service);
        }
 public ProceduresController(ProcedureService procedureService, OrderService orderService, MedicamentLogNoteService noteService, DeviceService deviceService, AppointmentService appointmentService)
 {
     this.procedureService   = procedureService;
     this.orderService       = orderService;
     this.noteService        = noteService;
     this.deviceService      = deviceService;
     this.appointmentService = appointmentService;
 }
        public TreatmentView(TreatmentService treatmentService, string patientId, ProcedureService procedureService, PhysicianService physicianService)
        {
            InitializeComponent();
            _treatmentService = treatmentService;
            var treatmentListViewModel = new TreatmentListViewModel(_treatmentService, patientId);

            DataContext = treatmentListViewModel;
        }
        public void AddProcedureTest()
        {
            var serv = new ProcedureService(new MVCHContext());

            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.01",
                Name        = "Therapeutic ultrasound of vessels of head and neck"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.02",
                Name        = "Therapeutic ultrasound of heart"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.03",
                Name        = "Therapeutic ultrasound of peripheral vascular vessels"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.09",
                Name        = "Other therapeutic ultrasound"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.91",
                Name        = "Transplant from live related donor"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.92",
                Name        = "Transplant from live non-related donor"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.93",
                Name        = "Transplant from cadaver"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.94",
                Name        = "Intra-operative neurophysiologic monitoring"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.95",
                Name        = "Injection or infusion of glucarpidase"
            });
            serv.AddProcedure(new Procedure
            {
                ProcedureId = "00.96",
                Name        = "Infusion 4F-PCC"
            });
        }
예제 #11
0
        public ActionResult Create(ProcedureCreate model)
        {
            var service = new ProcedureService();

            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            service.CreateProcedure(model);
            return(RedirectToAction("Index"));
        }
예제 #12
0
        public ActionResult Index(string search)
        {
            var service = new ProcedureService();
            var model   = service.GetProcedures();

            if (!String.IsNullOrEmpty(search))
            {
                model = model.Where(s => s.Name.Contains(search));
            }
            return(View(model));
        }
예제 #13
0
 public TelaProcedimento()
 {
     InitializeComponent();
     ConfigurarCombobox();
     ConfigurarDatagrid();
     procedureService = new ProcedureService();
     productService   = new ProductService();
     animalService    = new AnimalService();
     serviceService   = new ServiceService();
     voluntaryService = new VoluntaryService();
 }
예제 #14
0
        public async Task <IHttpActionResult> GetDataPackageMerchandise(string maBoHang)
        {
            MdMerchandiseVm.DataBoHang result = null;
            //Tạm thời khóa mã đơn vị
            var unitCode = _serviceUser.GetCurrentUnitCode();
            var maKho    = _serviceUser.GetCurrentUnitCode() + "-K2";
            var service  = new ProcedureService <MdMerchandiseVm.DtoAndPromotion>();

            if (maBoHang.Substring(0, 2).Equals("BH"))
            {
                try
                {
                    var data = ProcedureCollection.GetDataBoHang(new BTS.API.ENTITY.ERPContext(), maBoHang, unitCode);
                    if (data != null)
                    {
                        foreach (var i in data.ListMaHang)
                        {
                            string codeMerchandise = i.MaVatTu;
                            //check tồn mã hàng này
                            var xntItem = ProcedureCollection.GetCostOfGoodsSoldByMerchandise(unitCode, maKho, codeMerchandise);
                            if (xntItem != null)
                            {
                                i.TonCuoiKySl       = xntItem.ClosingQuantity == 0 ? 0 : xntItem.ClosingQuantity;
                                i.LogKhuyenMaiError = 1;
                                i.IsBanAm           = false;
                                i.Status            = true;
                                i.Message           = "Bán mã bó hàng";
                                i.NoiDungKhuyenMai  = "Khuyến mại bó hàng";

                                if (i.TonCuoiKySl <= 0)
                                {
                                    i.LogKhuyenMaiError = 1;
                                    i.IsBanAm           = true;
                                    i.Status            = true;
                                    i.Message           = "Bán mã bó hàng";
                                    i.NoiDungKhuyenMai  = "Khuyến mại bó hàng";
                                }
                            }
                            //end check tồn
                        }
                    }
                    else
                    {
                    }
                    result = data;
                }
                catch (Exception ex)
                {
                    return(NotFound());
                }
            }
            return(Ok(result));
        }
예제 #15
0
        public ActionResult Edit(int id)
        {
            var service = new ProcedureService();
            var detail  = service.GetProcedureById(id);
            var model   = new ProcedureDetail
            {
                ProcedureId = detail.ProcedureId,
                Name        = detail.Name,
                Description = detail.Description,
                Preperation = detail.Preperation,
                Risks       = detail.Risks
            };

            return(View(model));
        }
 public CourseController(
     PMDbContext context,
     CourseService courseService,
     MedicineService medicineService,
     ProcedureService procedureService,
     MeasurementService measurementService,
     CourseHistoryService courseHistoryService)
 {
     _context              = context;
     _courseService        = courseService;
     _medicineService      = medicineService;
     _procedureService     = procedureService;
     _measurementService   = measurementService;
     _courseHistoryService = courseHistoryService;
 }
        public async Task <IHttpActionResult> GetForNvByCode(string code)
        {
            MdMerchandiseVm.Dto result = null;
            var unitCode = _service.GetCurrentUnitCode();
            //var instance = _service.Repository.DbSet.FirstOrDefault(x => x.MaVatTu.ToUpper() == code.ToUpper());//&& x.UnitCode == unitCode);
            var service = new ProcedureService <MdMerchandiseTypeVm.Dto>();
            var data    = ProcedureCollection.GetMerchandiseType(new BTS.API.ENTITY.ERPContext(), code, unitCode);

            if (data != null && data.Count() >= 1)
            {
                var items = data.ToList();


                return(Ok(items[0]));
            }
            else
            {
                return(NotFound());
            }
        }
예제 #18
0
 public void DatabaseTest()
 {
     var ef = new ProcedureService(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=GidraDataBase;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False");
     var items = ef.GetAll();
     try
     {
         ef.Create(new Procedure
         {
             Name = "Трассировка",
             ProgressFunction = "sadasds",
             Parameters = new Dictionary<string, double>()
             {
                 { "Производительность", 100 },
                 { "Стоимость", 100 },
             }
         });
     }
     catch (Exception err)
     {
         int x = 0;
     }
 }
예제 #19
0
 public PatientView()
 {
     _patientService       = new PatientService(new MVCHContext());
     _patientListViewModel = new PatientListViewModel(_patientService);
     _diagnosisService     = new DiagnosisService(new MVCHContext());
     _personService        = new PersonService(new MVCHContext());
     _employeeService      = new EmployeeService(new MVCHContext());
     _wardService          = new WardService(new MVCHContext());
     _bedService           = new BedService(new MVCHContext());
     _physicianService     = new PhysicianService(new MVCHContext());
     _vitalRecordService   = new VitalRecordService(new MVCHContext());
     _conditionService     = new ConditionService(new MVCHContext());
     _visitService         = new VisitService(new MVCHContext());
     _treatmentService     = new TreatmentService(new MVCHContext());
     _procedureService     = new ProcedureService(new MVCHContext());
     _orderServiceLayer    = new OrderServiceLayer(new MVCHContext());
     _orderServiceService  = new OrderServiceService(new MVCHContext());
     _patientOrderService  = new PatientOrderService(new MVCHContext());
     _orderItemService     = new OrderItemService(new MVCHContext());
     DataContext           = _patientListViewModel;
     InitializeComponent();
 }
 public GetProceduresDropDownListTests()
 {
     AutoMapperConfig.RegisterMappings(typeof(ErrorViewModel).GetTypeInfo().Assembly);
     this.db = new KTasevaDbContext(MemoryDatabase.OptionBuilder());
     this.procedureService = new ProcedureService(db);
 }
예제 #21
0
        public HttpResponseMessage ExportExcelSyntheticByCondition(ParameterExcelByCondition para)
        {
            var _ParentUnitCode = _service.GetParentUnitCode();

            NvGiaoDichQuayVm.ReportExcel result = null;
            var unitCode = _service.GetCurrentUnitCode();

            para.UnitCode = unitCode;
            var service = new ProcedureService <NvGiaoDichQuayVm.ReportExcel>();
            var data    = ProcedureCollection.DuLieuTongHopGiaoDichQuayTheoDieuKien(para.TuNgay, para.DenNgay, para.UnitCode, new BTS.API.ENTITY.ERPContext());

            using (ExcelPackage package = new ExcelPackage())
            {
                var ms = new MemoryStream();
                package.Workbook.Worksheets.Add("Data");
                var worksheet = package.Workbook.Worksheets[1];
                int index     = 0;
                worksheet.Cells[1, 1, 1, 5].Merge = true;
                worksheet.Cells[1, 1].Value       = "SIÊU THỊ TỪ SƠN ";
                worksheet.Cells[2, 1, 2, 5].Merge = true;
                worksheet.Cells[2, 1].Value       = "Đường Lý Thái Tổ, P. Đình Bảng, TX Từ Sơn, Bắc Ninh ";
                worksheet.Cells[4, 4, 4, 7].Merge = true;
                worksheet.Cells[4, 4].Value       = "BÁO CÁO GIAO DỊCH QUẦY TỔNG HỢP ";
                worksheet.Cells[5, 4, 5, 8].Merge = true;
                worksheet.Cells[5, 4].Value       = "Từ ngày: " + para.TuNgay.Day + "/" + para.TuNgay.Month + "/" + para.TuNgay.Year + "   Đến ngày:" + para.DenNgay.Day + "/" + para.DenNgay.Month + "/" + para.DenNgay.Year;
                worksheet.Cells[7, 1].Value       = "STT";
                worksheet.Cells[7, 2].Value       = "Mã giao dịch";
                worksheet.Cells[7, 3].Value       = "Mã giao dịch PK";
                worksheet.Cells[7, 4].Value       = "Loại giao dịch";
                worksheet.Cells[7, 5].Value       = "Tổng tiền";
                int stt = 1;
                index = 8;
                if (data != null && data.Count() >= 1)
                {
                    var item = data.ToList();
                    for (int i = 0; i < item.Count; i++)
                    {
                        var hanghoa    = new MdMerchandiseVm.Dto();
                        var innerindex = item[i].MaVatTu;
                        var hanghoatg  = _merchandiseservice.UnitOfWork.Repository <MdMerchandise>().DbSet.FirstOrDefault(x => x.MaVatTu == innerindex && x.UnitCode.StartsWith(_ParentUnitCode));
                        hanghoa = Mapper.Map <MdMerchandise, MdMerchandiseVm.Dto>(hanghoatg);
                        worksheet.Cells[index, 1].Value = stt;
                        worksheet.Cells[index, 2].Value = item[i].MaGiaoDich;
                        worksheet.Cells[index, 3].Value = item[i].MaGiaoDichQuayPK;
                        if (item[i].LoaiGiaoDich == 1)
                        {
                            worksheet.Cells[index, 4].Value = "Bán lẻ";
                        }
                        else if (item[i].LoaiGiaoDich == 2)
                        {
                            worksheet.Cells[index, 4].Value = "Trả lại";
                        }
                        worksheet.Cells[index, 5].Value = CurrentSetting.FormatTienViet(item[i].TTienCoVat.ToString());
                        index++;
                        stt++;
                    }
                }
                else
                {
                    //return null;
                }

                package.SaveAs(ms);
                HttpResponseMessage response = Request.CreateResponse();
                response.StatusCode = HttpStatusCode.OK;
                ms.Seek(0, SeekOrigin.Begin);
                response.Content = new StreamContent(ms);

                response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("inline")
                {
                    FileName = "BaoCaoGiaoDichQuayTongHop.xlsx"
                };
                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

                return(response);
            }
        }
예제 #22
0
        public HttpResponseMessage ExportExcel(ParameterCashier para)
        {
            var _ParentUnitCode = _service.GetParentUnitCode();

            NvGiaoDichQuayVm.ReportExcel result = null;
            var unitCode = _service.GetCurrentUnitCode();
            //var instance = _service.Repository.DbSet.FirstOrDefault(x => x.MaVatTu.ToUpper() == code.ToUpper());//&& x.UnitCode == unitCode);
            var service = new ProcedureService <NvGiaoDichQuayVm.ReportExcel>();
            var data    = ProcedureCollection.GetReportGDQExcel(para.FromDate, para.ToDate, new BTS.API.ENTITY.ERPContext(), unitCode);

            using (ExcelPackage package = new ExcelPackage())
            {
                var ms = new MemoryStream();
                package.Workbook.Worksheets.Add("Data");
                var worksheet = package.Workbook.Worksheets[1];
                int index     = 0;
                worksheet.Cells[1, 1, 1, 5].Merge = true;
                worksheet.Cells[1, 1].Value       = "SIÊU THỊ TỪ SƠN ";
                worksheet.Cells[2, 1, 2, 5].Merge = true;
                worksheet.Cells[2, 1].Value       = "Đường Lý Thái Tổ, P. Đình Bảng, TX Từ Sơn, Bắc Ninh ";
                worksheet.Cells[4, 4, 4, 7].Merge = true;
                worksheet.Cells[4, 4].Value       = "BÁO CÁO GIAO DỊCH QUẦY ";
                worksheet.Cells[5, 4, 5, 8].Merge = true;
                worksheet.Cells[5, 4].Value       = "Từ ngày: " + para.FromDate.Day + "/" + para.FromDate.Month + "/" + para.FromDate.Year + "   Đến ngày:" + para.ToDate.Day + "/" + para.ToDate.Month + "/" + para.ToDate.Year;
                worksheet.Cells[7, 1].Value       = "STT";
                worksheet.Cells[7, 2].Value       = "Nhân viên";
                worksheet.Cells[7, 3].Value       = "Máy bán";
                worksheet.Cells[7, 4].Value       = "Ngày phát sinh";
                worksheet.Cells[7, 5].Value       = "Loại giao dịch";
                worksheet.Cells[7, 6].Value       = "Mã hàng";
                worksheet.Cells[7, 7].Value       = "Tên hàng";
                worksheet.Cells[7, 8].Value       = "Số lượng";
                worksheet.Cells[7, 9].Value       = "Tổng tiền";
                index = 8;
                if (data != null && data.Count() >= 1)
                {
                    var item = data.ToList();
                    for (int i = 0; i < item.Count; i++)
                    {
                        var hanghoa    = new MdMerchandiseVm.Dto();
                        var innerindex = item[i].MaVatTu;
                        var hanghoatg  = _merchandiseservice.UnitOfWork.Repository <MdMerchandise>().DbSet.FirstOrDefault(x => x.MaVatTu == innerindex && x.UnitCode.StartsWith(_ParentUnitCode));
                        hanghoa = Mapper.Map <MdMerchandise, MdMerchandiseVm.Dto>(hanghoatg);
                        worksheet.Cells[index, 1].Value = index;
                        worksheet.Cells[index, 2].Value = item[i].MaNguoiTao + "-" + item[i].NguoiTao;
                        worksheet.Cells[index, 3].Value = item[i].MaQuayBan;
                        worksheet.Cells[index, 4].Value = item[i].NgayPhatSinh.Date + "/" + item[i].NgayPhatSinh.Month + "/" + item[i].NgayPhatSinh.Year;
                        worksheet.Cells[index, 6].Value = item[i].MaVatTu;
                        if (hanghoa == null)
                        {
                            worksheet.Cells[index, 7].Value = " ";
                        }
                        worksheet.Cells[index, 7].Value = hanghoa.TenHang;
                        worksheet.Cells[index, 8].Value = item[i].SoLuong;
                        worksheet.Cells[index, 9].Value = CurrentSetting.FormatTienViet(item[i].TTienCoVat.ToString());
                        if (item[i].LoaiGiaoDich == 1)
                        {
                            worksheet.Cells[index, 5].Value = "xuất bán";
                        }
                        else if (item[i].LoaiGiaoDich == 2)
                        {
                            worksheet.Cells[index, 5].Value = "bán trả lại";
                        }
                        index++;
                    }
                }
                else
                {
                    //return null;
                }

                package.SaveAs(ms);
                HttpResponseMessage response = Request.CreateResponse();
                response.StatusCode = HttpStatusCode.OK;
                ms.Seek(0, SeekOrigin.Begin);
                response.Content = new StreamContent(ms);

                response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("inline")
                {
                    FileName = "BaoCaoGiaoDichQuay.xlsx"
                };
                response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

                return(response);
            }
        }
예제 #23
0
 public AddTests()
 {
     this.db = new KTasevaDbContext(MemoryDatabase.OptionBuilder());
     this.procedureService = new ProcedureService(db);
 }
예제 #24
0
 public ListarProcedimento()
 {
     InitializeComponent();
     ConfigurarDatagrid();
     procedureService = new ProcedureService();
 }