private void ShowInfo(string S_Point, string E_Point) { Maticsoft.BLL.cjpll bll = new Maticsoft.BLL.cjpll(); Maticsoft.Model.cjpll model = bll.GetModel(S_Point, E_Point); this.lblStormSystem_ID.Text = model.StormSystem_ID; this.lblS_Point.Text = model.S_Point; this.lblS_Deep.Text = model.S_Deep.ToString(); this.lblS_Elev.Text = model.S_Elev.ToString(); this.lblE_Point.Text = model.E_Point; this.lblE_Deep.Text = model.E_Deep.ToString(); this.lblE_Elev.Text = model.E_Elev.ToString(); this.lblType.Text = model.Type; this.lblPressure_Type.Text = model.Pressure_Type; this.lblInvert_Silphon.Text = model.Invert_Silphon; this.lblMaterial.Text = model.Material; this.lblShapeType.Text = model.ShapeType; this.lblGrade.Text = model.Grade; this.lblPsize.Text = model.Psize; this.lblFlowDir.Text = model.FlowDir; this.lblConduitStyle.Text = model.ConduitStyle; this.lblAddress.Text = model.Address; this.lblDataSource.Text = model.DataSource; this.lblSdate.Text = model.Sdate; this.lblMdate.Text = model.Mdate; this.lblPipe_Type.Text = model.Pipe_Type; this.lblStatus.Text = model.Status; this.lblNote.Text = model.Note; }
public static void asynExportInfoTabl() { // List<string> list = new List<string>(); //点表 Maticsoft.BLL.cjplp cjplpBLL = new Maticsoft.BLL.cjplp(); List <Maticsoft.Model.cjplp> cjplpModelList = cjplpBLL.GetFileNames(); //线表 Maticsoft.BLL.cjpll cjpllBLL = new Maticsoft.BLL.cjpll(); List <Maticsoft.Model.cjpll> cjpllModelList = cjpllBLL.GetFileNames(); Maticsoft.BLL.exportinfo exportinfoBLL = new Maticsoft.BLL.exportinfo(); Maticsoft.Model.exportinfo exportinfoModel = new Maticsoft.Model.exportinfo(); List <Maticsoft.Model.exportinfo> exportinfosModelList = exportinfoBLL.GetModelList(""); if (cjplpModelList.Count > 0) { //第一种情况:对于数据库中有的,但是同步表中没有的,需要增加 var exp2 = cjplpModelList.Where(a => !exportinfosModelList.Exists(t => a.FileName.Contains(t.FileName))).ToList(); // Console.WriteLine("--查找student1集合中存在,而student2不存在的数据--"); foreach (var item in exp2) { // Console.WriteLine("{0} \t {1} \t {2}", item.name, item.subject, item.score); string[] tempArr = item.FileName.Split('-'); //导出配置表(exportinfo)中没有配置数据,则直接插入 exportinfoModel.Address = item.Address; exportinfoModel.Basin = tempArr.Length > 0 ? tempArr[0] : string.Empty; exportinfoModel.Strname = tempArr.Length > 1 ? tempArr[1] : string.Empty; exportinfoModel.Plot = tempArr.Length > 2 ? tempArr[2].Substring(0, tempArr[2].IndexOf("_")) : string.Empty; exportinfoModel.FileName = item.FileName; exportinfoBLL.Add(exportinfoModel); } } if (cjpllModelList.Count > 0) { //第一种情况:对于数据库中有的,但是同步表中没有的,需要增加 var exp2 = cjpllModelList.Where(a => !exportinfosModelList.Exists(t => a.FileName.Contains(t.FileName))).ToList(); // Console.WriteLine("--查找student1集合中存在,而student2不存在的数据--"); foreach (var item in exp2) { // Console.WriteLine("{0} \t {1} \t {2}", item.name, item.subject, item.score); string[] tempArr = item.FileName.Split('-'); //导出配置表(exportinfo)中没有配置数据,则直接插入 exportinfoModel.Address = item.Address; exportinfoModel.Basin = tempArr.Length > 0 ? tempArr[0] : string.Empty; exportinfoModel.Strname = tempArr.Length > 1 ? tempArr[1] : string.Empty; exportinfoModel.Plot = tempArr.Length > 2 ? tempArr[2].Substring(0, tempArr[2].IndexOf("_")) : string.Empty; exportinfoModel.FileName = item.FileName; exportinfoBLL.Add(exportinfoModel); } } if (exportinfosModelList.Count > 0) { //第二种情况:对于数据库中有的,但是同步表中没有的,需要增加 List <Maticsoft.Model.exportinfo> expPoint = exportinfosModelList.Where(a => !cjplpModelList.Exists(t => a.FileName.Contains(t.FileName))).ToList(); List <Maticsoft.Model.exportinfo> exLine = exportinfosModelList.Where(a => !cjpllModelList.Exists(t => a.FileName.Contains(t.FileName))).ToList(); // Console.WriteLine("--查找student1集合中存在,而student2不存在的数据--"); List <Maticsoft.Model.exportinfo> resultExportinfosList = expPoint.Union(exLine).ToList(); foreach (Maticsoft.Model.exportinfo item in resultExportinfosList) { exportinfoBLL.Delete(item.id); } } }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtStormSystem_ID.Text.Trim().Length == 0) { strErr += "StormSystem_ID不能为空!\\n"; } if (this.txtS_Point.Text.Trim().Length == 0) { strErr += "S_Point不能为空!\\n"; } if (!PageValidate.IsDecimal(txtS_Deep.Text)) { strErr += "S_Deep格式错误!\\n"; } if (!PageValidate.IsDecimal(txtS_Elev.Text)) { strErr += "S_Elev格式错误!\\n"; } if (this.txtE_Point.Text.Trim().Length == 0) { strErr += "E_Point不能为空!\\n"; } if (!PageValidate.IsDecimal(txtE_Deep.Text)) { strErr += "E_Deep格式错误!\\n"; } if (!PageValidate.IsDecimal(txtE_Elev.Text)) { strErr += "E_Elev格式错误!\\n"; } if (this.txtType.Text.Trim().Length == 0) { strErr += "Type不能为空!\\n"; } if (this.txtPressure_Type.Text.Trim().Length == 0) { strErr += "Pressure_Type不能为空!\\n"; } if (this.txtInvert_Silphon.Text.Trim().Length == 0) { strErr += "Invert_Silphon不能为空!\\n"; } if (this.txtMaterial.Text.Trim().Length == 0) { strErr += "Material不能为空!\\n"; } if (this.txtShapeType.Text.Trim().Length == 0) { strErr += "ShapeType不能为空!\\n"; } if (this.txtGrade.Text.Trim().Length == 0) { strErr += "Grade不能为空!\\n"; } if (this.txtPsize.Text.Trim().Length == 0) { strErr += "Psize不能为空!\\n"; } if (this.txtFlowDir.Text.Trim().Length == 0) { strErr += "FlowDir不能为空!\\n"; } if (this.txtConduitStyle.Text.Trim().Length == 0) { strErr += "ConduitStyle不能为空!\\n"; } if (this.txtAddress.Text.Trim().Length == 0) { strErr += "Address不能为空!\\n"; } if (this.txtDataSource.Text.Trim().Length == 0) { strErr += "DataSource不能为空!\\n"; } if (this.txtSdate.Text.Trim().Length == 0) { strErr += "Sdate不能为空!\\n"; } if (this.txtMdate.Text.Trim().Length == 0) { strErr += "Mdate不能为空!\\n"; } if (this.txtPipe_Type.Text.Trim().Length == 0) { strErr += "Pipe_Type不能为空!\\n"; } if (this.txtStatus.Text.Trim().Length == 0) { strErr += "Status不能为空!\\n"; } if (this.txtNote.Text.Trim().Length == 0) { strErr += "Note不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string StormSystem_ID = this.txtStormSystem_ID.Text; string S_Point = this.txtS_Point.Text; decimal S_Deep = decimal.Parse(this.txtS_Deep.Text); decimal S_Elev = decimal.Parse(this.txtS_Elev.Text); string E_Point = this.txtE_Point.Text; decimal E_Deep = decimal.Parse(this.txtE_Deep.Text); decimal E_Elev = decimal.Parse(this.txtE_Elev.Text); string Type = this.txtType.Text; string Pressure_Type = this.txtPressure_Type.Text; string Invert_Silphon = this.txtInvert_Silphon.Text; string Material = this.txtMaterial.Text; string ShapeType = this.txtShapeType.Text; string Grade = this.txtGrade.Text; string Psize = this.txtPsize.Text; string FlowDir = this.txtFlowDir.Text; string ConduitStyle = this.txtConduitStyle.Text; string Address = this.txtAddress.Text; string DataSource = this.txtDataSource.Text; string Sdate = this.txtSdate.Text; string Mdate = this.txtMdate.Text; string Pipe_Type = this.txtPipe_Type.Text; string Status = this.txtStatus.Text; string Note = this.txtNote.Text; Maticsoft.Model.cjpll model = new Maticsoft.Model.cjpll(); model.StormSystem_ID = StormSystem_ID; model.S_Point = S_Point; model.S_Deep = S_Deep; model.S_Elev = S_Elev; model.E_Point = E_Point; model.E_Deep = E_Deep; model.E_Elev = E_Elev; model.Type = Type; model.Pressure_Type = Pressure_Type; model.Invert_Silphon = Invert_Silphon; model.Material = Material; model.ShapeType = ShapeType; model.Grade = Grade; model.Psize = Psize; model.FlowDir = FlowDir; model.ConduitStyle = ConduitStyle; model.Address = Address; model.DataSource = DataSource; model.Sdate = Sdate; model.Mdate = Mdate; model.Pipe_Type = Pipe_Type; model.Status = Status; model.Note = Note; Maticsoft.BLL.cjpll bll = new Maticsoft.BLL.cjpll(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
/// <summary> /// 同步编码记录表记录(RecordTable) /// </summary> public static void asynRecordTabl() { //顺序编码表 Maticsoft.BLL.recordtable recordtableBll = new Maticsoft.BLL.recordtable(); //1.获取编码过的点表数据 Maticsoft.BLL.cjplp cjplpBLL = new Maticsoft.BLL.cjplp(); List <cjplp> cjplpModelList = cjplpBLL.GetMaxCodeModelList(); for (int i = 0; i < cjplpModelList.Count; i++) { //编码不为空 if (!String.IsNullOrEmpty(cjplpModelList[i].Exp_No)) { // List<Maticsoft.Model.recordtable> recordtableModelList =recordtableBll.GetModelList("(Lno is null or trim(lno)=='') and type=" + // cjplpModelList[i].Type.Substring(0, 2)); List <Maticsoft.Model.recordtable> recordtableModelList = recordtableBll.GetModelList("type='" + cjplpModelList[i].Type.Substring(0, 2) + "'"); for (int j = 0; j < recordtableModelList.Count; j++) { //如果不相等,则更新recordtable,相同,则不做任何操作 if (recordtableModelList[j].Exp_No != cjplpModelList[i].Exp_No) { recordtableModelList[j].year = cjplpModelList[i].Exp_No.Substring(2, 4); recordtableModelList[j].strnolast5 = cjplpModelList[i].Exp_No.Substring(6, 5); recordtableModelList[j].inteno = Convert.ToInt32(cjplpModelList[i].Exp_No.Substring(11, 2)); recordtableModelList[j].serino = Convert.ToInt32(cjplpModelList[i].Exp_No.Substring(13, 5)); recordtableModelList[j].typeYear = cjplpModelList[i].Exp_No.Substring(0, 6); recordtableModelList[j].typeYearStrnolast5 = cjplpModelList[i].Exp_No.Substring(0, 11); recordtableModelList[j].typeYearStrnolast5Inteno = cjplpModelList[i].Exp_No.Substring(0, 13); recordtableModelList[j].inteserino = cjplpModelList[i].Exp_No.Substring(11, 7); recordtableModelList[j].Exp_No = cjplpModelList[i].Exp_No; recordtableBll.Update(recordtableModelList[j]); } } } } //2.获取编码过的线表数据 Maticsoft.BLL.cjpll cjpllBLL = new Maticsoft.BLL.cjpll(); List <Maticsoft.Model.cjpll> cjpllModelList = cjpllBLL.GetMaxCodeModelList(); for (int i = 0; i < cjpllModelList.Count; i++) { if (!String.IsNullOrEmpty(cjpllModelList[i].Lno)) { // List<Maticsoft.Model.recordtable> recordtableModelList = recordtableBll.GetModelList("(Exp_No is null or trim(Exp_No)=='') and type=" + // cjpllModelList[i].Type.Substring(0, 2)); List <Maticsoft.Model.recordtable> recordtableModelList = recordtableBll.GetModelList("type='" + cjpllModelList[i].Type.Substring(0, 2) + "'"); for (int j = 0; j < recordtableModelList.Count; j++) { //如果不相等,则更新recordtable,相同,则不做任何操作 if (recordtableModelList[j].Lno != cjpllModelList[i].Lno) { recordtableModelList[j].year = cjpllModelList[i].Lno.Substring(2, 4); recordtableModelList[j].strnolast5 = cjpllModelList[i].Lno.Substring(6, 5); recordtableModelList[j].inteno = Convert.ToInt32(cjpllModelList[i].Lno.Substring(11, 2)); recordtableModelList[j].serino = Convert.ToInt32(cjpllModelList[i].Lno.Substring(13, 10)); recordtableModelList[j].typeYear = cjpllModelList[i].Lno.Substring(0, 6); recordtableModelList[j].typeYearStrnolast5 = cjpllModelList[i].Lno.Substring(0, 11); recordtableModelList[j].typeYearStrnolast5Inteno = cjpllModelList[i].Lno.Substring(0, 13); recordtableModelList[j].inteserino = cjpllModelList[i].Lno.Substring(11, 12); recordtableModelList[j].Lno = cjpllModelList[i].Lno; recordtableBll.Update(recordtableModelList[j]); } } } } }