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())); }
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"); }
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); }
public override string GetOtherConditionByModel(UserCodeInfoVO m) { return(""); }
public override string GetOrderByModel(UserCodeInfoVO m) { return(""); }