public int ChangeState(Attachment attach, int state) { using (var context = new WSI.DataAccess.WSICmsContext()) { context.Attachments.Attach(attach); attach.State = state; context.LogChangesDuringSave = true; return context.SaveChanges(); } }
protected void Page_Load(object sender, EventArgs e) { if (attid != "") { attach = service.GetDetail(attid); } if (!IsPostBack) { txtDesc.Text = attach.Description; txtSortIndex.Text = attach.SortIndex.ToString(); } }