/// <summary> /// 将参数写入到数据库中 /// </summary> /// <returns></returns> public bool insertDataToDB() { if (txtEvName.Text == null || "".Equals(txtEvName.Text.Trim())) { MessageBox.Show("数据名称不能为空"); return(false); } if (FilePath.Text == null || "".Equals(FilePath.Text.Trim())) { MessageBox.Show("上传文件不能为空"); return(false); } Maticsoft.BLL.evidence evidence_add = new Maticsoft.BLL.evidence(); Maticsoft.Model.evidence evidence_model = new Maticsoft.Model.evidence(); //构造假的param /* evName = "邮件test"; * caseId = "160"; * evTpye_origin = "综合文档"; * comment = "lv is handsome"; * evAdmin = "王利明"; * dataTypes_orgin = "综合文档"; */ if (!getParamsToSql()) { return(false); } evidence_model.evName = evName_d3; evidence_model.caseID = Convert.ToInt32(caseId_d3); evidence_model.evType = Convert.ToInt32(getEvTpye(evTpye_origin_d3)); evidence_model.comment = comment_d3; evidence_model.evAdmin = evAdmin_d3; evidence_model.dataTypes = Convert.ToInt32(getDataType(dataTypes_orgin_d3)); evidence_model.localPath = FilePath.Text; Console.WriteLine("---------------插入数据库信息1111111:" + evName_d3 + " " + caseId_d3 + " " + evType_d3 + " " + comment_d3 + " " + evAdmin_d3 + " " + dataType_d3 + " address:::: " + FilePath.Text); Console.WriteLine("---------------插入数据库信息22222222222:" + evidence_model.localPath); evidence_add.Add(evidence_model); Maticsoft.BLL.evidence evidence_update = new Maticsoft.BLL.evidence(); DataSet ds = evidence_update.GetList("1=1 ORDER BY id desc LIMIT 1"); filesBeans[index].id = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()); return(true); // 调用接口: // test_interface:http://172.16.103.252:8080/myweb/test // submit2server:http://172.16.103.252:8080/myweb/decomTar?linuxPath=&eviId= // submit2colony:http://172.16.103.252:8080/myweb/executeSparkShell?eviId= //dataTransimit(); //colonyAnalysis(); }
/// <summary> /// 将参数写入到数据库onlinenumber表中 : 1:解析中 ;0:解析完成 当前用户同时解析最多三个批次(即三个1)。 /// </summary> /// <returns></returns> public void insertOnLineNumberDataToDB() { Maticsoft.BLL.onlinenumber onlinenumber_add = new Maticsoft.BLL.onlinenumber(); Maticsoft.Model.onlinenumber onlinenumber_model = new Maticsoft.Model.onlinenumber(); Maticsoft.BLL.evidence evidence_update = new Maticsoft.BLL.evidence(); Maticsoft.Model.evidence evidence_model = new Maticsoft.Model.evidence(); DataSet ds = evidence_update.GetList("1=1 ORDER BY id desc LIMIT 1"); evidence_model.id = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()); onlinenumber_model.evid = evidence_model.id; onlinenumber_model.username = evAdmin_d3; onlinenumber_model.onlinestatus = "1"; onlinenumber_add.Add(onlinenumber_model); }
/// <summary> /// 将 已上传文件大小、文件本地地址 参数写入到数据库中 /// </summary> /// <returns></returns> public static void updateFilesSize() { Maticsoft.BLL.evidence evidence_update = new Maticsoft.BLL.evidence(); Maticsoft.Model.evidence evidence_model = new Maticsoft.Model.evidence(); DataSet ds = evidence_update.GetList("1=1 ORDER BY id desc LIMIT 1"); evidence_model.id = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()); evidence_model.evName = ds.Tables[0].Rows[0]["evName"].ToString(); evidence_model.caseID = Convert.ToInt32(ds.Tables[0].Rows[0]["caseID"].ToString()); evidence_model.evType = Convert.ToInt32(ds.Tables[0].Rows[0]["evType"].ToString()); evidence_model.comment = ds.Tables[0].Rows[0]["comment"].ToString(); evidence_model.evAdmin = ds.Tables[0].Rows[0]["evAdmin"].ToString(); evidence_model.dataTypes = Convert.ToInt32(ds.Tables[0].Rows[0]["dataTypes"].ToString()); evidence_model.finished = "-1"; evidence_model.localPath = totalPathName; // 文件本地上传根目录 evidence_update.Update(evidence_model); Console.WriteLine("---------------更新数据库信息:" + evidence_model.id + " " + evidence_model.dirPath); }
//上传成功后更新evidence 中的字段finished='true' public void updateFilesSuccStatus() { Maticsoft.BLL.evidence evidence_update = new Maticsoft.BLL.evidence(); Maticsoft.Model.evidence evidence_model = new Maticsoft.Model.evidence(); DataSet ds = evidence_update.GetList("1=1 ORDER BY id desc LIMIT 1"); evidence_model.id = Convert.ToInt32(ds.Tables[0].Rows[0]["id"].ToString()); evidence_model.evName = ds.Tables[0].Rows[0]["evName"].ToString(); evidence_model.caseID = Convert.ToInt32(ds.Tables[0].Rows[0]["caseID"].ToString()); evidence_model.evType = Convert.ToInt32(ds.Tables[0].Rows[0]["evType"].ToString()); evidence_model.comment = ds.Tables[0].Rows[0]["comment"].ToString(); evidence_model.evAdmin = ds.Tables[0].Rows[0]["evAdmin"].ToString(); evidence_model.dataTypes = Convert.ToInt32(ds.Tables[0].Rows[0]["dataTypes"].ToString()); evidence_model.finished = "true"; evidence_model.localPath = ds.Tables[0].Rows[0]["localPath"].ToString(); evidence_update.Update(evidence_model); Console.WriteLine("---------------更新数据库信息:" + evidence_model.id + " " + evidence_model.evName + " " + evidence_model.caseID); filesBeans[index].setId(evidence_model.id); filesBeans[index].setHasBean(Convert.ToBoolean(evidence_model.finished)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.evidence model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Maticsoft.Model.evidence model) { return(dal.Add(model)); }