private OrderLookupListInfo GetOrderLookupList() { OrderLookupListInfo orderLookupListInfo = new OrderLookupListInfo(); orderLookupListInfo.Name = txtListName.Text.Trim(); orderLookupListInfo.SelectMode = dropSelectMode.SelectedValue; orderLookupListInfo.Description = txtDescription.Text.Trim(); return orderLookupListInfo; }
private bool ValidationOrderLookupList(OrderLookupListInfo lookupList) { ValidationResults results = Hishop.Components.Validation.Validation.Validate<OrderLookupListInfo>(lookupList, new string[] { "ValOrderLookupListInfo" }); string msg = string.Empty; if (!results.IsValid) { foreach (ValidationResult result in (IEnumerable<ValidationResult>)results) { msg = msg + Formatter.FormatErrorMessage(result.Message); } ShowMsg(msg, false); } return results.IsValid; }
public static OrderLookupListInfo PopulateOrderLookupList(IDataRecord reader) { if (null == reader) { return null; } OrderLookupListInfo info = new OrderLookupListInfo(); info.Name = (string) reader["Name"]; info.LookupListId = (int) reader["LookupListId"]; info.SelectMode = (SelectModeTypes) reader["SelectMode"]; if (DBNull.Value != reader["Description"]) { info.Description = (string) reader["Description"]; } return info; }
public static bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList) { Globals.EntityCoding(orderLookupList, true); return SalesProvider.Instance().UpdateOrderLookupList(orderLookupList); }
public override int AddOrderLookupList(OrderLookupListInfo orderLookupList) { DbCommand sqlStringCommand = database.GetSqlStringCommand("INSERT INTO Hishop_OrderLookupLists([Name],SelectMode,Description)VALUES(@Name,@SelectMode,@Description); SELECT @@IDENTITY"); database.AddInParameter(sqlStringCommand, "Name", DbType.String, orderLookupList.Name); database.AddInParameter(sqlStringCommand, "SelectMode", DbType.Int32, orderLookupList.SelectMode); database.AddInParameter(sqlStringCommand, "Description", DbType.String, orderLookupList.Description); object ret = database.ExecuteScalar(sqlStringCommand); if (ret != null) { return Convert.ToInt32(ret); } return 0; }
public override bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList) { DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_OrderLookupLists Set [Name]= @Name,SelectMode = @SelectMode,Description = @Description WHERE LookupListId = @LookupListId"); database.AddInParameter(sqlStringCommand, "Name", DbType.String, orderLookupList.Name); database.AddInParameter(sqlStringCommand, "SelectMode", DbType.Int32, orderLookupList.SelectMode); database.AddInParameter(sqlStringCommand, "Description", DbType.String, orderLookupList.Description); database.AddInParameter(sqlStringCommand, "LookupListId", DbType.Int32, orderLookupList.LookupListId); return (database.ExecuteNonQuery(sqlStringCommand) > 0); }
public override IList<OrderLookupListInfo> GetOrderLookupLists() { IList<OrderLookupListInfo> list = new List<OrderLookupListInfo>(); DbCommand sqlStringCommand = database.GetSqlStringCommand("SELECT * FROM Hishop_OrderLookupLists"); using (IDataReader reader = database.ExecuteReader(sqlStringCommand)) { while (reader.Read()) { OrderLookupListInfo item = new OrderLookupListInfo(); item.Name = (string)reader["Name"]; item.LookupListId = (int)reader["LookupListId"]; item.SelectMode = (SelectModeTypes)reader["SelectMode"]; if (DBNull.Value != reader["Description"]) { item.Description = (string)reader["Description"]; } list.Add(item); } } return list; }
public abstract int AddOrderLookupList(OrderLookupListInfo orderLookupList);
public abstract bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList);