public int AddShare(Jw_share js, List <Jw_share_file> list) { try { ins.AddShare(js); foreach (var item in list) { ins.AddShareFile(item); } return(1); } catch (Exception) { return(-1); throw; } }
public ActionResult AddShare(string usersid, string filepath) { string schoolid = StorageHelper.Cookie.GetCookieValue("User", "sguid");//通过cookie获取 JavaScriptSerializer jss = new JavaScriptSerializer(); List <string> uslist = jss.Deserialize <List <string> >(usersid); List <string> fplist = jss.Deserialize <List <string> >(filepath); string us = ""; foreach (var item in uslist) { us += item + ","; } Jw_share js = new Jw_share(); js.Jw_ShareId = Guid.NewGuid().ToString(); js.Jw_schoolid = schoolid; js.Jw_UserId = StorageHelper.Cookie.GetCookieValue("User", "uguid"); js.Jw_UsersId = us.Substring(0, us.Length - 1); js.Jw_CreateTime = DateTime.Now; js.Jw_DelFlag = 0; js.Jw_ShareType = 1; List <Jw_share_file> jsfList = new List <Jw_share_file>(); foreach (var item in fplist) { Jw_share_file jsf = new Jw_share_file(); jsf.Jw_shareid = js.Jw_ShareId; jsf.Jw_filepath = item; jsf.Jw_filestatus = 0; jsfList.Add(jsf); } Utilities.ConvertJson c = new Utilities.ConvertJson(); if (sharebll.AddShare(js, jsfList) > 0) { string a = c.ToJson("200", "", "{}"); return(Content(a)); } return(Content(c.ToJson("0", "", "{}"))); }
public int AddShare(Jw_share js) { string sql = _cb.InsertModel <Jw_share>(js); return(db.ExecuteNonQuery(sql)); }
public bool UpdateShare(Jw_share js) { return(up.UpdateShareDel(js)); }