Ejemplo n.º 1
0
 private Family(SafeDataReader dr)
 {
     MarkAsChild();
     _memberid        = dr.GetInt32("id");
     _firstname       = dr.GetString("first_name");
     _lastname        = dr.GetString("last_name");
     _en_firstname    = dr.GetString("en_first_name");
     _en_lastname     = dr.GetString("en_last_name");
     _sex             = (int)dr.GetByte("sex");
     _marriage        = (int)dr.GetByte("married");
     _baptismcode     = dr.GetInt32("baptism_memberid");
     _baptismyear     = dr.GetSmartDate("baptism_year");
     _birth           = dr.GetSmartDate("birthday");
     _cell            = dr.GetString("cell");
     _job             = dr.GetString("job");
     _familycode      = dr.GetInt32("family_memberid");
     _baptism         = dr.GetString("baptism_name");
     _subdiv          = dr.GetString("SubDivisionName");
     _fellowshipcode  = dr.GetInt32("fellowship_memberid");
     _work            = dr.GetString("work");
     _age             = dr.GetInt32("age");
     _subdivisioncode = dr.GetInt32("subdiv_memberid");
     _status          = dr.GetInt32("statusCode");
     _entrytype       = dr.GetInt32("entrytype");
     _relationship    = (int)dr.GetByte("family_relationship");
     MarkOld();
 }
        private ProductEditDto Fetch(IDataReader data)
        {
            var productEdit = new ProductEditDto();

            using (var dr = new SafeDataReader(data))
            {
                if (dr.Read())
                {
                    productEdit.ProductId      = dr.GetGuid("ProductId");
                    productEdit.ProductCode    = dr.IsDBNull("ProductCode") ? null : dr.GetString("ProductCode");
                    productEdit.Name           = dr.GetString("Name");
                    productEdit.ProductTypeId  = dr.GetInt32("ProductTypeId");
                    productEdit.UnitCost       = dr.GetString("UnitCost");
                    productEdit.StockByteNull  = (byte?)dr.GetValue("StockByteNull");
                    productEdit.StockByte      = dr.GetByte("StockByte");
                    productEdit.StockShortNull = (short?)dr.GetValue("StockShortNull");
                    productEdit.StockShort     = dr.GetInt16("StockShort");
                    productEdit.StockIntNull   = (int?)dr.GetValue("StockIntNull");
                    productEdit.StockInt       = dr.GetInt32("StockInt");
                    productEdit.StockLongNull  = (long?)dr.GetValue("StockLongNull");
                    productEdit.StockLong      = dr.GetInt64("StockLong");
                }
                FetchChildren(dr);
            }
            return(productEdit);
        }
Ejemplo n.º 3
0
 internal MemberInfo(SafeDataReader dr)
 {
     _id        = dr.GetInt32("id");
     _ko_name   = dr.GetString("ko_name");
     _en_name   = dr.GetString("en_name");
     _email     = dr.GetString("email");
     _address   = dr.GetString("address");
     _city      = dr.GetString("city");
     _statecode = dr.GetString("statecode");
     _zipcode   = dr.GetString("zipcode");
     _home      = dr.GetString("home");
     _age       = dr.GetInt32("age");
     if (dr.GetByte("sex") == 0)
     {
         _sex = Resources.Female.ToString();
     }
     else
     {
         _sex = Resources.Male.ToString();
     }
     _cell         = dr.GetString("cell");
     _regdate      = dr.GetSmartDate("regdate");
     _baptismname  = dr.GetString("baptism_name");
     _baptism_year = dr.GetSmartDate("baptism_year");
 }
Ejemplo n.º 4
0
 internal DonateInfo(SafeDataReader dr)
 {
     _id         = dr.GetInt32("no");
     _amount     = dr.GetDecimal("amount");
     _donatetype = dr.GetString("donatetype");
     _donatedate = dr.GetSmartDate("donate_date", _donatedate.EmptyIsMin);
     _paidtype   = dr.GetByte("pay_code").Equals(0)? "Cash":"Check";
     _memo       = dr.GetString("memo");
 }
Ejemplo n.º 5
0
        private InvoiceLineItemDto FetchInvoiceLineItem(SafeDataReader dr)
        {
            var invoiceLineItem = new InvoiceLineItemDto();

            // Value properties
            invoiceLineItem.InvoiceLineId   = dr.GetGuid("InvoiceLineId");
            invoiceLineItem.ProductId       = dr.GetGuid("ProductId");
            invoiceLineItem.Cost            = dr.GetDecimal("Cost");
            invoiceLineItem.PercentDiscount = dr.GetByte("PercentDiscount");

            return(invoiceLineItem);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Loads a <see cref="InvoiceLineItem"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void Child_Fetch(SafeDataReader dr)
        {
            // Value properties
            LoadProperty(InvoiceLineIdProperty, dr.GetGuid("InvoiceLineId"));
            LoadProperty(ProductIdProperty, dr.GetGuid("ProductId"));
            LoadProperty(CostProperty, dr.GetDecimal("Cost"));
            LoadProperty(PercentDiscountProperty, dr.GetByte("PercentDiscount"));
            var args = new DataPortalHookArgs(dr);

            OnFetchRead(args);
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Loads a <see cref="InvoiceLineInfo"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void Child_Fetch(SafeDataReader dr)
        {
            // Value properties
            LoadProperty(InvoiceLineIdProperty, dr.GetGuid("InvoiceLineId"));
            LoadProperty(ProductIdProperty, dr.GetGuid("ProductId"));
            LoadProperty(QuantityProperty, dr.GetInt32("Quantity"));
            LoadProperty(UnitCostProperty, dr.GetDecimal("UnitCost"));
            LoadProperty(CostProperty, dr.GetDecimal("Cost"));
            LoadProperty(PercentDiscountProperty, dr.GetByte("PercentDiscount"));
            var args = new DataPortalHookArgs(dr);

            OnFetchRead(args);
        }
Ejemplo n.º 8
0
        private InvoiceLineInfoDto FetchInvoiceLineInfo(SafeDataReader dr)
        {
            var invoiceLineInfo = new InvoiceLineInfoDto();

            // Value properties
            invoiceLineInfo.InvoiceLineId   = dr.GetGuid("InvoiceLineId");
            invoiceLineInfo.ProductId       = dr.GetGuid("ProductId");
            invoiceLineInfo.Quantity        = dr.GetInt32("Quantity");
            invoiceLineInfo.UnitCost        = dr.GetDecimal("UnitCost");
            invoiceLineInfo.Cost            = dr.GetDecimal("Cost");
            invoiceLineInfo.PercentDiscount = dr.GetByte("PercentDiscount");

            return(invoiceLineInfo);
        }
Ejemplo n.º 9
0
 private void DataPortal_Fetch(Criteria criteria)
 {
     using (SqlConnection cn = new SqlConnection(Database.ConnectionString))
     {
         cn.Open();
         using (SqlCommand cm = cn.CreateCommand())
         {
             cm.CommandType = CommandType.StoredProcedure;
             cm.CommandText = "app_member.member_get";
             cm.Parameters.AddWithValue("@id", criteria.code);
             using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
             {
                 dr.Read();
                 _id             = dr.GetInt32("id");
                 _firstName      = dr.GetString("first_name");
                 _lastName       = dr.GetString("last_name");
                 _enFirstName    = dr.GetString("en_first_name");
                 _enLastName     = dr.GetString("en_last_name");
                 _email          = dr.GetString("email");
                 _cell           = dr.GetString("cell");
                 _addressId      = dr.GetInt32("address_id");
                 _sex            = dr.GetBoolean("sex");
                 _marriage       = dr.GetBoolean("married");
                 _regDate        = dr.GetSmartDate("regdate", _regDate.EmptyIsMin);
                 _statusDate     = dr.GetSmartDate("statuschanged", _statusDate.EmptyIsMin);
                 _status         = dr.GetInt32("statuscode");
                 _familyName     = dr.GetString("familyName");
                 _familyCode     = dr.GetInt32("family_code");
                 _baptismId      = dr.GetInt32("baptism_id");
                 _baptismyear    = dr.GetSmartDate("baptism_year");
                 _birthday       = dr.GetSmartDate("birthday", _birthday.EmptyIsMin);
                 _entrytypeId    = dr.GetInt32("entrytype");
                 _job            = dr.GetString("job");
                 _work           = dr.GetString("work_phone");
                 _cellName       = dr.GetString("cellname");
                 _subDivId       = dr.GetInt32("subdiv_id");
                 _jobtype        = dr.GetInt32("jobtype");
                 _fellowshipName = dr.GetString("fellowshipname");
                 _relationshipId = (int)dr.GetByte("family_relationship");
                 _ministryName   = dr.GetString("ministry");
                 dr.GetBytes("lastChanged", 0, _lastchanged, 0, 8);
             }
         }
         _username = Dothan.ApplicationContext.User.Identity.Name;
     }
 }
        /// <summary>
        /// Loads a <see cref="DocContentInfo"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void Fetch(SafeDataReader dr)
        {
            // Value properties
            LoadProperty(DocContentIDProperty, dr.GetInt32("DocContentID"));
            LoadProperty(DocContentOrderProperty, dr.GetByte("DocContentOrder"));
            LoadProperty(VersionProperty, dr.GetInt16("Version"));
            LoadProperty(FileSizeProperty, dr.GetInt32("FileSize"));
            LoadProperty(FileTypeProperty, dr.GetString("FileType"));
            LoadProperty(CheckInDateProperty, dr.GetSmartDate("CheckInDate", true));
            LoadProperty(CheckInUserIDProperty, dr.GetInt32("CheckInUserID"));
            LoadProperty(CheckInCommentProperty, dr.GetString("CheckInComment"));
            LoadProperty(CheckOutDateProperty, dr.IsDBNull("CheckOutDate") ? null : dr.GetSmartDate("CheckOutDate", true));
            LoadProperty(CheckOutUserIDProperty, (int?)dr.GetValue("CheckOutUserID"));
            var args = new DataPortalHookArgs(dr);

            OnFetchRead(args);
        }
Ejemplo n.º 11
0
 private Donate(SafeDataReader dr)
 {
     MarkAsChild();
     _donateid   = dr.GetInt32("donate_id");
     _name       = dr.GetString("name");
     _memberid   = dr.GetInt32("memberid");
     _id         = dr.GetInt32("no");
     _paidtype   = Convert.ToInt32(dr.GetByte("pay_code"));
     _amount     = dr.GetDecimal("amount");
     _donatecode = dr.GetInt32("donate_code");
     _regdate    = dr.GetSmartDate("donate_date", _regdate.EmptyIsMin);
     _username   = (Dothan.ApplicationContext.User as Dothan.Library.Security.PTPrincipal).UserName;
     dr.GetBytes("lastchanged", 0, _lastchanged, 0, 8);
     _memo  = dr.GetString("memo");//v3.3.4 Display memo
     _idset = true;
     MarkOld();
 }
Ejemplo n.º 12
0
        internal FamilyInfo(SafeDataReader dr)
        {
            _id         = dr.GetInt32("id");
            _first_name = dr.GetString("first_name");
            _last_name  = dr.GetString("last_name");
            _en_first   = dr.GetString("en_first_name");
            _en_last    = dr.GetString("en_last_name");

            _age = dr.GetInt32("age");

            if (dr.GetBoolean("sex"))
            {
                _sex = Resources.Male.ToString();
            }
            else
            {
                _sex = Resources.Female.ToString();
            }

            if (dr.GetBoolean("married"))
            {
                _marrige = Resources.Married;
            }
            else
            {
                _marrige = Resources.Single;
            }

            _relastionship     = dr.GetString("relationship");
            _relastionshipcode = (int)dr.GetByte("family_relationship");
            _baptismname       = dr.GetString("baptismName");

            _subdivision = dr.GetString("SubDivisionName");
            _familycode  = dr.GetInt32("family_code");
            _statusname  = dr.GetString("StatusName");
            if (dr.GetBoolean("active"))
            {
                _active = Resources.Active;
            }
            else
            {
                _active = Resources.InActive;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Loads a <see cref="ProductInfo"/> object from the given SafeDataReader.
        /// </summary>
        /// <param name="dr">The SafeDataReader to use.</param>
        private void Child_Fetch(SafeDataReader dr)
        {
            // Value properties
            LoadProperty(ProductIdProperty, dr.GetGuid("ProductId"));
            LoadProperty(ProductCodeProperty, dr.IsDBNull("ProductCode") ? null : dr.GetString("ProductCode"));
            LoadProperty(NameProperty, dr.GetString("Name"));
            LoadProperty(ProductTypeIdProperty, dr.GetInt32("ProductTypeId"));
            LoadProperty(UnitCostProperty, dr.GetString("UnitCost"));
            LoadProperty(StockByteNullProperty, (byte?)dr.GetValue("StockByteNull"));
            LoadProperty(StockByteProperty, dr.GetByte("StockByte"));
            LoadProperty(StockShortNullProperty, (short?)dr.GetValue("StockShortNull"));
            LoadProperty(StockShortProperty, dr.GetInt16("StockShort"));
            LoadProperty(StockIntNullProperty, (int?)dr.GetValue("StockIntNull"));
            LoadProperty(StockIntProperty, dr.GetInt32("StockInt"));
            LoadProperty(StockLongNullProperty, (long?)dr.GetValue("StockLongNull"));
            LoadProperty(StockLongProperty, dr.GetInt64("StockLong"));
            var args = new DataPortalHookArgs(dr);

            OnFetchRead(args);
        }
Ejemplo n.º 14
0
        private ProductInfoDto Fetch(SafeDataReader dr)
        {
            var productInfo = new ProductInfoDto();

            // Value properties
            productInfo.ProductId      = dr.GetGuid("ProductId");
            productInfo.ProductCode    = dr.IsDBNull("ProductCode") ? null : dr.GetString("ProductCode");
            productInfo.Name           = dr.GetString("Name");
            productInfo.ProductTypeId  = dr.GetInt32("ProductTypeId");
            productInfo.UnitCost       = dr.GetString("UnitCost");
            productInfo.StockByteNull  = (byte?)dr.GetValue("StockByteNull");
            productInfo.StockByte      = dr.GetByte("StockByte");
            productInfo.StockShortNull = (short?)dr.GetValue("StockShortNull");
            productInfo.StockShort     = dr.GetInt16("StockShort");
            productInfo.StockIntNull   = (int?)dr.GetValue("StockIntNull");
            productInfo.StockInt       = dr.GetInt32("StockInt");
            productInfo.StockLongNull  = (long?)dr.GetValue("StockLongNull");
            productInfo.StockLong      = dr.GetInt64("StockLong");

            return(productInfo);
        }
Ejemplo n.º 15
0
 private void DataPortal_Fetch(Criteria criteria)
 {
     using (SqlConnection cn = new SqlConnection(Database.ConnectionString))
     {
         cn.Open();
         using (SqlCommand cm = cn.CreateCommand())
         {
             cm.CommandType = CommandType.StoredProcedure;
             cm.CommandText = "GetMemberInfo";
             cm.Parameters.AddWithValue("@code", criteria.code);
             using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
             {
                 dr.Read();
                 _id        = dr.GetInt32("id");
                 _ko_name   = dr.GetString("ko_name");
                 _en_name   = dr.GetString("en_name");
                 _email     = dr.GetString("email");
                 _address   = dr.GetString("address");
                 _city      = dr.GetString("city");
                 _statecode = dr.GetString("statecode");
                 _zipcode   = dr.GetString("zipcode");
                 _home      = dr.GetString("home");
                 _age       = dr.GetInt32("age");
                 if (dr.GetByte("sex") == 0)
                 {
                     _sex = Resources.Female.ToString();
                 }
                 else
                 {
                     _sex = Resources.Male.ToString();
                 }
                 _cell         = dr.GetString("cell");
                 _regdate      = dr.GetSmartDate("regdate");
                 _baptismname  = dr.GetString("baptism_name");
                 _baptism_year = dr.GetSmartDate("baptism_year");
             }
         }
     }
 }