public static 表结构 Interception(string SourceStr) { 表结构 表结构 = new 表结构(); try { //截取类目注释 表结构.ClassNotes = OperationString.DoIt(SourceStr, "--", "\r\n"); SourceStr = OperationString.Handle(SourceStr, "--", "\r\n"); //删除dbo string dbostr = OperationString.DoIt(SourceStr, "`", "`."); SourceStr = OperationString.Handle(SourceStr, "`", "`."); //截取类名 表结构.ClassName = OperationString.DoIt(SourceStr, "`", "` "); SourceStr = OperationString.Handle(SourceStr, "`", "` "); DataRow dr = 表结构.字段列表.NewRow(); dr["字段名"] = "id"; dr["字段注释"] = "主键"; 表结构.字段列表.Rows.Add(dr); //删除id所在行 string idstr = OperationString.DoIt(SourceStr, "`", "主键"); SourceStr = OperationString.Handle(SourceStr, "`", "主键"); try { //截取成员变量 while (true) { dr = 表结构.字段列表.NewRow(); dr["字段名"] = OperationString.DoIt(SourceStr, "`", "` "); //取字段名 SourceStr = OperationString.Handle(SourceStr, "`", "` "); dr["字段注释"] = OperationString.DoIt(SourceStr, "--", "\r\n"); //取注释 SourceStr = OperationString.Handle(SourceStr, "--", "\r\n"); 表结构.字段列表.Rows.Add(dr); } } catch (Exception ex) { ex.ToString(); } } catch (Exception ex) { ex.ToString(); } return(表结构); }
public static DataTable 转换(string str) { DataTable SQLTABEL = new DataTable(); str = str.Replace(".", " "); for (int i = 0; i < 60; i++) { SQLTABEL.Columns.Add("C" + i); } while (true) { try { //截取行 string Line = OperationString.DoIt(str, "", "\r\n"); str = OperationString.Handle(str, "", "\r\n"); int index = 0; DataRow dr = SQLTABEL.NewRow(); while (true) { try { dr[index] = OperationString.DoIt(Line, "", " ");; Line = OperationString.Handle(Line, "", " "); index++; } catch { break; } } dr[index] = Line; SQLTABEL.Rows.Add(dr); } catch { break; } } return(SQLTABEL); }
public decimal Calculate(Operation operation, decimal left, decimal right, DisplayEquation displayEquation, OperationString operationString) { var answer = operation(left, right); displayEquation(left, right, operationString(), answer); return(answer); }
private void btnToLower_Click(object sender, EventArgs e) { UpperOrLower = 2; txtNewText.Text = IsTirm ? OperationString.Trim().ToLower() : OperationString.ToLower(); }