private bool SaverTodb(List <USSheetData> list) { if (list == null || list.Count <= 0) { return(false); } QuickInsert icm = new QuickInsert(); PipeRev rev = new PipeRev(); LoadCmd lcmd = new LoadCmd(); lcmd.SetReceiver(rev); lcmd.Execute(); string pname = ""; try { foreach (USSheetData data in list) { CUSInfo info = new CUSInfo(); info.PipeID = GetPipeID(data.PipeName, rev.ListPipe); info.JobID = data.JobID; info.DetectDate = data.CheckDate; info.DetectDep = data.CheckDept; info.Detect_Person = data.CheckPerson; info.Contacts = data.CheckContact; info.Detect_Method = GetCheckMethod(data.CheckMethod); info.Detect_Dir = GetCheckDir(data.CheckDirect); info.Pipe_Stop = data.Pipe_Stop; info.Func_Defect = GetFuncDef(data.Func_Defect); info.Func_Class = GetClass(data.Func_Class); info.Strcut_Defect = GetStructDef(data.Struct_Defect); info.Struct_Class = GetClass(data.Struct_Class); if (IsDouble(data.Repire_Index)) { info.Repair_Index = Convert.ToDouble(data.Repire_Index); } else { info.Repair_Index = 0; } if (IsDouble(data.Matain_Index)) { info.Matain_Index = Convert.ToDouble(data.Matain_Index); } else { info.Matain_Index = 0; } info.Problem = data.Problem; info.Video_Filename = data.Video_Filename; info.ReportDept = data.RecordDept; info.ReportDate = data.RecordTime; info.DataIsFull = data.DataFull; info.LoseReason = data.LoseReson; info.Remark = data.Remark; rev.ListUS.Add(info); pname = data.PipeName; } } catch (Exception e) { Console.WriteLine("PipeName : {0} in exception{1}", pname, e.Message); } rev.ListPipe.Clear(); rev.ListPipeExt.Clear(); icm.SetReceiver(rev); icm.Execute(); return(true); }
private bool SaverTodb(List <PipeSheetData> list) { //get the juncinfo. then if (list == null || list.Count <= 0) { return(false); } QuickInsert icm = new QuickInsert(); PipeRev rev = new PipeRev(); rev.ListPipe = new List <CPipeInfo>(); rev.ListPipeExt = new List <CPipeExtInfo>(); LoadCmd lcmd = new LoadCmd(); JuncRev junrev = new JuncRev(); lcmd.SetReceiver(junrev); lcmd.Execute(); string pname = ""; try { foreach (PipeSheetData data in list) { CPipeInfo info = new CPipeInfo(); CPipeExtInfo extinfo = new CPipeExtInfo(); extinfo.Lane_Way = data.RoadName; info.PipeName = data.PipeName; info.Pipe_Category = GetCategory(data.PipeCategory); info.Pipe_Len = 0;//default int inid = CheckID(data.InCode, junrev.ListJunc); int outid = CheckID(data.OutCode, junrev.ListJunc); info.In_JunID = inid; info.Out_JunID = outid; info.In_UpEle = data.In_UpEle; info.In_BottomEle = data.In_BottomEle; info.Out_UpEle = data.Out_UpEle; info.Out_BottomEle = data.Out_UpEle; info.Shape_Data1 = data.In_R; info.Shape_Data2 = data.Out_R; info.ShapeType = GetShapeType(data.ShapeType); info.ShapeData = data.ShapeData; info.Material = Getmaterial(data.Matrial); info.Roughness = data.Roughness; info.DataSource = GetDataSource(data.DataSource); info.Record_Date = data.DataTime; info.ReportDept = data.RecordDept; info.ReportDate = data.RecordTime; extinfo.DataIsFull = data.DataFull; extinfo.LoseReason = data.LoseReson; extinfo.Remark = data.Remark; rev.ListPipe.Add(info); rev.ListPipeExt.Add(extinfo); pname = data.PipeName; } } catch (Exception e) { Console.WriteLine("PipeName : {0} in exception{1}", pname, e.Message); } icm.SetReceiver(rev); icm.Execute(); return(true); }