init: 导入项目到 meswork Gitea
This commit is contained in:
133
DataMirrorTools_Simulator/BasicOperation.OSql/OSql/Project.cs
Normal file
133
DataMirrorTools_Simulator/BasicOperation.OSql/OSql/Project.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
using Global;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using static DtWebApiDT.DataAccess;
|
||||
//using static SqlManage.ExecSql;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
namespace DTTest
|
||||
{
|
||||
/// <summary>
|
||||
/// 对于数据库的操作
|
||||
/// </summary>
|
||||
public partial class SqlOperation
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到输出的值,20201012,LLX
|
||||
/// 2021.4.19
|
||||
/// </summary>
|
||||
public class OutGUID
|
||||
{
|
||||
/// <summary>
|
||||
/// 2021.10.25.LLX
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string Get_CS_GUID()
|
||||
{
|
||||
return Guid.NewGuid().ToString().ToUpper() ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
public static string projectName
|
||||
{
|
||||
get
|
||||
{
|
||||
return PP.ProjectName;
|
||||
}
|
||||
set
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
if (!ModelBasic.ProjectVarDef.iProjectVar.ProjectNameFunc_IsNull())
|
||||
{
|
||||
ModelBasic.ProjectVarDef.iProjectVar.ProjectNameFunc(projectName);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
LogNet.LogisTrac.WriteLog(typeof(SqlOperation), err);
|
||||
|
||||
Console.WriteLine(err);
|
||||
try
|
||||
{
|
||||
// ModelBasic.ErrDef.iErrHandler.ErrInfoTransmit("在项目名称触发出现问题!");
|
||||
}
|
||||
catch (Exception err2)
|
||||
{
|
||||
LogNet.LogisTrac.WriteLog(typeof(SqlOperation), err2);
|
||||
|
||||
Console.WriteLine(err2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目代码筛选,20201012,LLX
|
||||
/// </summary>
|
||||
public class Project
|
||||
{
|
||||
/// <summary>
|
||||
/// 查看异常 ProjectList sysobjects
|
||||
/// </summary>
|
||||
/// <param name="connStrTemp"></param>
|
||||
public static bool SelectConnect(string connStrTemp)
|
||||
{
|
||||
return ExecuteDataset("SELECT * FROM ProjectList", connStrTemp, out DataSet ds, out string errorMessage);
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目代码筛选
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string Where()
|
||||
{
|
||||
return @" WHERE [ProjectCode] = '" + PP.ProjectCode + "' ";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UpdateProjectName
|
||||
/// 2021.5.25
|
||||
/// </summary>
|
||||
/// <param name="updateProjectCode"></param>
|
||||
/// <param name="updateProjectName"></param>
|
||||
private static void UpdateProjectName(object updateProjectCode, object updateProjectName)
|
||||
{
|
||||
PP.ProjectCode = updateProjectCode.ToString();
|
||||
projectName = PP.ProjectName = updateProjectName.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// UpdateProjectName
|
||||
/// 2022.6.07 wangdequan
|
||||
/// </summary>
|
||||
/// <param name="updateProjectCode"></param>
|
||||
/// <param name="updateProjectName"></param>
|
||||
public static string GetCurrentProject()
|
||||
{
|
||||
ExecuteDataset("SELECT ProjectCode FROM ProjectList where [CurrentProject] = 1", PP.ConnectionStr, out DataSet ds, out string errorMessage);
|
||||
if (ds.Tables.Count > 0)
|
||||
{
|
||||
if (ds.Tables[0].Rows.Count > 0)
|
||||
{
|
||||
return ds.Tables[0].Rows[0][0].ToString();
|
||||
}
|
||||
}
|
||||
return "-1";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user