Esempio n. 1
0
        public bool ConvertToDataRow(ref System.Data.DataRow row)
        {
            try
            {
                BizBase.SetValue(row, "SupplierId", this.SupplierId);

                BizBase.SetValue(row, "PositionNo", this.PositionNo);

                BizBase.SetValue(row, "Material", this.Material);
                BizBase.SetValue(row, "Category", this.Category);
                BizBase.SetValue(row, "Manufacturer", this.Manufacturer);

                BizBase.SetValue(row, "PriceMin", this.PriceMin);
                BizBase.SetValue(row, "PriceMax", this.PriceMax);

                BizBase.SetValue(row, "SoldFor", this.SoldFor);
                BizBase.SetValue(row, "SoldAt", this.SoldAt);

                BizBase.SetValue(row, "ReturnedToSupplierAt", this.ReturnedToSupplierAt);

                BizBase.SetValue(row, "Memo", this.Memo);

                BizBase.SetValue(row, "LastChange", this.LastChange);

                return(true);
            }
            catch (Exception)
            {
                // ignored
            }
            return(false);
        }
Esempio n. 2
0
        public static BizSupplierer ConvertFromDataRow(System.Data.DataRow row)
        {
            var _result = new BizSupplierer();

            try
            {
                _result.SupplierId = BizBase.ToGuid(row["Id"]);

                _result.SupplierNo = BizBase.ToInt32(row["SupplierNo"]) ?? 0;

                _result.Salutation = BizBase.ToString(row["Salutation"]);
                _result.LastName   = BizBase.ToString(row["LastName"]);
                _result.FirstName  = BizBase.ToString(row["FirstName"]);

                _result.Adress  = BizBase.ToString(row["Adress"]);
                _result.ZipCode = BizBase.ToString(row["ZIPCode"]);
                _result.Town    = BizBase.ToString(row["Town"]);

                _result.Phone01 = BizBase.ToString(row["Phone01"]);
                _result.EMail01 = BizBase.ToString(row["EMail01"]);

                _result.ReturnedToSupplier = BizBase.ToDateTime(row["ReturnedToSupplier"]);
            }
            catch (Exception)
            {
                _result = null;
            }

            return(_result);
        }
Esempio n. 3
0
        public bool ConvertToDataRow(ref System.Data.DataRow row)
        {
            try
            {
                BizBase.SetValue(row, "Id", this.SupplierId);

                BizBase.SetValue(row, "SupplierNo", this.SupplierNo);

                BizBase.SetValue(row, "Salutation", this.Salutation);
                BizBase.SetValue(row, "LastName", this.LastName);
                BizBase.SetValue(row, "FirstName", this.FirstName);

                BizBase.SetValue(row, "Adress", this.Adress);
                BizBase.SetValue(row, "ZIPCode", this.ZipCode);
                BizBase.SetValue(row, "Town", this.Town);

                BizBase.SetValue(row, "Phone01", this.Phone01);
                BizBase.SetValue(row, "EMail01", this.EMail01);

                BizBase.SetValue(row, "Memo", this.Memo);

                BizBase.SetValue(row, "ReturnedToSupplier", this.ReturnedToSupplier);

                return(true);
            }
            catch (Exception)
            {
                // ignored
            }
            return(false);
        }
Esempio n. 4
0
        //[DataContract]
        //public enum BizStates
        //{
        //    [EnumMember]
        //    none,
        //    [EnumMember]
        //    MarkedNew,
        //    [EnumMember]
        //    MarkedEdit,
        //    [EnumMember]
        //    MarkedDelete,
        //}

        //[DataMember]
        //public BizStates State = BizStates.none;


        public static Guid?ToGuid(object value)
        {
            try
            {
                return(new Guid(BizBase.ToString(value)));
            }
            catch
            {
                // ignored
            }
            return(null);
        }
Esempio n. 5
0
        public bool ConvertToDataRow(ref System.Data.DataRow row)
        {
            try
            {
                BizBase.SetValue(row, "Id", this.Id);

                BizBase.SetValue(row, "Designation", this.Designation);

                return(true);
            }
            catch (Exception)
            {
                // ignored
            }
            return(false);
        }
Esempio n. 6
0
        public static BizManufacturer ConvertFromDataRow(System.Data.DataRow row)
        {
            var _result = new BizManufacturer();

            try
            {
                _result.Id = BizBase.ToGuid(row["Id"]);

                _result.Designation = BizBase.ToString(row["Designation"]);
            }
            catch (Exception)
            {
                _result = null;
            }

            return(_result);
        }
Esempio n. 7
0
        public static BizPosition ConvertFromDataRow(System.Data.DataRow row)
        {
            BizPosition _result = null;

            if (row != null)
            {
                _result = new BizPosition();

                try
                {
                    _result.SupplierId = BizBase.ToGuid(row["SupplierId"]) ?? Guid.Empty;

                    _result.PositionNo = BizBase.ToInt32(row["PositionNo"]) ?? 0;

                    _result.Material     = BizBase.ToString(row["Material"]);
                    _result.Category     = BizBase.ToString(row["Category"]);
                    _result.Manufacturer = BizBase.ToString(row["Manufacturer"]);

                    _result.PriceMin = BizBase.ToDouble(row["PriceMin"]);
                    _result.PriceMax = BizBase.ToDouble(row["PriceMax"]) ?? 0;

                    _result.SoldFor = BizBase.ToDouble(row["SoldFor"]);
                    _result.SoldAt  = BizBase.ToDateTime(row["SoldAt"]);

                    _result.ReturnedToSupplierAt = BizBase.ToDateTime(row["ReturnedToSupplierAt"]);

                    _result.Memo = BizBase.ToString(row["Memo"]);

                    _result.LastChange = BizBase.ToDateTime(row["LastChange"]);
                }
                catch (Exception)
                {
                    _result = null;
                }
            }

            return(_result);
        }