public VideoStorage GetVideoInfoBySN(string sn) { ResourceService rs = new ResourceService(); VideoStorage v = null; DataSet ds = rs.GetResourceInfoBySN(sn); if (ds.Tables[0].Rows.Count > 0) { v = new VideoStorage(); DataRow dr = ds.Tables[0].Rows[0]; v.Bitrate = string.Empty; v.ClipLength = string.Empty; v.ClipSize = string.Empty; if (ds.Tables[0].Columns.Contains("bitrate")) { v.Bitrate = dr["bitrate"].ToString(); } if (ds.Tables[0].Columns.Contains("ClipLength")) { v.ClipLength = dr["ClipLength"].ToString(); } if (ds.Tables[0].Columns.Contains("ClipSize")) { v.ClipSize = dr["ClipSize"].ToString(); } } return(v); }
public VideoStorage GetVideoInfo(string itemid) { VideoStorage v = new VideoStorage(); VideoStorageService vss = new VideoStorageService(); DataSet ds = vss.GetVideoInfo(itemid); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; v.Caption = dr["caption"].ToString(); v.ItemSerialNum= dr["itemserialnumber"].ToString(); v.FileName= dr["clientfilename"].ToString(); v.FolderName= dr["ServerFolderName"].ToString(); v.ServerFileName= dr["serverfilename"].ToString(); //v.FlvFilename= dr["flvfilename"].ToString(); //v.FlvFilePath= dr["flvfilepath"].ToString(); v.StartDate= Convert.ToDateTime(dr["startdate"]); v.EndDate = Convert.ToDateTime(dr["EndDate"]); v.uploadDate = Convert.ToDateTime(dr["uploadDate"]); v.shotDate = Convert.ToDateTime(dr["shotDate"]); v.Keyword = dr["Keywords"].ToString(); v.Description = dr["Description"].ToString(); v.updateDate = Convert.ToDateTime(dr["updatedate"]); v.userId= new Guid(dr["userid"].ToString()); v.Status = Convert.ToInt32(dr["status"].ToString()); v.ItemId = new Guid(dr["id"].ToString()); v.FileSize = Convert.ToInt64(dr["FileSize"]); } return v; }
public VideoStorage GetVideoInfo(string itemid) { VideoStorage v = new VideoStorage(); VideoStorageService vss = new VideoStorageService(); DataSet ds = vss.GetVideoInfo(itemid); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; v.Caption = dr["caption"].ToString(); v.ItemSerialNum = dr["itemserialnumber"].ToString(); v.FileName = dr["clientfilename"].ToString(); v.FolderName = dr["ServerFolderName"].ToString(); v.ServerFileName = dr["serverfilename"].ToString(); //v.FlvFilename= dr["flvfilename"].ToString(); //v.FlvFilePath= dr["flvfilepath"].ToString(); v.StartDate = Convert.ToDateTime(dr["startdate"]); v.EndDate = Convert.ToDateTime(dr["EndDate"]); v.uploadDate = Convert.ToDateTime(dr["uploadDate"]); v.shotDate = Convert.ToDateTime(dr["shotDate"]); v.Keyword = dr["Keywords"].ToString(); v.Description = dr["Description"].ToString(); v.updateDate = Convert.ToDateTime(dr["updatedate"]); v.userId = new Guid(dr["userid"].ToString()); v.Status = Convert.ToInt32(dr["status"].ToString()); v.ItemId = new Guid(dr["id"].ToString()); v.FileSize = Convert.ToInt64(dr["FileSize"]); } return(v); }
/// <summary> /// 根据关键字搜索图片 /// 获取 ItemSerialNum,Hvsp 属性值 /// </summary> /// <returns></returns> public bool Add(VideoStorage v) { VideoStorageService vss = new VideoStorageService(); return vss.AddVideo(v.ItemId,v.ItemSerialNum,v.FileName, v.FolderName,v.ServerFileName,v.FlvFilename, v.FlvFilePath, v.Caption, v.StartDate, v.EndDate, v.uploadDate, v.shotDate, v.Keyword, v.Description, v.updateDate, v.userId, v.Status ); }
/// <summary> /// 根据关键字搜索图片 /// 获取 ItemSerialNum,Hvsp 属性值 /// </summary> /// <returns></returns> public bool Add(VideoStorage v) { VideoStorageService vss = new VideoStorageService(); return(vss.AddVideo(v.ItemId, v.ItemSerialNum, v.FileName, v.FolderName, v.ServerFileName, v.FlvFilename, v.FlvFilePath, v.Caption, v.StartDate, v.EndDate, v.uploadDate, v.shotDate, v.Keyword, v.Description, v.updateDate, v.userId, v.Status )); }
protected void btnUpload_ServerClick(object sender, EventArgs e) { if (this.t_Date.Text.Trim() == string.Empty) { this.ShowMessage(this, "请选择时间"); return; } else { if (Convert.ToDateTime(this.t_Date.Text) > DateTime.Now) { this.ShowMessage(this, "拍摄时间应比现在早"); return; } } //验证日期 DateTime sDate = new DateTime(); DateTime eDate = new DateTime(); if (this.Calendar_StartDate.Text != "") { sDate = Convert.ToDateTime(this.Calendar_StartDate.Text); if (sDate <= DateTime.Now) { this.ShowMessage(this, "有效开始日期应比现在日期晚"); return; } } else { sDate = Convert.ToDateTime("1900-01-01"); } if (this.Calendar_EndDate.Text != "") { eDate = Convert.ToDateTime(this.Calendar_EndDate.Text); if (sDate == Convert.ToDateTime("1900-01-01") && eDate < DateTime.Now) { this.ShowMessage(this, "有效结束日期应至少比现在日期晚"); return; } else if (eDate < sDate) { this.ShowMessage(this, "有效结束日期应比有效开始日期晚"); return; } } else { eDate = Convert.ToDateTime("1900-01-01"); } //根节点 TreeNode parentNode = catalogTree.RootNode; //获取checked的节点List ArrayList nodeList = new ArrayList(); this.catalogTree.ArrCheckbox(nodeList, parentNode); ArrayList catalogIds = new ArrayList(nodeList.Count); foreach (TreeNode node in nodeList) { catalogIds.Add(new Guid(node.Value)); } if (catalogIds.Count == 0) { this.ShowMessage(this, "没有选择分类,上传失败!"); return; } ImageStorage img = new ImageStorage(); string fileName = ""; //原始文件名 if (!string.IsNullOrEmpty(Request["selectedFile"])) { fileName = Request["selectedFile"].ToString(); } string uploadFileName = ""; //上传以后重新分配的文件名 prefix+yymmdd+00001.extention if (!string.IsNullOrEmpty(Request["uploadFileName"])) { uploadFileName = Request["uploadFileName"].ToString(); } VideoStorageClass vsc = new VideoStorageClass(); VideoStorage v = new VideoStorage(); v.Caption = this.txt_Caption.Value; v.Description = this.description.Value; v.EndDate = eDate; v.FileName = fileName; v.FolderName = CurrentUser.UserLoginName; v.ServerFileName = uploadFileName; v.GroupId = CurrentUser.UserGroupId; v.ItemId = Guid.NewGuid(); v.ItemSerialNum = Path.GetFileNameWithoutExtension(uploadFileName); v.Keyword = this.keyWord.Value; v.shotDate = Convert.ToDateTime(this.t_Date.Text); v.StartDate = sDate; v.uploadDate = DateTime.Now; v.userId = CurrentUser.UserId; v.updateDate = DateTime.Now; //存储数据库记录 // img.ItemSerialNum = ImageStorageClass.AddImageStorage(img); if (!vsc.Add(v)) { this.ShowMessage(this, "上传失败"); return; } vsc.CreateRelationshipVideoAndCatalog(v.ItemId, (Guid[])catalogIds.ToArray(typeof(Guid))); this.t_Date.Text = ""; //this.imageType.Value = ""; this.keyWord.Value = ""; this.description.Value = ""; //this.txt_Address.Value = ""; this.txt_Caption.Value = ""; //this.txt_Character.Value = ""; this.Calendar_StartDate.Text = ""; this.Calendar_EndDate.Text = ""; initCalendar(); this.ShowMessage(this, "上传成功"); //调用一下处理程序,不用等待处理结果 //VideoController vc = new VideoController(); //vc.runExe(ConfigurationManager.AppSettings["VideoEngineConsolePath"].ToString()); }
public VideoStorage GetVideoInfoBySN(string sn) { ResourceService rs = new ResourceService(); VideoStorage v = null; DataSet ds = rs.GetResourceInfoBySN(sn); if (ds.Tables[0].Rows.Count > 0) { v = new VideoStorage(); DataRow dr = ds.Tables[0].Rows[0]; v.Bitrate = string.Empty; v.ClipLength = string.Empty; v.ClipSize = string.Empty; if (ds.Tables[0].Columns.Contains("bitrate")) { v.Bitrate = dr["bitrate"].ToString(); } if (ds.Tables[0].Columns.Contains("ClipLength")) { v.ClipLength = dr["ClipLength"].ToString(); } if (ds.Tables[0].Columns.Contains("ClipSize")) { v.ClipSize = dr["ClipSize"].ToString(); } } return v; }