public async Task <DLType> AddDLTypeAsync(DLType dLType) { _uow.DLTypes.Add(dLType); await _uow.SaveChangesAsync().ConfigureAwait(false); return(dLType); }
public async Task <DLType> UpdateDLTypeAsync(DLType dLType) { // _uow.DLs.Attach(); // await _uow.SaveChangesAsync().ConfigureAwait(false); _uow.Entry(dLType).State = EntityState.Modified; await _uow.SaveChangesAsync().ConfigureAwait(false); return(dLType); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { SqlCommand cmd = new SqlCommand("SELECT * FROM [Usertype]", con); con.Open(); DLType.DataTextField = "TypeName"; DLType.DataValueField = "TypeID"; DLType.DataSource = cmd.ExecuteReader(); DLType.DataBind(); ListItem li = new ListItem("选一个账户类型", "-1"); DLType.Items.Insert(0, li); } //string jsondata = "{\"msg\":\"aname\"}"; //Response.Write(jsondata); //Response.End(); } }