/// <summary> /// 更新标段信息 /// </summary> /// <param name="ProjectInfo"></param> /// <returns></returns> public Boolean UpdatePrjsctInfo(Prjsct PrjstInfo) { Boolean Result = false; try { //工程结构树 StringBuilder Sql_Select = new StringBuilder(); // 增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("select Id,Description,PegFrom,PegTo,Price,Scts_1 from sys_engs_SectionInfo where Scdel=0 and ID ='"); Sql_Select.Append(PrjstInfo.Index); Sql_Select.Append("'"); DataTable Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count > 0) { DataRow Row = Data.Rows[0]; Row["Description"] = PrjstInfo.PrjsctName; Row["PegFrom"] = PrjstInfo.PegFrom; Row["PegTo"] = PrjstInfo.PegTo; Row["Scts_1"] = DateTime.Now.ToString(); } object r = Update(Data); Result = (Convert.ToInt32(r) == 1); ProjectManager project = new ProjectManager(); project.SyncSysTree(PrjstInfo.PrjsctCode, PrjstInfo.PrjsctName, "@tenders", PrjstInfo.OrderID, false); } catch { } return(Result); }
public Boolean SelectOrginfo(Orginfo OrgInfo) { Boolean Result = false; StringBuilder Sql_Select = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("Select Id,NodeCode,NodeType,RalationID From sys_engs_Tree Where Scdel=0 and RalationID='"); Sql_Select.Append(OrgInfo.Index); Sql_Select.Append("'"); DataTable Data = GetDataTable(Sql_Select.ToString()); if (Data != null) { DataRow Row = Data.NewRow(); Row["ID"] = Guid.NewGuid().ToString(); Row["NodeCode"] = OrgInfo.DepCode; Row["NodeType"] = OrgInfo.DepType; Row["RalationID"] = OrgInfo.Index; Data.Rows.Add(Row); } try { object r = Update(Data); Result = (Convert.ToInt32(r) == 1); } catch { } OrgInfo.OrderID = OrgInfo.DepCode; ProjectManager project = new ProjectManager(); project.SyncSysTree(OrgInfo.DepCode, OrgInfo.DepName, OrgInfo.DepType, OrgInfo.OrderID, false); return(Result); }
public Boolean UpdatePrjFolder(PrjFolder FolderInfo) { Boolean Result = false; try { //工程结构树 StringBuilder Sql_Select = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("Select Id,Description,ItemType,Scts_1 From sys_engs_ItemInfo Where Scdel=0 and Id='"); Sql_Select.Append(FolderInfo.Index); Sql_Select.Append("'"); DataTable Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count > 0) { DataRow Row = Data.Rows[0]; Row["Description"] = FolderInfo.FolderName; Row["ItemType"] = FolderInfo.FolderType; //增加条件 Scts_1=Getdate() 2013-10-17 Row["Scts_1"] = DateTime.Now.ToString(); } object r = Update(Data); Result = (Convert.ToInt32(r) == 1); ProjectManager project = new ProjectManager(); project.SyncSysTree(FolderInfo.FolderCode, FolderInfo.FolderName, "@folder", FolderInfo.OrderID, false); } catch (Exception ex) { logger.Error("UpdatePrjFolder异常:" + ex.Message); } return(Result); }
/// <summary> /// 删除标段信息 /// </summary> /// <param name="PrjsctCode"></param> /// <returns></returns> public Boolean DeletePrjsctInfo(string PrjsctCode, string PrjsctId) { Boolean Result = false; List <string> SheetList = ProjectCatlogManager.GetModuleTables(PrjsctCode); IDbConnection DbConnection = GetConntion(); Transaction Transaction = new Transaction(DbConnection); try { List <String> sql_Commands = new List <string>(); //工程结构树 StringBuilder Sql_Delete = new StringBuilder(); //增加字段Scts_1,Scdel 之后 删除操作只做伪删除,用于数据同步 2013-10-17 //Sql_Delete.Append("Delete From sys_engs_Tree Where NodeCode like '"); //Sql_Delete.Append(PrjsctCode); //Sql_Delete.Append("%'"); Sql_Delete.Append("Update sys_engs_Tree Set Scts_1=Getdate(),Scdel=1 Where NodeCode like '"); Sql_Delete.Append(PrjsctCode); Sql_Delete.Append("%'"); sql_Commands.Add(Sql_Delete.ToString()); //标段相关数据 Sql_Delete = new StringBuilder(); //增加字段Scts_1,Scdel 之后 删除操作只做伪删除,用于数据同步 2013-10-17 //Sql_Delete.Append("Delete From sys_engs_SectionInfo Where ID = '"); //Sql_Delete.Append(PrjsctId); //Sql_Delete.Append("'"); Sql_Delete.Append("Update sys_engs_SectionInfo Set Scts_1=Getdate(),Scdel=1 Where ID = '"); Sql_Delete.Append(PrjsctId); Sql_Delete.Append("'"); sql_Commands.Add(Sql_Delete.ToString()); //处理相关模板表的数据 foreach (String SheetName in SheetList) { Sql_Delete = new StringBuilder(); Sql_Delete.Append("Delete From "); Sql_Delete.Append(SheetName); Sql_Delete.Append(" where SCPT like '"); Sql_Delete.Append(PrjsctCode); Sql_Delete.Append("%'"); sql_Commands.Add(Sql_Delete.ToString()); } object r = ExcuteCommands(sql_Commands.ToArray(), Transaction); int[] ints = (int[])r; for (int i = 0; i < ints.Length; i++) { if (i != 0) { Result = Result & (Convert.ToInt32(ints[i]) == 1); } else { Result = (Convert.ToInt32(ints[i]) == 1); } } if (Result) { Transaction.Commit(); } else { Transaction.Rollback(); } } catch { Transaction.Rollback(); } ProjectManager project = new ProjectManager(); project.SyncSysTree(PrjsctCode, "", "@tenders", "", true); return(Result); }
/// <summary> /// 新建标段信息 /// </summary> /// <param name="PrjstInfo"></param> /// <returns></returns> public Boolean NewPrjstInfo(Prjsct PrjstInfo) { Boolean Result = false; IDbConnection DbConnection = GetConntion(); Transaction Transaction = new Transaction(DbConnection); try { //工程结构树 StringBuilder Sql_Select = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("Select ID,NodeCode,NodeType,RalationID From sys_engs_Tree Where Scdel=0 and RalationID='"); Sql_Select.Append(PrjstInfo.Index); Sql_Select.Append("'"); DataTable Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count == 0) { DataRow Row = Data.NewRow(); Row["ID"] = Guid.NewGuid().ToString(); Row["NodeCode"] = PrjstInfo.PrjsctCode; Row["NodeType"] = "@tenders"; Row["RalationID"] = PrjstInfo.Index; Data.Rows.Add(Row); } object r = Update(Data, Transaction); Result = (Convert.ToInt32(r) == 1); //处理标段表 Sql_Select = new StringBuilder(); // 增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("select ID,Description,PegFrom,PegTo,Price from sys_engs_SectionInfo where Scdel=0 and ID ='"); Sql_Select.Append(PrjstInfo.Index); Sql_Select.Append("'"); Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count == 0) { DataRow Row = Data.NewRow(); Row["ID"] = PrjstInfo.Index; Row["Description"] = PrjstInfo.PrjsctName; Row["PegFrom"] = PrjstInfo.PegFrom; Row["PegTo"] = PrjstInfo.PegTo; Data.Rows.Add(Row); } r = Update(Data, Transaction); Result = Result & (Convert.ToInt32(r) == 1); if (Result) { Transaction.Commit(); } else { Transaction.Rollback(); } } catch { Transaction.Rollback(); } PrjstInfo.OrderID = PrjstInfo.PrjsctCode; ProjectManager project = new ProjectManager(); project.SyncSysTree(PrjstInfo.PrjsctCode, PrjstInfo.PrjsctName, "@tenders", PrjstInfo.OrderID, false); return(Result); }
public Boolean UpdateOrginfo(Orginfo OrgInfo) { Boolean Result = false; IDbConnection DbConnection = GetConntion(); Transaction Transaction = new Transaction(DbConnection); try { //单位信息表 StringBuilder Sql_Select = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("Select Id,Description,DepType,DepAbbrev,ConstructionCompany From sys_engs_CompanyInfo where Scdel=0 and Id='"); Sql_Select.Append(OrgInfo.Index); Sql_Select.Append("'"); DataTable Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count > 0) { DataRow Row = Data.Rows[0]; Row["Description"] = OrgInfo.DepName; Row["DepType"] = OrgInfo.DepType; Row["DepAbbrev"] = OrgInfo.DepAbbrev; Row["ConstructionCompany"] = OrgInfo.ConstructionCompany; } object r = Update(Data, Transaction); Result = (Convert.ToInt32(r) == 1); Sql_Select = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Select.Append("Select Id,NodeCode,NodeType,RalationID From sys_engs_Tree Where Scdel=0 and RalationID='"); Sql_Select.Append(OrgInfo.Index); Sql_Select.Append("'"); Data = GetDataTable(Sql_Select.ToString()); if (Data != null && Data.Rows.Count > 0) { DataRow Row = Data.Rows[0]; Row["NodeType"] = OrgInfo.DepType; } r = Update(Data, Transaction); Result = (Convert.ToInt32(r) == 1); if (Result) { Transaction.Commit(); } else { Transaction.Rollback(); } } catch { Transaction.Rollback(); } ProjectManager project = new ProjectManager(); project.SyncSysTree(OrgInfo.DepCode, OrgInfo.DepName, OrgInfo.DepType, OrgInfo.OrderID, false); return(Result); }
public Boolean DeletePrjFolder(string FolderCode, string FolderId) { Boolean Result = false; List <string> SheetList = ProjectCatlogManager.GetModuleTables(FolderCode); IDbConnection Connection = GetConntion(); Transaction Transaction = new Transaction(Connection); Boolean flag = false; try { List <string> sql_Commands = new List <string>(); //工程结构树 StringBuilder Sql_Delete = new StringBuilder(); //增加字段Scts_1,Scdel 之后 删除操作只做伪删除,用于数据同步 2013-10-17 //Sql_Delete.Append("Delete From sys_engs_Tree Where NodeCode like '"); //Sql_Delete.Append(FolderCode); //Sql_Delete.Append("%'"); Sql_Delete.Append("Update sys_engs_Tree Set Scts_1=Getdate(),Scdel=1 Where NodeCode like '"); Sql_Delete.Append(FolderCode); Sql_Delete.Append("%'"); sql_Commands.Add(Sql_Delete.ToString()); if (FolderId != "") { //删除机组 Sql_Delete = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 //Sql_Delete.Append("Delete From sys_engs_ItemInfo Where Id = '"); //Sql_Delete.Append(FolderId); //Sql_Delete.Append("'"); Sql_Delete.Append("update sys_engs_ItemInfo Set Scts_1=Getdate(),Scdel=1 Where Id = '"); Sql_Delete.Append(FolderId); Sql_Delete.Append("'"); sql_Commands.Add(Sql_Delete.ToString()); } //处理相关模板表的数据 var deleteSql = string.Format("UPDATE sys_document SET Status = 0 where TestRoomCode = '" + FolderCode + "'"); sql_Commands.Add(deleteSql); if (String.IsNullOrEmpty(FolderCode)) { return(false); } object r = ExcuteCommands(sql_Commands.ToArray(), Transaction); int[] ints = (int[])r; for (int i = 0; i < ints.Length; i++) { if (i != 0) { Result = Result & (Convert.ToInt32(ints[i]) == 1); } else { Result = (Convert.ToInt32(ints[i]) == 1); } } if (Result) { Transaction.Commit(); flag = true; } else { Transaction.Rollback(); } } catch { Transaction.Rollback(); } if (flag) { try { //PXJZDataManager pxjz = new PXJZDataManager(); //pxjz.DeleteByTestRoomCode(FolderCode); ProjectManager project = new ProjectManager(); project.SyncSysTree(FolderCode, "", "@folder", "", true); } catch { } } return(Result); }
public Boolean NewPrjFolder(PrjFolder FolderInfo) { Boolean Result = false; IDbConnection Connection = GetConntion(); Transaction Transaction = new Transaction(Connection); Boolean flag = false; try { //工程结构树 StringBuilder Sql_Nodes = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Nodes.Append("Select Id,NodeCode,NodeType,RalationID From sys_engs_Tree Where Scdel=0 and RalationID='"); Sql_Nodes.Append(FolderInfo.Index); Sql_Nodes.Append("'"); StringBuilder Sql_Items = new StringBuilder(); //增加查询条件 Scdel=0 2013-10-17 Sql_Items.Append("Select Id,Description,ItemType From sys_engs_ItemInfo Where Scdel=0 and Id='"); Sql_Items.Append(FolderInfo.Index); Sql_Items.Append("'"); List <string> sql_Commands = new List <string>(); sql_Commands.Add(Sql_Nodes.ToString()); sql_Commands.Add(Sql_Items.ToString()); DataSet dataset = GetDataSet(sql_Commands.ToArray()); if (dataset != null) { DataTable TableNodes = dataset.Tables["sys_engs_Tree"]; DataTable TableItems = dataset.Tables["sys_engs_ItemInfo"]; if (TableNodes != null && TableNodes.Rows.Count == 0) { DataRow Row = TableNodes.NewRow(); Row["ID"] = Guid.NewGuid().ToString(); Row["NodeCode"] = FolderInfo.FolderCode; Row["NodeType"] = "@folder"; Row["RalationID"] = FolderInfo.Index; TableNodes.Rows.Add(Row); } if (TableItems != null && TableItems.Rows.Count == 0) { DataRow Row = TableItems.NewRow(); Row["ID"] = FolderInfo.Index; Row["Description"] = FolderInfo.FolderName; Row["ItemType"] = "@folder"; TableItems.Rows.Add(Row); } object r = Update(dataset, Transaction); Result = (Convert.ToInt32(r) == 1); if (Result) { Transaction.Commit(); flag = true; } else { Transaction.Rollback(); } } } catch { Transaction.Rollback(); } if (flag) { try { //PXJZDataManager pxjz = new PXJZDataManager(); //pxjz.NewByTestRoom(FolderInfo.FolderCode, FolderInfo.Index); FolderInfo.OrderID = FolderInfo.FolderCode; ProjectManager project = new ProjectManager(); project.SyncSysTree(FolderInfo.FolderCode, FolderInfo.FolderName, "@folder", FolderInfo.OrderID, false); } catch { } } return(Result); }