コード例 #1
0
        /// <summary>
        /// ParameterProvider is the resource with
        /// parameters for stored procedure
        /// Ettension!!!! 
        /// Parameter names must be the same like
        /// stored procedure parameter name other wise
        /// you will get some error 
        /// 
        /// </summary>  

        public static List<ParameterItem> GetParameterListForSelectDairyListItem(DairyListItem dairyItem)
        {
            List<ParameterItem> parameterList = new List<ParameterItem>();

            if (dairyItem == null)
            {
                throw new Exception("GetParameterListForSelectDairyListItem(DairyListItem dairyItem) input parameter can't be null");
            }

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "ItemID",
                ParameterValue = dairyItem.ItemID
            });

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "PriorityID",
                ParameterValue = dairyItem.PriorityID
            });

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "StatusID",
                ParameterValue = dairyItem.StatusID
            });

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "DateID",
                ParameterValue = dairyItem.DateID
            });

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "ItemTitle",
                ParameterValue = dairyItem.ItemTitle
            });

            parameterList.Add(new ParameterItem()
            {
                ParameterName = "ItemContent",
                ParameterValue = dairyItem.ItemContent
            });

            return parameterList;
        }
コード例 #2
0
 public static object[] GetParameterListForSelectDairyListItem(DairyListItem dairyItem)
 {
     if (dairyItem!=null)
     {
        return new object[]{
            new ParameterItem()
                {
                    ParameterName = @"ItemID",
                    ParameterValue = dairyItem.ItemID
                },
            new ParameterItem()
                {
                    ParameterName = @"PriorityID",
                    ParameterValue = dairyItem.PriorityID
                },
            new ParameterItem()
                {
                    ParameterName = @"StatusID",
                    ParameterValue = dairyItem.StatusID
                },
            new ParameterItem()
                {
                    ParameterName = @"DateID",
                    ParameterValue = dairyItem.DateID
                },
            new ParameterItem()
                {
                    ParameterName = @"ItemTitle",
                    ParameterValue = dairyItem.ItemTitle
                },
            new ParameterItem()
                {
                    ParameterName = @"ItemContent",
                    ParameterValue = dairyItem.ItemContent
                }
        };
     }
     
     return  new object[]{
            new ParameterItem()
                {
                    ParameterName = @"ItemID",
                    ParameterValue = 0
                },
            new ParameterItem()
                {
                    ParameterName = @"PriorityID",
                    ParameterValue = 0
                },
            new ParameterItem()
                {
                    ParameterName = @"StatusID",
                    ParameterValue = 0
                },
            new ParameterItem()
                {
                    ParameterName = @"DateID",
                    ParameterValue = 0
                },
            new ParameterItem()
                {
                    ParameterName = @"ItemTitle",
                    ParameterValue = "none"
                },
            new ParameterItem()
                {
                    ParameterName = @"ItemContent",
                    ParameterValue = "none"
                }
        };
 }