Exemplo n.º 1
0
        public override int InsertIdentityId(UserCodeInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = INSERT + "; select @@Identity";

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Name", Value = ParameterHelper.ConvertValue(m.Name)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserId", Value = ParameterHelper.ConvertValue(m.UserId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@TypeId", Value = ParameterHelper.ConvertValue(m.TypeId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CodeContent", Value = ParameterHelper.ConvertValue(m.CodeContent)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CreateDate", Value = ParameterHelper.ConvertValue(m.CreateDate)
            });


            var result = DbProxyFactory.Instance.Proxy.ExecuteScalar(command);

            return(int.Parse(result.ToString()));
        }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            UserCodeInfoVO info = new UserCodeInfoVO();

            info.UserId      = Account.UserId;
            info.CreateDate  = DateTime.Now;
            info.TypeId      = int.Parse(ddlType.SelectedValue);
            info.CodeContent = hidContent.Value;
            info.Name        = txtName.Text;
            UserCodeInfoBLL.Instance.Add(info);
            Response.Redirect("/Accounts/Pages/UserCodeList.aspx");
        }
Exemplo n.º 3
0
        public override bool Edit(UserCodeInfoVO m)
        {
            CodeCommand command = new CodeCommand();

            command.CommandText = EDIT;

            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Name", Value = ParameterHelper.ConvertValue(m.Name)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@UserId", Value = ParameterHelper.ConvertValue(m.UserId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@TypeId", Value = ParameterHelper.ConvertValue(m.TypeId)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CodeContent", Value = ParameterHelper.ConvertValue(m.CodeContent)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@CreateDate", Value = ParameterHelper.ConvertValue(m.CreateDate)
            });
            command.Parameters.Add(new SqlParameter()
            {
                ParameterName = "@Id", Value = ParameterHelper.ConvertValue(m.Id)
            });


            int result = DbProxyFactory.Instance.Proxy.ExecuteNonQuery(command);

            if (result >= 1)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
 public override string GetOtherConditionByModel(UserCodeInfoVO m)
 {
     return("");
 }
Exemplo n.º 5
0
 public override string GetOrderByModel(UserCodeInfoVO m)
 {
     return("");
 }