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);
        }
예제 #2
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);
        }
예제 #3
0
        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);
        }
예제 #4
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);
        }
예제 #5
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));
        }
예제 #6
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));
        }
예제 #7
0
        internal override bool Populate(SqlDataReader dr)
        {
            bool r = false;

            if (dr != null && AppShared.IsNotNull(dr[Columns.ReferenceDoctorGuid]))
            {
                this.mId             = AppShared.DbValueToInteger(dr[Columns.ReferenceDoctorId]);
                this.mObjectGuid     = AppShared.DbValueToGuid(dr[Columns.ReferenceDoctorGuid]);
                this.mName           = AppShared.DbValueToString(dr[Columns.ReferenceDoctorName]);
                this.mDescription    = AppShared.DbValueToString(dr[Columns.ReferenceDoctorDescription]);
                this.mShare          = AppShared.DbValueToDecimal(dr[Columns.ReferenceDoctorShare]);
                this.mCreatedByUser  = AppShared.DbValueToGuid(dr[Columns.ReferenceDoctorCreatedBy]);
                this.mCreatedOn      = AppShared.DbValueToDateTime(dr[Columns.ReferenceDoctorCreatedOn]);
                this.mModifiedByUser = AppShared.DbValueToGuid(dr[Columns.ReferenceDoctorModifiedBy]);
                this.mModifiedOn     = AppShared.DbValueToDateTime(dr[Columns.ReferenceDoctorModifiedOn]);
                this.Status          = ObjectStatus.Opened;
                r = true;
            }
            else
            {
                this.Reset();
            }
            return(r);
        }