Esempio n. 1
0
        public static UserPreferredShopBL getShopByUserId(Int32 iUserId)
        {
            SummitDS.User_PreferredShopDataTable thisTable = getAdapter().GetDataByUserId(iUserId);
            if (thisTable != null && thisTable.Rows.Count > 0)
            {
                return(BuildFromRow(thisTable.Rows[0]));
            }

            return(null);
        }
Esempio n. 2
0
        protected override void SaveToRow()
        {
            SummitDS.User_PreferredShopDataTable _thisTable = new SummitDS.User_PreferredShopDataTable();
            if (_rowToSave == null)
            {
                _rowToSave = _thisTable.NewUser_PreferredShopRow();
            }
            SummitDS.User_PreferredShopRow _dataRow = _rowToSave as SummitDS.User_PreferredShopRow;

            if (_dataRow != null)
            {
                if (IsExisting())
                {
                    if (iShopId.HasValue)
                    {
                        _dataRow.shop_id = iShopId.Value;
                    }
                    else
                    {
                        _dataRow.Setshop_idNull();
                    }

                    if (iUserId.HasValue)
                    {
                        _dataRow.user_id = iUserId.Value;
                    }
                    else
                    {
                        _dataRow.Setuser_idNull();
                    }
                }
                else
                {
                    if (iShopId.HasValue)
                    {
                        _dataRow.shop_id = iShopId.Value;
                    }
                    else
                    {
                        _dataRow.Setshop_idNull();
                    }

                    if (iUserId.HasValue)
                    {
                        _dataRow.user_id = iUserId.Value;
                    }
                    else
                    {
                        _dataRow.Setuser_idNull();
                    }

                    _thisTable.AddUser_PreferredShopRow(_dataRow);
                }
            }
        }