Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
        //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);
        }
        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);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
        internal static bool HistoryUpdate(Guid HistoryGuid, string HistoryName, string HistoryDescription, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(History_Update))
            {
                HistoryParameter(cmd, HistoryGuid, HistoryName, HistoryDescription, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, History.Columns.HistoryModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
0
        internal static bool MedicineUpdate(Guid Medicineguid, string MedicineName, string Description, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Medicine_Update))
            {
                MedicineParameters(cmd, Medicineguid, MedicineName, Description, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, Medicine.Columns.MedicineModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            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);
        }
        internal static bool InvestigationProcedureUpdate(Guid InvestigationProcedureGuid, Guid MainInvestigationGUID, Guid LabInvestigationGUID, string RadiologyInvestigation, string SpecialInvestigation, DateTime InvestigationProcedureDate, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(InvestigationProcedure_Update))
            {
                InvestigationProcedureParameter(cmd, InvestigationProcedureGuid, MainInvestigationGUID, LabInvestigationGUID, RadiologyInvestigation, SpecialInvestigation, InvestigationProcedureDate, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, InvestigationProcedure.Columns.InvestigationProcedureModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 12
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);
        }
        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);
        }
        internal static bool OPDInvestigationProcedureInsert(Guid OPDInvestigationProcedureGuid, Guid PatientGuid, string RadiologyInvestigation,
                                                             string SpecialInvestigation, DateTime OPDInvestigationProcedureDate, Guid createdByUser, out DateTime createdOn)
        {
            bool r = false;

            createdOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(OPDInvestigationProcedure_Insert))
            {
                OPDInvestigationProcedureParameters(cmd, OPDInvestigationProcedureGuid, PatientGuid, RadiologyInvestigation, SpecialInvestigation,
                                                    OPDInvestigationProcedureDate, createdByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, OPDInvestigationProcedure.Columns.OPDInvestigationProcedureModifiedOn, SqlDbType.DateTime);
                AppDatabase  db      = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    createdOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 15
0
        internal static bool EntityUpdate(Guid guid, string name, string caption, string typeName, string listCaption, string listTypeName, byte[] iconSmall, byte[] iconLarge, string groupName, string desc, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Entity_Update))
            {
                EntityParameters(cmd, guid, name, caption, typeName, listCaption, listTypeName, iconSmall, iconLarge, groupName, desc, modifiedByUser);

                SqlParameter prmModifiedOn = AppDatabase.AddOutParameter(cmd, "@EntityModifiedOn", SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                if (db != null && db.ExecuteCommand(cmd))
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmModifiedOn.Value);
                    r          = true;
                }
            }
            return(r);
        }
Ejemplo n.º 16
0
        internal static bool FieldInsert(Guid guid, string name, out int id)
        {
            bool r = false;

            id = 0;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Field_Insert))
            {
                FieldParameters(cmd, guid, name);

                SqlParameter prmId = AppDatabase.AddOutParameter(cmd, "@FieldId", SqlDbType.Int);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    id = AppShared.DbValueToInteger(prmId.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 17
0
        internal static bool OPDPrescriptionUpdate(Guid OPDPrescriptionProcedureGuid, Guid PatientGuid, string Doseage, string Timings,
                                                   DateTime OPDPrescriptionDate, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(OPDPrescription_Update))
            {
                OPDPrescriptionParameters(cmd, OPDPrescriptionProcedureGuid, PatientGuid, Doseage, Timings, OPDPrescriptionDate, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, OPDPrescription.Columns.OPDPrescriptionModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 18
0
        internal static bool UserUpdate(Guid guid, string name, string loginName, Guid userRoleGuid, string password, string addressline1, string addressline2, string addressline3, string phoneNo, string mobileNo, byte[] photo, string desc, decimal doctorShare, bool isDisable, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(User_Update))
            {
                UserParameters(cmd, guid, name, loginName, userRoleGuid, password, addressline1, addressline2, addressline3, phoneNo, mobileNo, photo, desc, doctorShare, isDisable, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, User.Columns.UserModifiedOn, SqlDbType.DateTime);

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

            return(r);
        }
Ejemplo n.º 19
0
        internal static bool UserRoleUpdate(Guid guid, string userRoleName, int userRoleLevel, string userRoleDesc, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(UserRole_Update))
            {
                UserRoleParameters(cmd, guid, userRoleName, userRoleLevel, userRoleDesc, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, UserRole.Columns.UserRoleModifiedOn, SqlDbType.DateTime);

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

            return(r);
        }
Ejemplo n.º 20
0
        internal static bool CheckUsernameAvailibity(string userName, Guid excludeGuid)
        {
            bool r = false;

            if (userName != string.Empty)
            {
                using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(User_CheckName))
                {
                    AppDatabase.AddInParameter(cmd, "@Username", SqlDbType.NVarChar, userName);
                    AppDatabase.AddInParameter(cmd, "@ExcludeGuid", SqlDbType.UniqueIdentifier, AppShared.ToDbValueNullable(excludeGuid));
                    SqlParameter prmAvailable = AppDatabase.AddOutParameter(cmd, "@IsAvailable", SqlDbType.Bit);

                    AppDatabase db = OpenDatabase();
                    if (db != null && db.ExecuteCommand(cmd))
                    {
                        r = AppShared.DbValueToBoolean(prmAvailable.Value);
                    }
                }
            }
            return(r);
        }
Ejemplo n.º 21
0
        internal static bool WardUpdate(Guid guid, string name, string description, Guid modifiedByUser, out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Ward_Update))
            {
                WardParameters(cmd, guid, name, description, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, Ward.Columns.WardModifiedOn, SqlDbType.DateTime);

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

            return(r);
        }
        internal static bool HistoryProcedureUpdate(Guid HistoryProcedureGuid, Guid PatientGuid, string ProblemSince,
                                                    string AssociateComplainDuration, string FamilyHistory, string FamilyHistoryDuration, DateTime Date, string BP, string HR, string RR, string Temp, string RBS, string ECG, string Wt, string Other, string MLCNo, DateTime FollowUpDate, string TimeHour, string TimeMinute, string TimeAMPM, Guid modifiedByUser,
                                                    out DateTime modifiedOn)
        {
            bool r = false;

            modifiedOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(HistoryProcedure_Update))
            {
                HistoryProcedureParameter(cmd, HistoryProcedureGuid, PatientGuid, ProblemSince, AssociateComplainDuration,
                                          FamilyHistory, FamilyHistoryDuration, Date, BP, HR, RR, Temp, RBS, ECG, Wt, Other, MLCNo, FollowUpDate, TimeHour, TimeMinute, TimeAMPM, modifiedByUser);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, HistoryProcedure.Columns.HistoryProcedureModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    modifiedOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
        internal static bool MainInvestigationInsert(Guid MainInvestigationGuid, string MainInvestigationName, string MainInvestigationDescription, Guid createdByUser, out DateTime createdOn)
        {
            bool r = false;

            //id = 0;
            createdOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(MainInvestigation_Insert))
            {
                MainInvestigationParameter(cmd, MainInvestigationGuid, MainInvestigationName, MainInvestigationDescription, createdByUser);
                //  SqlParameter prmId = AppDatabase.AddOutParameter(cmd, MainInvestigation.Columns.MainInvestigationId, SqlDbType.Int);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, MainInvestigation.Columns.MainInvestigationModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    //id = AppShared.DbValueToInteger(prmId.Value);
                    createdOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
        internal static bool OPDInvestigationInsert(Guid OPDInvestigationGuid, Guid MainInvestigationGUID, Guid LabInvestigationGUID, string OPDRadiologyInvestigation, string OPDSpecialInvestigation, DateTime OPDInvestigationDate, Guid createdByUser, out DateTime createdOn)
        {
            bool r = false;

            //id = 0;
            createdOn = DateTime.MinValue;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(OPDInvestigation_Insert))
            {
                OPDInvestigationParameter(cmd, OPDInvestigationGuid, MainInvestigationGUID, LabInvestigationGUID, OPDRadiologyInvestigation, OPDSpecialInvestigation, OPDInvestigationDate, createdByUser);
                //  SqlParameter prmId = AppDatabase.AddOutParameter(cmd, OPDInvestigation.Columns.OPDInvestigationId, SqlDbType.Int);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, OPDInvestigation.Columns.OPDInvestigationModifiedOn, SqlDbType.DateTime);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    //id = AppShared.DbValueToInteger(prmId.Value);
                    createdOn = AppShared.DbValueToDateTime(prmDate.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 25
0
        internal static bool EntityInsert(Guid guid, string name, string caption, string typeName, string listCaption, string listTypeName, byte[] iconSmall, byte[] iconLarge, string groupName, string desc, Guid createdByUser, out DateTime createdOn, out int id)
        {
            bool r = false;

            createdOn = DateTime.MinValue;
            id        = 0;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Entity_Insert))
            {
                EntityParameters(cmd, guid, name, caption, typeName, listCaption, listTypeName, iconSmall, iconLarge, groupName, desc, createdByUser);

                SqlParameter prmCreatedOn = AppDatabase.AddOutParameter(cmd, "@EntityModifiedOn", SqlDbType.DateTime);
                SqlParameter prmId        = AppDatabase.AddOutParameter(cmd, "@EntityId", SqlDbType.Int);

                AppDatabase db = OpenDatabase();
                r = db != null && db.ExecuteCommand(cmd);
                if (r)
                {
                    id        = AppShared.DbValueToInteger(prmId.Value);
                    createdOn = AppShared.DbValueToDateTime(prmCreatedOn.Value);
                }
            }
            return(r);
        }
Ejemplo n.º 26
0
        internal static Decimal GetAvailableStockMedicine(Guid CategoryGuid, Guid CompanyGuid, Guid ItemGuid)
        {
            decimal AvailableStock = 0;
            bool    r = false;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(Medicine_MaxQuantity))
            {
                AppDatabase.AddInParameter(cmd, Medicines.Columns.MedicineCategoryGuid, SqlDbType.UniqueIdentifier, CategoryGuid);
                AppDatabase.AddInParameter(cmd, Medicines.Columns.MedicineCompanyGuid, SqlDbType.UniqueIdentifier, CompanyGuid);
                AppDatabase.AddInParameter(cmd, Medicines.Columns.MedicineItemGuid, SqlDbType.UniqueIdentifier, ItemGuid);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, Medicines.Columns.MedicineCurrentStock, SqlDbType.Decimal);
                AppDatabase  db      = OpenDatabase();
                if (db != null)
                {
                    r = db.ExecuteCommand(cmd);
                }
                if (r)
                {
                    AvailableStock = AppShared.DbValueToDecimal(prmDate.Value);
                }
            }
            return(AvailableStock);
            // return GetReader(Patient_Search, "@SearchText", SqlDbType.NVarChar, AppShared.ToDbLikeText(searchText));
        }
Ejemplo n.º 27
0
        internal static Decimal MRPFromPurchase(Guid CategoryGuid, Guid CompanyGuid, Guid ItemGuid)
        {
            decimal MRP = 0;
            bool    r   = false;

            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(MedicinePurchase_GETMRP))
            {
                AppDatabase.AddInParameter(cmd, MedicinePurchase.Columns.MedicinePurchaseCategoryGuid, SqlDbType.UniqueIdentifier, CategoryGuid);
                AppDatabase.AddInParameter(cmd, MedicinePurchase.Columns.MedicinePurchaseCompanyGuid, SqlDbType.UniqueIdentifier, CompanyGuid);
                AppDatabase.AddInParameter(cmd, MedicinePurchase.Columns.MedicinePurchaseItemGuid, SqlDbType.UniqueIdentifier, ItemGuid);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, MedicinePurchase.Columns.MedicinePurchaseMRP, SqlDbType.Decimal);
                AppDatabase  db      = OpenDatabase();
                if (db != null)
                {
                    r = db.ExecuteCommand(cmd);
                }
                if (r)
                {
                    MRP = AppShared.DbValueToDecimal(prmDate.Value);
                }
            }
            return(MRP);
            // return GetReader(Patient_Search, "@SearchText", SqlDbType.NVarChar, AppShared.ToDbLikeText(searchText));
        }