protected override void SaveToRow() { SummitDS.MarketingUsersDataTable _thisTable = new SummitDS.MarketingUsersDataTable(); if (_rowToSave == null) { _rowToSave = _thisTable.NewMarketingUsersRow(); } SummitDS.MarketingUsersRow _dataRow = _rowToSave as SummitDS.MarketingUsersRow; if (_dataRow != null) { if (IsExisting()) { if (bisShowInProcess.HasValue) { _dataRow.isShowInProcess = bisShowInProcess.Value; } else { _dataRow.SetisShowInProcessNull(); } if (iContactMethod.HasValue) { _dataRow.contactMethod = iContactMethod.Value; } else { _dataRow.SetcontactMethodNull(); } // throw new DataException("Record Already Existed."); } else { _dataRow.user_id = iUserId; _dataRow.shop_id = iShopId; _dataRow.vehicle_id = iVehicleId; if (bisShowInProcess.HasValue) { _dataRow.isShowInProcess = bisShowInProcess.Value; } else { _dataRow.SetisShowInProcessNull(); } if (iContactMethod.HasValue) { _dataRow.contactMethod = iContactMethod.Value; } else { _dataRow.SetcontactMethodNull(); } _thisTable.AddMarketingUsersRow(_dataRow); } } }
public static MarketingUsers getDataByShopUserAndVehicleId(Int32 iShopId, Int32 iUserId, Int32 iVehicleId) { SummitDS.MarketingUsersDataTable thisTable = new SummitDS.MarketingUsersDataTable(); thisTable = getAdapter().GetDataByShopUserAndVehicleId(iShopId, iUserId, iVehicleId); MarketingUsers objMarketingUser = null; if (thisTable.Rows.Count > 0) { objMarketingUser = BuildFromRow(thisTable.Rows[0]); return(objMarketingUser); } return(objMarketingUser); }
protected override bool IsExisting() { SummitDS.MarketingUsersDataTable thisTable = new SummitDS.MarketingUsersDataTable(); thisTable = getAdapter().GetDataByShopUserAndVehicleId(this.iShopId, this.iUserId, this.iVehicleId); if (thisTable.Rows.Count > 0) { return(true); } else { return(false); } }
public static Boolean isInProcess(Int32 iShopId, Int32 iUserId, Int32 iVehicleId) { SummitDS.MarketingUsersDataTable thisTable = new SummitDS.MarketingUsersDataTable(); thisTable = getAdapter().GetDataByShopUserAndVehicleId(iShopId, iUserId, iVehicleId); MarketingUsers objMarketingUser = null; if (thisTable.Rows.Count > 0) { objMarketingUser = BuildFromRow(thisTable.Rows[0]); if (objMarketingUser.bisShowInProcess != null && objMarketingUser.bisShowInProcess == true) { return(true); } } return(false); }
public static List <UserBL> getUsersByShopId(Int32 iShopId) { SummitDS.MarketingUsersDataTable thisTable = getAdapter().GetDataByShopId(iShopId); List <UserBL> lstUsers = new List <UserBL>(); if (thisTable != null && thisTable.Rows.Count > 0) { List <MarketingUsers> lstMarketingUsers = BuildFromTable(thisTable); if (lstMarketingUsers != null) { foreach (MarketingUsers marketingUsers in lstMarketingUsers) { UserBL objUser = UserBL.getByActivityId(marketingUsers.iUserId); if (objUser != null) { lstUsers.Add(objUser); } } } } return(lstUsers); }
public static Boolean isInEmailMarketing(Int32 iShopId, Int32 iUserId, Int32 iVehicleId) { SummitDS.MarketingUsersDataTable thisTable = new SummitDS.MarketingUsersDataTable(); UserBL objUser = UserBL.getByActivityId(iUserId); if (objUser != null) { if (objUser.bIsShowEmailMarketing != null && objUser.bIsShowEmailMarketing == true) { thisTable = getAdapter().GetDataByShopUserAndVehicleId(iShopId, iUserId, iVehicleId); MarketingUsers objMarketingUser = null; if (thisTable.Rows.Count > 0) { objMarketingUser = BuildFromRow(thisTable.Rows[0]); if (objMarketingUser != null) { return(true); } } } } return(false); }