/// <summary> /// 新增共享 /// </summary> /// <param name="gxEntity">共享实体</param> /// <param name="userId">共享用户ID</param> public void AddGx(GxEntity gxEntity,int userId) { try { GxEntity gxEntityResult = AllGxmxById(userId); foreach (var user in gxEntity.UserList) { AddFriend(user, userId.ToString()); foreach (var file in gxEntity.FileList) { if (ZyhValidate(user, file, gxEntityResult)) continue; var zyhgx = new gxgl_zyhgx { file_id = file, user_id = Convert.ToInt32(user), gx_ly = userId, gx_sj = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), gx_isread = "否" }; zyhGxFilesDB.gxgl_zyhgx.InsertOnSubmit(zyhgx); zyhGxFilesDB.SubmitChanges(); } } foreach (var fsyh in gxEntity.FsyhList) { foreach (var file in gxEntity.FileList) { if (FsyhValidate(fsyh, file, gxEntityResult)) continue; var fsyhgx = new gxgl_fsyhgxb { file_id = file, fsyh_id = Convert.ToInt32(fsyh), fsyhgx_ly = userId, fsyhgx_sj = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") }; fsyhGxFilesDB.gxgl_fsyhgxb.InsertOnSubmit(fsyhgx); fsyhGxFilesDB.SubmitChanges(); } } } catch (Exception e) { throw e; } }
partial void Updategxgl_zyhgx(gxgl_zyhgx instance);
partial void Deletegxgl_zyhgx(gxgl_zyhgx instance);
partial void Insertgxgl_zyhgx(gxgl_zyhgx instance);