/// <summary> /// Converts to host language type to a fluentscript type. /// </summary> /// <param name="hostLangType"></param> /// <returns></returns> public static LType ConvertToLangTypeClass(Type hostLangType) { var type = new LObjectType(); type.Name = hostLangType.Name; type.FullName = hostLangType.FullName; type.TypeVal = TypeConstants.LClass; return(type); }
public bool IsBaohiem(TPatientExam objPatientExam) { LObjectType objObjectType = LObjectType.FetchByID(objPatientExam.ObjectTypeId); if (objObjectType.ObjectTypeType == 0) { return(true); } else { return(false); } }
private void btnSave_Click(object sender, EventArgs e) { try { txtID.Text = txtID.Text.ToUpper(); if (ValidData()) { switch (vAction) { case action.Insert: var obj = new LObjectType(); obj.SName = Utility.sDbnull(txtName.Text); obj.SDesc = Utility.sDbnull(txtDesc.Text); obj.IsNew = true; obj.Save(); drList = dtList.NewRow(); drList[LObjectType.Columns.Id] = LObjectType.CreateQuery().GetMax(LObjectType.Columns.Id); ApplyData2Datarow(); dtList.Rows.InsertAt(drList, 0); dtList.AcceptChanges(); txtID.Text = Utility.sDbnull(drList[LObjectType.Columns.Id]); vAction = action.Update; break; case action.Update: new Update(LObjectType.Schema.Name).Set(LObjectType.Columns.SName).EqualTo(txtName.Text). Set(LObjectType.Columns.SDesc).EqualTo(txtDesc.Text). Where(LObjectType.Columns.Id).IsEqualTo(Utility.Int32Dbnull(txtID.Text)). Execute(); ApplyData2Datarow(); drList.AcceptChanges(); break; } } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { txtID.Text = txtID.Text.ToUpper(); if (ValidData()) switch (vAction) { case action.Insert: var obj = new LObjectType(); obj.SName = Utility.sDbnull(txtName.Text); obj.SDesc = Utility.sDbnull(txtDesc.Text); obj.IsNew = true; obj.Save(); drList = dtList.NewRow(); drList[LObjectType.Columns.Id] = LObjectType.CreateQuery().GetMax(LObjectType.Columns.Id); ApplyData2Datarow(); dtList.Rows.InsertAt(drList, 0); dtList.AcceptChanges(); txtID.Text = Utility.sDbnull(drList[LObjectType.Columns.Id]); vAction = action.Update; break; case action.Update: new Update(LObjectType.Schema.Name).Set(LObjectType.Columns.SName).EqualTo(txtName.Text). Set(LObjectType.Columns.SDesc).EqualTo(txtDesc.Text). Where(LObjectType.Columns.Id).IsEqualTo(Utility.Int32Dbnull(txtID.Text)). Execute(); ApplyData2Datarow(); drList.AcceptChanges(); break; } } catch (Exception ex) { Utility.ShowMsg(ex.Message); } }
/// <summary> /// hàm thục hiện tính toán thông tin /// </summary> /// <param name="v_decTotalPrice"></param> /// <param name="objPatientExam"></param> /// <param name="PtramBHYT"></param> /// <returns></returns> public decimal LayThongPtramBHYT(decimal v_decTotalPrice, TPatientExam objPatientExam, ref decimal PtramBHYT) { decimal decDiscountTotalMoney = 0; SqlQuery q; if (!string.IsNullOrEmpty(objPatientExam.InsClinicCode) && IsBaohiem(objPatientExam)) { ///thực hiện xem có đúng tuyến không if (objPatientExam.CorrectLine == 1) { if (objPatientExam.InsObjectCodeNumber.ToString() == "1" || objPatientExam.InsObjectCodeNumber.ToString() == "2") { decDiscountTotalMoney = 0; PtramBHYT = 100; log.Info("Benh nhan tuong ung voi muc =" + objPatientExam.InsObjectCodeNumber); } else { switch (globalVariables.gv_BenhVienTuyen) { case "TUYEN1": if (v_decTotalPrice >= objPatientExam.SalaryBasic * 15 / 100) { log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan())); q = new Select().From(LInsuranceObject.Schema) .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId) .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode); LInsuranceObject objInsuranceObject = q.ExecuteSingle <LInsuranceObject>(); if (objInsuranceObject != null) { PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0); decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0)) / 100; log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode); } } else { PtramBHYT = 100; decDiscountTotalMoney = 0; log.Info("Benh nhan dc mien phi hoan toan, voi muc chiet khau =0 tuong ung voi Patient_Code=" + objPatientExam.PatientCode); } break; case "TW": log.Info("Lấy thông tin của tuyến trung ương"); log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan())); q = new Select().From(LInsuranceObject.Schema) .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId) .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode); LInsuranceObject objInsuranceObjectTW = q.ExecuteSingle <LInsuranceObject>(); if (objInsuranceObjectTW != null) { PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObjectTW.Percent, 0); decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObjectTW.Percent, 0)) / 100; log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode); } break; default: if (v_decTotalPrice >= objPatientExam.SalaryBasic * 15 / 100) { log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan())); q = new Select().From(LInsuranceObject.Schema) .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId) .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode); LInsuranceObject objInsuranceObject = q.ExecuteSingle <LInsuranceObject>(); if (objInsuranceObject != null) { PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0); decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0)) / 100; log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode); } } else { PtramBHYT = 100; decDiscountTotalMoney = 0; log.Info("Benh nhan dc mien phi hoan toan, voi muc chiet khau =0 tuong ung voi Patient_Code=" + objPatientExam.PatientCode); } break; } } } else { ///Nếu là đối tượng trái tuyến thực hiện lấy % của trái tuyến LObjectType objObjectType = LObjectType.FetchByID(objPatientExam.ObjectTypeId); if (objObjectType != null) { decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objObjectType.DiscountDiscorrectLine)) / 100; PtramBHYT = Utility.DecimaltoDbnull(objObjectType.DiscountDiscorrectLine, 0); } } } else { LObjectType objObjectType = LObjectType.FetchByID(objPatientExam.ObjectTypeId); if (objObjectType != null) { decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.Int32Dbnull(objObjectType.DiscountCorrectLine, 0)) / 100; } ; PtramBHYT = Utility.DecimaltoDbnull(objObjectType.DiscountCorrectLine, 0); } return(decDiscountTotalMoney); }
private void getData() { TPhieuCapphatNoitru objPhieuCapphat = TPhieuCapphatNoitru.FetchByID(Utility.Int32Dbnull(txtID_CAPPHAT.Text)); if (objPhieuCapphat != null) { txtID_CAPPHAT.Text = Utility.sDbnull(objPhieuCapphat.IdCapphat); dtNgayCapPhat.Value = dtNgayCapPhat.Value; txtID_KHOA_LINH.Text = Utility.sDbnull(objPhieuCapphat.IdKhoaLinh); idKhoaLinh = Utility.Int32Dbnull(objPhieuCapphat.IdKhoaLinh); DmucKhoaphong objLDepartment = DmucKhoaphong.FetchByID(objPhieuCapphat.IdKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.TenKhoaphong); } //chkIsBoSung.Checked = Convert.ToBoolean(objPhieuCapphat.LinhBSung); IsPhieuBoSung = Utility.Byte2Bool(objPhieuCapphat.LoaiPhieu); radLinhBoSung.Checked = IsPhieuBoSung; loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; txtID_NVIEN.Text = Utility.sDbnull(objPhieuCapphat.IdNhanviencapphat); DmucNhanvien objStaff = DmucNhanvien.FetchByID(objPhieuCapphat.IdNhanviencapphat); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.TenNhanvien); } txtId_KhoXuat.Text = Utility.sDbnull(objPhieuCapphat.IdKhoXuat); id_khoXuat = Utility.Int32Dbnull(objPhieuCapphat.IdKhoXuat); DKho objKho = DKho.FetchByID(objPhieuCapphat.IdKhoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } madoituong = Utility.sDbnull(objPhieuCapphat.MaDoiTuong); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } txtMOTA_THEM.Text = Utility.sDbnull(objPhieuCapphat.MotaThem); } else { dtNgayCapPhat.Value = BusinessHelper.GetSysDateTime(); txtID_KHOA_LINH.Text = Utility.sDbnull(idKhoaLinh); LDepartment objLDepartment = LDepartment.FetchByID(idKhoaLinh); if (objLDepartment != null) { txtTen_KHOA_LINH.Text = Utility.sDbnull(objLDepartment.DepartmentName); } txtID_NVIEN.Text = Utility.sDbnull(globalVariables.gv_StaffID); LStaff objStaff = LStaff.FetchByID(globalVariables.gv_StaffID); if (objStaff != null) { txtTen_NVIEN.Text = Utility.sDbnull(objStaff.StaffName); } txtId_KhoXuat.Text = Utility.sDbnull(id_khoXuat); DKho objKho = DKho.FetchByID(id_khoXuat); if (objKho != null) { txtTenKho.Text = Utility.sDbnull(objKho.TenKho); } //loaiphieu = Utility.sDbnull(objPhieuCapphat.LoaiPhieu); radThuoc.Checked = loaiphieu == "THUOC"; radLinhVTYT.Checked = loaiphieu == "VT"; radLinhBoSung.Checked = IsPhieuBoSung; // IsPhieuBoSung = Convert.ToBoolean(objPhieuCapphat.LinhBSung); txtMaDoiTuong.Text = Utility.sDbnull(madoituong); SqlQuery sqlQuery = new Select().From <LObjectType>().Where(LObjectType.Columns.ObjectTypeCode).IsEqualTo(madoituong); LObjectType objectType = sqlQuery.ExecuteSingle <LObjectType>(); if (objectType != null) { txtObjectType_Name.Text = Utility.sDbnull(objectType.ObjectTypeName); } } LoadPhieuDonThuoc(); }
public void Insert(string SName,string SDesc) { LObjectType item = new LObjectType(); item.SName = SName; item.SDesc = SDesc; item.Save(UserName); }
public void Update(short Id,string SName,string SDesc) { LObjectType item = new LObjectType(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.SName = SName; item.SDesc = SDesc; item.Save(UserName); }
private ObjectType(LObjectType objectType) { this.objectType = objectType; }
private void GetData() { string ReasonBy = ""; string sAccountName = THU_VIEN_CHUNG.LayMaDviLamViec(); LayThongTinPaymentDetail(sAccountName); //grdPaymentDetail.DataSource = m_dtPaymentDetail; SqlQuery sqlQuery = new Select().From(TPhieuthu.Schema) .Where(TPhieuthu.Columns.PaymentId).IsEqualTo(Utility.Int32Dbnull(txtPayment_ID.Text)).And( TPhieuthu.Columns.LoaiPhieu).IsEqualTo(status); if (sqlQuery.GetRecordCount() <= 0) { TPayment objPayment = TPayment.FetchByID(Utility.Int32Dbnull(txtPayment_ID.Text, -1)); if (objPayment != null) { dtCreateDate.Value = Convert.ToDateTime(objPayment.PaymentDate); txtPayment_ID.Text = Utility.sDbnull(objPayment.PaymentId, "-1"); txtMA_PTHU.Text = BusinessHelper.GetMaPhieuThu(dtCreateDate.Value, 0); Janus.Windows.GridEX.GridEXColumn gridExColumn = grdPaymentDetail.RootTable.Columns["TONG"]; txtSO_TIEN.Text = Utility.sDbnull(grdPaymentDetail.GetTotal(gridExColumn, Janus.Windows.GridEX.AggregateFunction.Sum)); txtSLUONG_CTU_GOC.Text = "1"; TPatientInfo objPatientInfo = TPatientInfo.FetchByID(objPayment.PatientId); if (objPatientInfo != null) { txtNGUOI_NOP.Text = objPatientInfo.PatientName; label9.Text = "Người nhận"; } if (status == 0) { switch (sAccountName) { case "YHOCHAIQUAN": ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; case "KYDONG": ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; case "DETMAY": LObjectType objectType = LObjectType.FetchByID(v_ObjectType_Id); if (objectType.ObjectTypeType == 0) { txtLDO_NOP.Text = string.Format("Bệnh nhân cùng chi trả :{0} %", (100 - v_DiscountRate)); } else { ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; } break; default: ReasonBy = BusinessHelper.GetLyDo_PhieuThu(m_dtPaymentDetail); txtLDO_NOP.Text = ReasonBy; break; } } if (status == 1) { ReasonBy = "Trả lại tiền cho bệnh nhân"; txtLDO_NOP.Text = ReasonBy; } } } else { var objPhieuthu = sqlQuery.ExecuteSingle <TPhieuthu>(); if (objPhieuthu != null) { txtSLUONG_CTU_GOC.Text = Utility.sDbnull(objPhieuthu.SluongCtuGoc, 1); txtMA_PTHU.Text = Utility.sDbnull(objPhieuthu.MaPthu, ""); txtNGUOI_NOP.Text = Utility.sDbnull(objPhieuthu.NguoiNop); txtSO_TIEN.Text = Utility.sDbnull(objPhieuthu.SoTien); txtTKHOAN_CO.Text = Utility.sDbnull(objPhieuthu.TkhoanCo, ""); txtTKHOAN_NO.Text = Utility.sDbnull(objPhieuthu.TkhoanNo, ""); txtLDO_NOP.Text = objPhieuthu.LdoNop; dtCreateDate.Value = Convert.ToDateTime(objPhieuthu.NgayThien); } } }