internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.PatientMedicineSaleGuid]))
            {
                this.mId           = AppShared.DbValueToInteger(dr[Columns.PatientMedicineSaleId]);
                this.mObjectGuid   = AppShared.DbValueToGuid(dr[Columns.PatientMedicineSaleGuid]);
                this.mBillGuid     = AppShared.DbValueToGuid(dr[Columns.PatientMedicineSalePatientBillGuid]);
                this.mCategoryGuid = AppShared.DbValueToGuid(dr[Columns.PatientMedicineSaleCategoryGuid]);
                this.mCompanyGuid  = AppShared.DbValueToGuid(dr[Columns.PatientMedicineSaleCompanyGuid]);
                this.mItemGuid     = AppShared.DbValueToGuid(dr[Columns.PatientMedicineSaleItemGuid]);
                this.mQuantity     = AppShared.DbValueToDecimal(dr[Columns.PatientMedicineSaleQuantity]);
                this.mAmount       = AppShared.DbValueToDecimal(dr[Columns.PatientMedicineSaleAmount]);
                this.mNote         = AppShared.DbValueToString(dr[Columns.PatientMedicineSaleNote]);
                if (AppShared.HasColumn(dr, "SrNo"))
                {
                    this.mSrNo = AppShared.DbValueToString(dr[Columns.SrNo].ToString());
                }
                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.OPDPrescriptionProcedureGuid]))
            {
                this.mId                 = AppShared.DbValueToInteger(dr[Columns.OPDPrescriptionId]);
                this.mObjectGuid         = AppShared.DbValueToGuid(dr[Columns.OPDPrescriptionProcedureGuid]);
                this.mPatientGuid        = AppShared.DbValueToGuid(dr[Columns.OPDPrescriptionPatientGuid]);
                this.mDoseage            = AppShared.DbValueToString(dr[Columns.Doseage]);
                this.mTimings            = AppShared.DbValueToString(dr[Columns.Timings]);
                this.OPDPrescriptionDate = AppShared.DbValueToDateTime(dr[Columns.OPDPrescriptionDate]);

                if (AppShared.HasColumn(dr, "Medicine"))
                {
                    this.mMedicine = AppShared.DbValueToString(dr[Columns.Medicine]);
                }

                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 3
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.PatientProcedureId]))
            {
                this.mId             = AppShared.DbValueToInteger(dr[Columns.PatientProcedureId]);
                this.mObjectGuid     = AppShared.DbValueToGuid(dr[Columns.PatientProcedureGuid]);
                this.mPatientGuid    = AppShared.DbValueToGuid(dr[Columns.PatietProcedurePatientGuid]);
                this.mProcedureGuid  = AppShared.DbValueToGuid(dr[Columns.PatientProcedureProcedureGuid]);
                this.mProcedureDate  = AppShared.DbValueToDateTime(dr[Columns.PatientProcedureDate]);
                this.mAmount         = AppShared.DbValueToDecimal(dr[Columns.PatientProcedureAmount]);
                this.mNotes          = AppShared.DbValueToString(dr[Columns.PatientProcedureNotes]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.PatientProcedureCreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.PatientProcedureCreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.PatientProcedureModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.PatientProcedureModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 4
0
        internal override bool Populate(System.Data.SqlClient.SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.Id]))
            {
                this.mId             = AppShared.DbValueToInteger(dr[Columns.Id]);
                this.mObjectGuid     = AppShared.DbValueToGuid(dr[Columns.Guid]);
                this.mCaption        = AppShared.DbValueToString(dr[Columns.Caption]);
                this.mGroupName      = AppShared.DbValueToString(dr[Columns.GroupName]);
                this.mIconLarge      = AppShared.DbValueToBytes(dr, Columns.IconLarge);
                this.mIconSmall      = AppShared.DbValueToBytes(dr, Columns.IconSmall);
                this.mListCaption    = AppShared.DbValueToString(dr[Columns.ListCaption]);
                this.mListTypeName   = AppShared.DbValueToString(dr[Columns.ListTypeName]);
                this.mName           = AppShared.DbValueToString(dr[Columns.Name]);
                this.mTypeName       = AppShared.DbValueToString(dr[Columns.TypeName]);
                this.mDescription    = AppShared.DbValueToString(dr[Columns.Desc]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.CreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.CreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.ModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.ModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }

            return(r);
        }
Esempio n. 5
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.OPDInvestigationProcedureGuid]))
            {
                this.mId                            = AppShared.DbValueToInteger(dr[Columns.OPDInvestigationProcedureId]);
                this.mObjectGuid                    = AppShared.DbValueToGuid(dr[Columns.OPDInvestigationProcedureGuid]);
                this.mPatientGuid                   = AppShared.DbValueToGuid(dr[Columns.OPDInvestigationProcedurePatientGuid]);
                this.mRadiologyInvestigation        = AppShared.DbValueToString(dr[Columns.RadiologyInvestigation]);
                this.mSpecialInvestigation          = AppShared.DbValueToString(dr[Columns.SpecialInvestigation]);
                this.mOPDInvestigationProcedureDate = AppShared.DbValueToDateTime(dr[Columns.OPDInvestigationProcedureDate]);

                if (AppShared.HasColumn(dr, "MainInvestigation"))
                {
                    this.mMainInvestigation = AppShared.DbValueToString(dr[Columns.MainInvestigation]);
                }

                if (AppShared.HasColumn(dr, "LabInvestigation"))
                {
                    this.mLabInvestigation = AppShared.DbValueToString(dr[Columns.LabInvestigation]);
                }
                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 6
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.WardGuid]))
            {
                this.mId          = AppShared.DbValueToInteger(dr[Columns.WardId]);
                this.mObjectGuid  = AppShared.DbValueToGuid(dr[Columns.WardGuid]);
                this.mName        = AppShared.DbValueToString(dr[Columns.WardName]);
                this.mDescription = AppShared.DbValueToString(dr[Columns.WardDescription]);
                //this.mCreatedBy = AppShared.DbValueToString(dr[Columns.UserCreatedBy]);
                this.mCreatedByUser = AppShared.DbValueToGuid(dr[Columns.WardCreatedBy]);
                this.mCreatedOn     = AppShared.DbValueToDateTime(dr[Columns.WardCreatedOn]);
                //this.mModifiedBy = AppShared.DbValueToString(dr[Columns.UserModifiedBy]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.WardModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.WardModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.MedicinePurchaseGuid]))
            {
                this.mId            = AppShared.DbValueToInteger(dr[Columns.MedicinePurchaseId]);
                this.mObjectGuid    = AppShared.DbValueToGuid(dr[Columns.MedicinePurchaseGuid]);
                this.mCategoryGuid  = AppShared.DbValueToGuid(dr[Columns.MedicinePurchaseCategoryGuid]);
                this.mCompanyGuid   = AppShared.DbValueToGuid(dr[Columns.MedicinePurchaseCompanyGuid]);
                this.mItemGuid      = AppShared.DbValueToGuid(dr[Columns.MedicinePurchaseItemGuid]);
                this.mBillType      = AppShared.DbValueToString(dr[Columns.MedicinePurchaseBillType]);
                this.mQuantity      = AppShared.DbValueToInteger(dr[Columns.MedicinePurchaseQuantity]);
                this.mWholesaleRate = AppShared.DbValueToDecimal(dr[Columns.MedicinePurchaseWholesaleRate]);
                this.mAmount        = AppShared.DbValueToDecimal(dr[Columns.MedicinePurchaseAmount]);
                this.mExpiryDate    = AppShared.DbValueToDateTime(dr[Columns.MedicinePurchaseExpiryDate]);
                this.mMRP           = AppShared.DbValueToDecimal(dr[Columns.MedicinePurchaseMRP]);
                this.Status         = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 8
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.PatientVitalGuid]))
            {
                this.mId          = AppShared.DbValueToInteger(dr[Columns.PatientVitalId]);
                this.mObjectGuid  = AppShared.DbValueToGuid(dr[Columns.PatientVitalGuid]);
                this.mPatientGuid = AppShared.DbValueToGuid(dr[Columns.PatientVitalPatientGuid]);
                this.mDate        = AppShared.DbValueToDateTime(dr[Columns.PatientVitalDate]);
                this.mTime        = AppShared.DbValueToString(dr[Columns.PatientVitalTime]);
                this.mBP          = AppShared.DbValueToString(dr[Columns.PatientVitalBP]);
                this.mHR          = AppShared.DbValueToString(dr[Columns.PatientVitalHR]);
                this.mRR          = AppShared.DbValueToString(dr[Columns.PatientVitalRR]);
                this.mTemp        = AppShared.DbValueToString(dr[Columns.PatientVitalTemp]);
                this.mRBS         = AppShared.DbValueToString(dr[Columns.PatientVitalRBS]);
                this.mECG         = AppShared.DbValueToString(dr[Columns.PatientVitalECG]);
                this.mWeight      = AppShared.DbValueToString(dr[Columns.PatientVitalWeight]);
                this.mHeight      = AppShared.DbValueToString(dr[Columns.PatientVitalHeight]);
                this.mOther       = AppShared.DbValueToString(dr[Columns.PatientVitalOther]);
                this.mSPO2        = AppShared.DbValueToString(dr[Columns.PatientVitalSPO2]);
                this.mPULSE       = AppShared.DbValueToString(dr[Columns.PatientVitalPULSE]);
                this.Status       = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 9
0
 public FieldPermissions(UserRole userRole)
 {
     if (!Objectbase.IsNullOrEmpty(userRole))
     {
         this.mUserRole = userRole;
         using (SqlDataReader dr = AppDAL.FieldPermssionSelectAllEntityByUser(userRole.ObjectGuid))
         {
             if (dr != null)
             {
                 while (dr.Read())
                 {
                     FieldPermission obj = null;
                     if (AppShared.IsNull(dr[FieldPermission.Columns.PermisionFieldGuid]))
                     {
                         Field field = new Field();
                         if (field.Populate(dr))
                         {
                             obj = new FieldPermission(userRole, field);
                             this.Add(obj);
                         }
                     }
                     else
                     {
                         obj = new FieldPermission();
                         if (obj.Populate(dr))
                             this.Add(obj);
                     }
                 }
             }
         }
     }
 }
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.IPDPatientTreatmentSheetDetailsGuid]))
            {
                this.mId         = AppShared.DbValueToInteger(dr[Columns.IPDPatientTreatmentSheetDetailsId]);
                this.mObjectGuid = AppShared.DbValueToGuid(dr[Columns.IPDPatientTreatmentSheetDetailsGuid]);
                this.mIPDPatientTreatmentSheetGuid = AppShared.DbValueToGuid(dr[Columns.IPDPatientTreatmentSheetDetailsTreatmentSheetGuid]);
                this.mIpdPatientTreatmentSheetDetailsPatientGuid = AppShared.DbValueToGuid(dr[Columns.IPDPatientTreatmentSheetDetailsPatientGuid]);
                this.mDescription = AppShared.DbValueToString(dr[Columns.IPDPatientTreatmentSheetDetailsDescription]);
                this.mMorningTime = AppShared.DbValueToString(dr[Columns.IPDPatientTreatmentSheetDetailsMorningTime]);
                this.mNoonTime    = AppShared.DbValueToString(dr[Columns.IPDPatientTreatmentSheetDetailsNoonTime]);
                this.EveningTime  = AppShared.DbValueToString(dr[Columns.IPDPatientTreatmentSheetDetailsEveningTime]);
                this.NightTime    = AppShared.DbValueToString(dr[Columns.IPDPatientTreatmentSheetDetailsNightTime]);
                if (AppShared.HasColumn(dr, "SrNo"))
                {
                    this.mSrNo = AppShared.DbValueToString(dr[Columns.SrNo].ToString());
                }
                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Esempio n. 11
0
 public Permissions(UserRole userRole)
 {
     if (!Objectbase.IsNullOrEmpty(userRole))
     {
         this.mUserRole = userRole;
         using (SqlDataReader dr = AppDAL.PermssionSelect_AllEntityByUser(userRole.ObjectGuid))
         {
             if (dr != null)
             {
                 while (dr.Read())
                 {
                     Permission obj = null;
                     if (AppShared.IsNull(dr[Permission.Columns.PermissionEntityGuid]))
                     {
                         Entity entity = new Entity();
                         if (entity.Populate(dr))
                         {
                             obj = new Permission(userRole, entity);
                             this.Add(obj);
                         }
                     }
                     else
                     {
                         obj = new Permission();
                         if (obj.Populate(dr))
                         {
                             this.Add(obj);
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 12
0
        internal static bool PatientUpdate(Guid guid, string firstName, string middleName, string lastName, int gender, int age, string address, string city,
/*patientDetails fields*/ string district, string taluko, string contactNo, string otherNo, string residenceNo, int maritalstatus, decimal marragetimeyear, int childern, string notes,
                                           Guid wardGuid, Guid roomGuid, DateTime admittedDate, string admittedtime, string admittedBy, string operation, DateTime followUpDate, decimal amount, bool isIpd,
                                           bool isOpd, Guid referenceDoctorGuid, decimal referenceDoctorShare, string PatientOccupation, string PatientOccupationFullAddress, string PatientReference,
                                           string PatientInsurance, string PatientInsuranceCompany, string insuranceAmount, DateTime PatientOperationDateTime, string PatientSigningPersonName,
                                           string PatientRelationshipWith, string PatientDoctorIncharge, string PatientDivison, string PatientPSOName, string PatientReceivingStaff, string receivingStaffReceptionMO,
                                           string PatientMO, string PatientProvisionalDiagnosis, string PatientCamePreviously, DateTime?patientBirthDate, string senderName, string chiefComplaint,
                                           string typeOfCase, string ht, string dm, string ihd, string majorIllness, string drugAllergy, string pregenency, string bt, string admittedTimetemperature,
                                           string admittedTimePulse, string admittedTimeRR, string admittedTimeSpo2, string admittedTimeBp, string admittedTimeHr, string admittedTimeRbs,
                                           string admittedTimeEcg, string admittedTimeOther, string admittedTimeWeight, string admittedTimeHeight, string systemicExamination,
                                           string rs, string cvs, string cns, string pa, string other, string suggestedInvestigation, string clinicalNote, string admittedTimeTreatment,
                                           DateTime?operationDate, string operationTime,
/*mlc form*/ bool isMlc, string mlcFormFillupName, string PatientMLCNo, string PatientEntryNo, string PatientMarkOfIdentity, string PatientEventDetail,
                                           string PatientFetcherPersonName, string PatientFetcherPersonFullAddress,
                                           string InformerStaffPerson, string PatientInformTime, string RelatedPoliceStation, string RelatedPoliceOfficer,
/*dischage fields*/ bool isDischarge, DateTime dischargeDate, string dischargeTime, string dischargeBy, string dischargeStaffReception, string dischargeStaffReceptionMO,
                                           int invoiceNo, DateTime invoiceDate, string PatientFinalDiagnosis, string conditionOnDischarge, string typeOfDischarge, string dischargeTypeTemperature,
                                           string dischargeTimePulse, string dischargeTimeRR, string dischargeTimeSpo2, string dischargeTimeBp, string dischargeTimeHr, string dischargeTimeRbs,
                                           string dischargeTimeEcg, string dischargeTimeRcg, string dischargeTimeOther, string dischargeTimeWeight, string dischargeTimeHeight, string dischargeTimeClinicalExamination,
                                           string dischargeTimeOperativeNote, string dischargeTimeInvestigation, string dischargeTimeTreatment, string advice, string status, string medicalOfficer, string indoorno, string billno,
                                           DateTime?medicalOfficeDate, string medicalOfficeTime, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Patient_Update))
            {
                PatientParameters(cmd, guid, firstName, middleName, lastName, gender, age, address, city, district, taluko, contactNo, otherNo, residenceNo, maritalstatus,
/*patientDetails fields*/ marragetimeyear, childern, notes, wardGuid, roomGuid, admittedDate, admittedtime, admittedBy, operation, followUpDate, amount, isIpd, isOpd, referenceDoctorGuid,
                                  referenceDoctorShare, PatientOccupation, PatientOccupationFullAddress, PatientReference, PatientInsurance, PatientInsuranceCompany, insuranceAmount,
                                  PatientOperationDateTime, PatientSigningPersonName, PatientRelationshipWith, PatientDoctorIncharge, PatientDivison, PatientPSOName, PatientReceivingStaff,
                                  receivingStaffReceptionMO, PatientMO, PatientProvisionalDiagnosis, PatientCamePreviously, patientBirthDate, senderName, chiefComplaint, typeOfCase,
                                  ht, dm, ihd, majorIllness, drugAllergy, pregenency, bt, admittedTimetemperature, admittedTimePulse, admittedTimeRR, admittedTimeSpo2, admittedTimeBp, admittedTimeHr,
                                  admittedTimeRbs, admittedTimeEcg, admittedTimeOther, admittedTimeWeight, admittedTimeHeight, systemicExamination, rs, cvs, cns, pa, other,
                                  suggestedInvestigation, clinicalNote, admittedTimeTreatment, operationDate, operationTime,
/*mlc form*/ isMlc, mlcFormFillupName, PatientMLCNo, PatientEntryNo, PatientMarkOfIdentity, PatientEventDetail, PatientFetcherPersonName, PatientFetcherPersonFullAddress,
                                  InformerStaffPerson, PatientInformTime, RelatedPoliceStation, RelatedPoliceOfficer,
/*dischage fields*/ isDischarge, dischargeDate, dischargeTime, dischargeBy, dischargeStaffReception, dischargeStaffReceptionMO, invoiceNo, invoiceDate, PatientFinalDiagnosis,
                                  conditionOnDischarge, typeOfDischarge, dischargeTypeTemperature, dischargeTimePulse, dischargeTimeRR, dischargeTimeSpo2, dischargeTimeBp, dischargeTimeHr,
                                  dischargeTimeRbs, dischargeTimeEcg, dischargeTimeRcg, dischargeTimeOther, dischargeTimeWeight, dischargeTimeHeight, dischargeTimeClinicalExamination,
                                  dischargeTimeOperativeNote, dischargeTimeInvestigation, dischargeTimeTreatment, advice, status, medicalOfficer, indoorno, billno,
                                  medicalOfficeDate, medicalOfficeTime, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, Patient.Columns.PatientModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }

            return(r);
        }
Esempio n. 13
0
        internal static byte[] DbValueToBytes(SqlDataReader dr, string columnName)
        {
            byte[] r       = null;
            int    ordinal = dr.GetOrdinal(columnName);

            if (AppShared.IsNotNull(dr[ordinal]))
            {
                System.Data.SqlTypes.SqlBytes sqlData = dr.GetSqlBytes(ordinal);
                r = sqlData.Value;
            }
            return(r);
        }
Esempio n. 14
0
 private static void EntityParameters(SqlCommand cmd, Guid guid, string name, string caption, string typeName, string listCaption, string listTypeName, byte[] iconSmall, byte[] iconLarge, string groupName, string desc, Guid modifiedBy)
 {
     AppDatabase.AddInParameter(cmd, Entity.Columns.Guid, SqlDbType.UniqueIdentifier, guid);
     AppDatabase.AddInParameter(cmd, Entity.Columns.Name, SqlDbType.NVarChar, AppShared.SafeString(name));
     AppDatabase.AddInParameter(cmd, Entity.Columns.Desc, SqlDbType.NVarChar, AppShared.ToDbValueNullable(desc));
     AppDatabase.AddInParameter(cmd, Entity.Columns.GroupName, SqlDbType.NVarChar, AppShared.ToDbValueNullable(groupName));
     AppDatabase.AddInParameter(cmd, Entity.Columns.Caption, SqlDbType.NVarChar, AppShared.SafeString(caption));
     AppDatabase.AddInParameter(cmd, Entity.Columns.TypeName, SqlDbType.NVarChar, AppShared.SafeString(typeName));
     AppDatabase.AddInParameter(cmd, Entity.Columns.ListCaption, SqlDbType.NVarChar, AppShared.SafeString(listCaption));
     AppDatabase.AddInParameter(cmd, Entity.Columns.ListTypeName, SqlDbType.NVarChar, AppShared.SafeString(listTypeName));
     AppDatabase.AddInParameter(cmd, Entity.Columns.IconSmall, SqlDbType.VarBinary, AppShared.ToDbValueNullable(iconSmall));
     AppDatabase.AddInParameter(cmd, Entity.Columns.IconLarge, SqlDbType.VarBinary, AppShared.ToDbValueNullable(iconLarge));
     AppDatabase.AddInParameter(cmd, Entity.Columns.ModifiedBy, SqlDbType.UniqueIdentifier, modifiedBy);
 }
Esempio n. 15
0
        internal static bool ChangePassword(Guid userGuid, string oldPassword, string newPassword)
        {
            bool r = false;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(User_ChangePassword))
            {
                AppDatabase.AddInParameter(cmd, "@UserGuid", SqlDbType.UniqueIdentifier, userGuid);
                AppDatabase.AddInParameter(cmd, "@UserOldPassword", SqlDbType.NVarChar, oldPassword);
                AppDatabase.AddInParameter(cmd, "@UserNewPassword", SqlDbType.NVarChar, newPassword);
                SqlParameter prmSucess = AppDatabase.AddOutParameter(cmd, "@IsSuccess", SqlDbType.Bit);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd) && AppShared.DbValueToBoolean(prmSucess.Value);
            }
            return(r);
        }
Esempio n. 16
0
        internal static DataTable OPDTreatmentData(DateTime dt)
        {
            DataTable r = null;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(OPDTreatment_Report))
            {
                AppDatabase.AddInParameter(cmd, "@Date", SqlDbType.DateTime, AppShared.ToDbValueNullable(dt));

                AppDatabase db = OpenDatabase();
                if (db != null)
                {
                    r = db.GetDataTable(cmd);
                }
            }
            return(r);
        }
Esempio n. 17
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.BillId]))
            {
                this.mId              = AppShared.DbValueToInteger(dr[Columns.BillId]);
                this.mObjectGuid      = AppShared.DbValueToGuid(dr[Columns.BillGuid]);
                this.mPatientGuid     = AppShared.DbValueToGuid(dr[Columns.PatientGuid]);
                this.mPatientBillDate = AppShared.DbValueToDateTime(dr[Columns.BillDate]);
                this.mOther           = AppShared.DbValueToString(dr[Columns.BillOther]);
                this.Status           = ObjectStatus.Opened;
                r = true;
            }
            return(r);
        }
        internal static SqlDataReader IPDPatientTreatmentSheetSearch(string searchText, DateTime dateFrom, DateTime dateTo)
        {
            SqlDataReader r = null;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(IPDPatientTreatmentSheet_Search))
            {
                AppDatabase.AddInParameter(cmd, "@SearchText", SqlDbType.NVarChar, AppShared.ToDbLikeText(searchText));
                AppDatabase.AddInParameter(cmd, "@DateFrom", SqlDbType.DateTime, AppShared.ToDbValueNullable(dateFrom));
                AppDatabase.AddInParameter(cmd, "@DateTo", SqlDbType.DateTime, AppShared.ToDbValueNullable(dateTo));
                AppDatabase db = OpenDatabase();
                if (db != null)
                {
                    r = db.GetSqlDataReader(cmd);
                }
            }
            return(r);
        }
Esempio n. 19
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.TreatmentSheetId]))
            {
                this.mId            = AppShared.DbValueToInteger(dr[Columns.TreatmentSheetId]);
                this.mObjectGuid    = AppShared.DbValueToGuid(dr[Columns.TreatmentSheetGuid]);
                this.mPatientGuid   = AppShared.DbValueToGuid(dr[Columns.TreatmentSheetPatientGuid]);
                this.mDiatAdvice    = AppShared.DbValueToString(dr[Columns.TreatmentSheetDiatAdvice]);
                this.mSpecialAdvice = AppShared.DbValueToString(dr[Columns.TreatmentSheetSpecialAdvice]);
                this.mSOSDrug       = AppShared.DbValueToString(dr[Columns.TreatmentSheetSOSDrug]);
                this.mSheetDate     = AppShared.DbValueToDateTime(dr[Columns.TreatmentSheetDate]);
                this.Status         = ObjectStatus.Opened;
                r = true;
            }
            return(r);
        }
Esempio n. 20
0
        internal static bool ProcedureInsert(Guid guid, string name, string description, Guid createdByUser, out DateTime createdOn)
        {
            bool r = false;

            createdOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Procedure_Insert))
            {
                ProcedureParameters(cmd, guid, name, description, createdByUser);
                SqlParameter prmModifiedOn = AppDatabase.AddOutParameter(cmd, Procedure.Columns.ProcedureModifiedOn, SqlDbType.DateTime);
                AppDatabase  db            = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    createdOn = AppShared.DbValueToDateTime(prmModifiedOn.Value);
                }
            }
            return(r);
        }
        internal static bool PatientProcedureUpdate(Guid patientProcedureGuid, Guid patientGuid, Guid procedureGuid, DateTime patientProcedureDate, decimal amount, string notes, Guid modifiedBy, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(PatientProcedure_Update))
            {
                PatientProcedureParameter(cmd, patientProcedureGuid, patientGuid, procedureGuid, patientProcedureDate, amount, notes, modifiedBy);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, PatientProcedure.Columns.PatientProcedureModifiedOn, SqlDbType.DateTime);
                AppDatabase  db      = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Esempio n. 22
0
        internal static bool PermissionUpdate(Guid userGuid, Guid entityGuid, bool canView, bool canCreate, bool canEdit, bool canDelete, bool canSpecial, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(UserPermission_Update))
            {
                PermissionParameters(cmd, userGuid, entityGuid, canView, canCreate, canEdit, canDelete, canSpecial, modifiedByUser);
                SqlParameter prmModifiedOn = AppDatabase.AddOutParameter(cmd, "PermissionModifiedOn", SqlDbType.DateTime);
                AppDatabase  db            = OpenDatabase();
                r = (db != null && db.ExecuteCommand(cmd));
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmModifiedOn.Value);
                }
            }
            return(r);
        }
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.OPDHistoryProcedurePatientGuid]))
            {
                this.mHistoryProcedureGuid = AppShared.DbValueToGuid(dr[Columns.OPDHistoryProcedureGuid]);
                this.mPatientGuid          = AppShared.DbValueToGuid(dr[Columns.OPDHistoryProcedurePatientGuid]);
                this.mChiefComplainGuid    = AppShared.DbValueToGuid(dr[Columns.OPDHistoryProcedureChiefComplain]);
                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
        //private const string IPDTreatment_Search = "IPDTreatment_Search";

        internal static bool IPDPatientTreatmentInsert(Guid guid, Guid patientGuid, Guid treatmentGuid, Guid createdByUser, out DateTime createdOn)
        {
            bool r = false;

            createdOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(IPDPatientTreatment_Insert))
            {
                IPDPatientTreatmentParameters(cmd, guid, patientGuid, treatmentGuid, createdByUser);
                SqlParameter prmModifiedOn = AppDatabase.AddOutParameter(cmd, IPDPatientTreatment.Columns.IPDPatientTreatmentModifiedOn, SqlDbType.DateTime);
                AppDatabase  db            = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    createdOn = AppShared.DbValueToDateTime(prmModifiedOn.Value);
                }
            }
            return(r);
        }
Esempio n. 25
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.OPDPrescriptionProcedurePatientGuid]))
            {
                this.mPrescriptionProcedureGuid = AppShared.DbValueToGuid(dr[Columns.OPDPrescriptionProcedureGuid]);
                this.mPatientGuid  = AppShared.DbValueToGuid(dr[Columns.OPDPrescriptionProcedurePatientGuid]);
                this.mMedicineGuid = AppShared.DbValueToGuid(dr[Columns.OPDPrescriptionProcedureMedicineGuid]);
                this.Status        = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
        internal static bool TreatmentProcedureUpdate(Guid OPDTreatmentProcedureGuid, Guid OPDTreatmentProcedurePatientGuid, DateTime OPDTreatmentDate, Guid modifiedByUser,
                                                      out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(TreatmentProcedure_Update))
            {
                OPDTreatmentProcedureParameters(cmd, OPDTreatmentProcedureGuid, OPDTreatmentProcedurePatientGuid, OPDTreatmentDate, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, OPDTreatmentProcedure.Columns.OPDTreatmentModifiedOn, SqlDbType.DateTime);
                AppDatabase  db      = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Esempio n. 27
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.LabInvestigationGuid]))
            {
                this.mId             = AppShared.DbValueToInteger(dr[Columns.LabInvestigationId]);
                this.mObjectGuid     = AppShared.DbValueToGuid(dr[Columns.LabInvestigationGuid]);
                this.mName           = AppShared.DbValueToString(dr[Columns.LabInvestigationName]);
                this.mDescription    = AppShared.DbValueToString(dr[Columns.LabInvestigationDescription]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.LabInvestigationCreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.LabInvestigationCreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.LabInvestigationModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.LabInvestigationModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            return(r);
        }
        internal static bool LabInvestigationUpdate(Guid LabInvestigationGuid, string LabInvestigationName, string LabInvestigationDescription, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(LabInvestigation_Update))
            {
                LabInvestigationParameter(cmd, LabInvestigationGuid, LabInvestigationName, LabInvestigationDescription, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, LabInvestigation.Columns.LabInvestigationModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Esempio n. 29
0
        internal static bool OPDTreatmentUpdate(Guid Treatmentguid, Guid ChiefComplainGuid, string TreatmentName, string Description, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Treatment_Update))
            {
                OPDTreatmentParameters(cmd, Treatmentguid, ChiefComplainGuid, TreatmentName, Description, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, OPDTreatment.Columns.TreatmentModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Esempio n. 30
0
        internal static bool AppointmentUpdate(Guid PatientGuid, Guid AppointmentGuid, DateTime AppointmentDate, string AppointmentDescription, Guid ModifiedByUser, out DateTime ModifiedOn)
        {
            bool r = false;

            ModifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Appointment_Update))
            {
                AppointmentParameters(cmd, PatientGuid, AppointmentGuid, AppointmentDate, AppointmentDescription, ModifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, Appointment.Columns.AppointmentModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    ModifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }