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);
        }
Exemple #2
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);
        }
Exemple #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);
        }
        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);
        }
        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);
        }
Exemple #6
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);
        }
        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);
        }
        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);
        }
Exemple #9
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);
        }
Exemple #10
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);
        }
Exemple #11
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);
        }
Exemple #12
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.mName       = AppShared.DbValueToString(dr[Columns.Name]);
                this.Status      = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }

            return(r);
        }
Exemple #13
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);
        }
Exemple #14
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.CategoryGuid]))
            {
                this.mId           = AppShared.DbValueToInteger(dr[Columns.CategoryId]);
                this.mObjectGuid   = AppShared.DbValueToGuid(dr[Columns.CategoryGuid]);
                this.mCategoryName = AppShared.DbValueToString(dr[Columns.CategoryName]);
                this.mCreatedDate  = AppShared.DbValueToDateTime(dr[Columns.CategoryCreatedDate]);
                this.Status        = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Exemple #15
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);
        }
Exemple #16
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.UserGuid]))
            {
                this.mId              = AppShared.DbValueToInteger(dr[Columns.UserId]);
                this.mObjectGuid      = AppShared.DbValueToGuid(dr[Columns.UserGuid]);
                this.mName            = AppShared.DbValueToString(dr[Columns.UserName]);
                this.mLoginName       = AppShared.DbValueToString(dr[Columns.UserLoginName]);
                this.mUserRoleGuid    = AppShared.DbValueToGuid(dr[Columns.UserRoleGuid]);
                this.mPassword        = AppShared.DbValueToString(dr[Columns.UserPassword]);
                this.mAddressLine1    = AppShared.DbValueToString(dr[Columns.UserAddressLine1]);
                this.mAddressLine2    = AppShared.DbValueToString(dr[Columns.UserAddressLine2]);
                this.mAddressLine3    = AppShared.DbValueToString(dr[Columns.UserAddressLine3]);
                this.mPhoneNo         = AppShared.DbValueToString(dr[Columns.UserPhoneNo]);
                this.mMobileNo        = AppShared.DbValueToString(dr[Columns.UserMobileNo]);
                this.mPhoto           = AppShared.DbValueToBytes(dr, Columns.UserPhoto);
                this.mWindowsUserName = AppShared.DbValueToString(dr[Columns.UserWindowsUserName]);
                // this.mIsBlocked = AppShared.DbValueToBoolean(dr[Columns.UserIsDisable]);
                this.mIsDisabled     = AppShared.DbValueToBoolean(dr[Columns.UserIsDisable]);
                this.mDescription    = AppShared.DbValueToString(dr[Columns.UserDesc]);
                this.mDoctorShare    = AppShared.DbValueToDecimal(dr[Columns.DoctorShare]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.UserCreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.UserCreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.UserModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.UserModifiedOn]);
                //dr.GetBytes(dr.GetOrdinal(Columns.UserRowStamp), 0, this.mRowStamp, 0, 8);

                this.Status = ObjectStatus.Opened;
                r           = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Exemple #17
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);
        }
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.MedicineGuid]))
            {
                this.mId           = AppShared.DbValueToInteger(dr[Columns.MedicineId]);
                this.mObjectGuid   = AppShared.DbValueToGuid(dr[Columns.MedicineGuid]);
                this.mCategoryGuid = AppShared.DbValueToGuid(dr[Columns.MedicineCategoryGuid]);
                this.mCompanyGuid  = AppShared.DbValueToGuid(dr[Columns.MedicineCompanyGuid]);
                this.mItemGuid     = AppShared.DbValueToGuid(dr[Columns.MedicineItemGuid]);
                this.mCurrentStock = AppShared.DbValueToInteger(dr[Columns.MedicineCurrentStock]);
                this.mReOrderLevel = AppShared.DbValueToInteger(dr[Columns.MedicineReOrderLevel]);
                this.mCreatedDate  = AppShared.DbValueToDateTime(dr[Columns.MedicineCreatedDate]);
                this.Status        = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }
Exemple #19
0
        internal static bool UserRoleInsert(Guid guid, string userRoleName, int userRoleLevel, string userRoleDesc, Guid createdByUser, out DateTime createdOn, out int userRoleId)
        {
            bool r = false;

            createdOn  = DateTime.MinValue;
            userRoleId = 0;
            using (SqlCommand cmd = AppDatabase.GetStoreProcCommand(UserRole_Insert))
            {
                UserRoleParameters(cmd, guid, userRoleName, userRoleLevel, userRoleDesc, createdByUser);
                SqlParameter prmId   = AppDatabase.AddOutParameter(cmd, UserRole.Columns.UserRoleId, SqlDbType.Int);
                SqlParameter prmDate = AppDatabase.AddOutParameter(cmd, UserRole.Columns.UserRoleModifiedOn, SqlDbType.DateTime);

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

            return(r);
        }
Exemple #20
0
        internal static bool UserInsert(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 createdByUser, out DateTime createdOn, out int userId)
        {
            bool r = false;

            userId    = 0;
            createdOn = DateTime.MinValue;

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

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

            return(r);
        }
Exemple #21
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.UserRoleGuid]))
            {
                this.mUserRoleId     = AppShared.DbValueToInteger(dr[Columns.UserRoleId]);
                this.mObjectGuid     = AppShared.DbValueToGuid(dr[Columns.UserRoleGuid]);
                this.mUserRoleName   = AppShared.DbValueToString(dr[Columns.UserRoleName]);
                this.mUserRoleLevel  = AppShared.DbValueToInteger(dr[Columns.UserRoleLevel]);
                this.mUserRoleDesc   = AppShared.DbValueToString(dr[Columns.UserRoleDesc]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.UserRoleCreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.UserRoleCreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.UserRoleModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.UserRoleModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }