📄 frametrace.cs
字号:
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, "◇" + errorInfo);
return false;
}
if (!this.Where.ReplaceWhere(ref returnSQL, returnSQL, this.commandName, ref errorInfo))
{
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, "◇" + errorInfo);
return false;
}
returnSQL = (this.DealTableMainInfo() + " " + returnSQL + " " + this.DealTableTailInfo()).Replace("\t", " ").Replace("\n", " ").Replace("\r", " ");
returnFabricate = returnSQL;
}
return true;
}
private bool Getanalyse(ref string ErrorInfo)
{
string functionAlias = "05";
string errorInfo = "";
try
{
XmlNode node = this.frameNode.GetNode(this.serviceName, this.chapterName, ref errorInfo);
if (node == null)
{
throw new Exception("获得文件 " + this.serviceName + ".xml 的节点 " + this.chapterName + " 错误!");
}
try
{
if (node.Attributes["CommandName"].Value.ToLower() == "table")
{
this.isTableCommand = true;
if (((this.commandName.ToLower() != "select") && (this.commandName.ToLower() != "insert")) && ((this.commandName.ToLower() != "update") && (this.commandName.ToLower() != "delete")))
{
throw new Exception("命令类型 " + this.commandName + " 不支持!");
}
}
else
{
this.isTableCommand = false;
if ((this.commandName != "") && (this.commandName.ToLower() != node.Attributes["CommandName"].Value.ToLower()))
{
throw new Exception("命令类型 " + this.commandName + " 与配置文件中的命令类型 " + node.Attributes["CommandName"].Value.ToString() + " 不相符!");
}
this.commandName = node.Attributes["CommandName"].Value.ToString();
}
}
catch (Exception exception)
{
throw new Exception("属性 commandName 读取错误:\n\r" + exception.Message);
}
try
{
this.depiction = node.Attributes["Depiction"].Value.ToString();
}
catch (Exception exception2)
{
throw new Exception("属性 Depiction 读取错误:\n\r" + exception2.Message);
}
this.Value.CreatNew(0);
this.Where.CreatNew(0);
this.mainInfo = "";
this.tailInfo = "";
for (int i = 0; i < node.ChildNodes.Count; i++)
{
switch (node.ChildNodes[i].Name)
{
case "MainInfo":
this.mainInfo = node.ChildNodes[i].InnerText;
break;
case "ValueList":
try
{
this.Value.CreatNew(node.ChildNodes[i].ChildNodes.Count);
for (int j = 0; j < node.ChildNodes[i].ChildNodes.Count; j++)
{
if (!this.Value.AddValue(j, node.ChildNodes[i].ChildNodes[j].Name, node.ChildNodes[i].ChildNodes[j].Attributes["Depiction"].Value.ToString(), node.ChildNodes[i].ChildNodes[j].Attributes["DataType"].Value.ToLower(), node.ChildNodes[i].ChildNodes[j].InnerText, ref errorInfo))
{
throw new Exception(errorInfo);
}
}
}
catch (Exception exception3)
{
throw new Exception("◇" + exception3.Message);
}
break;
case "WhereList":
try
{
this.Where.CreatNew(node.ChildNodes[i].ChildNodes.Count);
for (int k = 0; k < node.ChildNodes[i].ChildNodes.Count; k++)
{
if (!this.Where.AddWhere(k, node.ChildNodes[i].ChildNodes[k].Name, node.ChildNodes[i].ChildNodes[k].Attributes["Depiction"].Value.ToString(), node.ChildNodes[i].ChildNodes[k].Attributes["DataType"].Value.ToLower(), node.ChildNodes[i].ChildNodes[k].InnerText, node.ChildNodes[i].ChildNodes[k].Attributes["Operator"].Value.ToString(), ref errorInfo))
{
throw new Exception(errorInfo);
}
}
}
catch (Exception exception4)
{
throw new Exception("◇" + exception4.Message);
}
try
{
if (this.isTableCommand)
{
errorInfo = "分解Value项错误!";
this.Value.CreatNew(node.ChildNodes[i].ChildNodes.Count);
for (int m = 0; m < node.ChildNodes[i].ChildNodes.Count; m++)
{
if (!this.Value.AddValue(m, node.ChildNodes[i].ChildNodes[m].Name, node.ChildNodes[i].ChildNodes[m].Attributes["Depiction"].Value.ToString(), node.ChildNodes[i].ChildNodes[m].Attributes["DataType"].Value.ToLower(), node.ChildNodes[i].ChildNodes[m].InnerText, ref errorInfo))
{
throw new Exception(errorInfo);
}
}
}
}
catch (Exception exception5)
{
throw new Exception("◇分解 Value 项错误:\n\r" + exception5.Message);
}
break;
case "TailInfo":
this.tailInfo = node.ChildNodes[i].InnerText;
break;
}
}
}
catch (Exception exception6)
{
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, exception6.Message);
return false;
}
return true;
}
public bool TransactionFinish(ref string ErrorInfo)
{
string functionAlias = "11";
string errorInfo = "";
if (!this.Conn.TransactionCommit(ref errorInfo))
{
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, "◇" + errorInfo);
return false;
}
return true;
}
public bool TransactionRollback(ref string ErrorInfo)
{
string functionAlias = "12";
string errorInfo = "";
if (!this.Conn.TransactionRollback(ref errorInfo))
{
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, "◇" + errorInfo);
return false;
}
return true;
}
public bool TransactionStart(ref string ErrorInfo)
{
string functionAlias = "10";
string errorInfo = "";
if (!this.Conn.TransactionStart(ref errorInfo))
{
ErrorInfo = this.frameCity.DealErrorInfo(this.ClassAlias, functionAlias, "◇" + errorInfo);
return false;
}
return true;
}
public int ConnTimeout
{
get
{
return this.Conn.ConnTimeout;
}
set
{
this.Conn.ConnTimeout = value;
}
}
public string CurrentSQLL
{
get
{
return this.Conn.CurrentSQLL;
}
set
{
this.Conn.CurrentSQLL = value;
}
}
public string MainSQL
{
get
{
return this.mainSQL;
}
set
{
this.mainSQL = value;
}
}
public string TransactionContent
{
get
{
return this.Conn.TransactionContent;
}
set
{
this.Conn.TransactionContent = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -