public Model.Function GetModel(string where) { StringBuilder strSql = new StringBuilder(); strSql.Append("select id, accid, cfunid, cfunesc, cfuntype, cfunobject, cfunclass, cfunname, cfunsql, cfunvba "); strSql.Append(" from " + _tablename + " "); strSql.Append(" where "); strSql.Append(where); Model.Function model = new Model.Function(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), null); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.Id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } model.Accid = ds.Tables[0].Rows[0]["accid"].ToString(); model.Cfunid = ds.Tables[0].Rows[0]["cfunid"].ToString(); model.Cfunesc = ds.Tables[0].Rows[0]["cfunesc"].ToString(); model.Cfuntype = ds.Tables[0].Rows[0]["cfuntype"].ToString(); model.Cfunobject = ds.Tables[0].Rows[0]["cfunobject"].ToString(); model.Cfunclass = ds.Tables[0].Rows[0]["cfunclass"].ToString(); model.Cfunname = ds.Tables[0].Rows[0]["cfunname"].ToString(); model.Cfunsql = ds.Tables[0].Rows[0]["cfunsql"].ToString(); model.Cfunvba = ds.Tables[0].Rows[0]["cfunvba"].ToString(); return(model); } else { return(null); } }
protected void Button2_Click(object sender, EventArgs e) { Model.Function function = new Model.Function(); if (DropDownList1.SelectedIndex == 0) { Response.Write("<script>alert('请选择所属课程! ');</script>"); } else { function.classid = Int32.Parse(DropDownList1.SelectedValue); function.Name = TextBox1.Text; function.link = TextBox2.Text; function.Describe = TextBox3.Text; if (hasUploadedFile) { function.img = pictureName; } else { function.img = @"image\cloud.jpg"; } int flag = BLL.Function.BLLAddFunction(function); if (flag == 1) { Response.Write("<script>alert('设置成功! ');</script>"); } else { Response.Write("<script>alert('设置不成功,请重试! ');</script>"); } } }
object Model.IElementVisitor <object, object> .Visit(Model.Function element, object state) { if (_onFunction != null) { _onFunction(element); } return(null); }
public override void Init(Irony.Parsing.ParsingContext context, Irony.Parsing.ParseTreeNode treeNode) { base.Init(context, treeNode); headerSpan = new Irony.Parsing.SourceSpan(this.Span.Location, treeNode.ChildNodes[2].Span.EndPosition - this.Span.Location.Position); AddChild("Block", treeNode.ChildNodes[4]); foreach (var parameter in treeNode.ChildNodes[2].ChildNodes) { var name = parameter.ChildNodes[0].FindTokenAndGetText(); var type = parameter.ChildNodes[1].FindTokenAndGetText(); parameters.Add(new Tuple<string, string>(name, type)); } function = new Model.Function(); function.name = treeNode.ChildNodes[1].FindTokenAndGetText(); function.Node = this; function.parameterCount = parameters.Count; function.localScope = new Model.Scope(); function.localScope.type = Model.ScopeType.Function; function.localScope.activeFunction = this; function.returnType = treeNode.ChildNodes[3].FindTokenAndGetText(); if (function.returnType == null) function.returnType = "word"; ResultType = function.returnType; }