public void AddEvent(int recordId, int eventId)
        {
            var parameters = new List <SqlParameter>
            {
                helper.CreateParameter("@RecordId", recordId, DbType.Int32),
                helper.CreateParameter("@EventId", eventId, DbType.Int32)
            };

            helper.Insert("CreateRecordEventRelation", CommandType.StoredProcedure, parameters.ToArray());
        }
        public void Create(Picture item)
        {
            var parameters = new List <SqlParameter>
            {
                helper.CreateParameter("@Path", item.Path, DbType.String)
            };

            helper.Insert("CreatePicture", CommandType.StoredProcedure, parameters.ToArray());
        }
        public void Create(Email item)
        {
            var parameters = new List <SqlParameter>
            {
                helper.CreateParameter("@Adress", item.Address, DbType.String)
            };

            helper.Insert("CreateEmail", CommandType.StoredProcedure, parameters.ToArray());
        }
        public void Create(Category item)
        {
            var parameters = new List <SqlParameter>
            {
                helper.CreateParameter("@Name", item.Name, DbType.String)
            };

            helper.Insert("CreateCategory", CommandType.StoredProcedure, parameters.ToArray());
        }
        public void Create(User item)
        {
            var parameters = new SqlParameter[]
            {
                helper.CreateParameter("@Name", item.Name, DbType.String),
                helper.CreateParameter("@Password", item.Password, DbType.String),
                helper.CreateParameter("@RoleId", item.RoleId, DbType.Int32),
                helper.CreateParameter("@EmailId", item.EmailId, DbType.Int32)
            };

            helper.Insert("CreateUser", CommandType.StoredProcedure, parameters);
        }
Example #6
0
        static void Main(string[] args)
        {
            try
            {
                #region 1.0 特性封装
                Console.WriteLine("*************特性封装********************");
                string strAndroid = MobileEnum.Android.GetRemark();
                string strIOS     = MobileEnum.IOS.GetRemark();

                Console.WriteLine($"android备注:{strAndroid},ios的备注{strIOS}");
                #endregion


                #region 2.0 封装方法
                Console.WriteLine("*************Unity 使用********************");
                //初始化unity
                IOCFactory.InitContainer();

                Person person = new Person();
                person.Address = "哈哈哈11111111";
                person.Name    = "dark";
                person.Email   = "*****@*****.**";
                person.Phone   = "18652428020";

                ISQLHelper sqlHelper = IOCFactory.Resolve <ISQLHelper>();
                sqlHelper.Insert <Person>(person);

                #endregion
            }
            catch (Exception ex)
            {
                Console.WriteLine($"系统异常:{ex.Message.ToString()}");
                throw;
            }

            Console.ReadLine();
        }