Ejemplo n.º 1
0
 private OrderLookupListInfo GetOrderLookupList()
 {
     OrderLookupListInfo orderLookupListInfo = new OrderLookupListInfo();
     orderLookupListInfo.Name = txtListName.Text.Trim();
     orderLookupListInfo.SelectMode = dropSelectMode.SelectedValue;
     orderLookupListInfo.Description = txtDescription.Text.Trim();
     return orderLookupListInfo;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 public static bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList)
 {
     Globals.EntityCoding(orderLookupList, true);
     return SalesProvider.Instance().UpdateOrderLookupList(orderLookupList);
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 8
0
 public abstract int AddOrderLookupList(OrderLookupListInfo orderLookupList);
Ejemplo n.º 9
0
 public abstract bool UpdateOrderLookupList(OrderLookupListInfo orderLookupList);