本文整理汇总了C#中HyoaClass.Hyoa_mudel.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# HyoaClass.Hyoa_mudel.Insert方法的具体用法?C# HyoaClass.Hyoa_mudel.Insert怎么用?C# HyoaClass.Hyoa_mudel.Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HyoaClass.Hyoa_mudel
的用法示例。
在下文中一共展示了HyoaClass.Hyoa_mudel.Insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button_Save_Click
//保存
protected void Button_Save_Click(object sender, EventArgs e)
{
if (this.Session["hyuid"].ToString() == "")
this.Response.Redirect("../login.aspx");
string ls_tip = "保存成功!";
//新文档时
HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
if (this.txtop.Value == "add")
{
//先判断这个模块编号是否已经存在
DataTable dt = Hyoa_mudel.Getmudel(this.txtmudelid.Value);
if (dt.Rows.Count > 0)
{
Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>");
return;
}
if(this.txtid.Text.Length<6)
{
Response.Write("<script>alert('模块编号长度必须大于5位!');history.back();</script>");
return;
}
if (this.txtid.Text.Substring(0, 5) != "Mudel")
{
Response.Write("<script>alert('模块编号必须以Mudel开头!');history.back();</script>");
return;
}
Hyoa_mudel.hy_mudelid = this.txtid.Text;
Hyoa_mudel.hy_mudelname = this.txtname.Value;
Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtsort.Value);
Hyoa_mudel.hy_isenabled = this.ddlisenabled.SelectedValue;
Hyoa_mudel.hy_roleid = this.ddlrole.SelectedValue;
Hyoa_mudel.hy_qqroleid = this.ddlqqrole.SelectedValue;
Hyoa_mudel.Insert();
}
else
{
Hyoa_mudel.hy_mudelid = this.txtid.Text;
Hyoa_mudel.hy_mudelname = this.txtname.Value;
Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtsort.Value);
Hyoa_mudel.hy_isenabled = this.ddlisenabled.SelectedValue;
Hyoa_mudel.hy_roleid = this.ddlrole.SelectedValue;
Hyoa_mudel.hy_qqroleid = this.ddlqqrole.SelectedValue;
Hyoa_mudel.Update();
}
//处理完成后的提示及跳转
if (this.txtifpop.Value == "")
{
Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
}
else
{
Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
}
}
示例2: Button_Save_Click
//保存
protected void Button_Save_Click(object sender, EventArgs e)
{
if (this.Session["hyuid"].ToString() == "")
this.Response.Redirect("../login.aspx");
string ls_tip = "复制成功!";
try
{
HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
HyoaClass.Hyoa_role Hyoa_role = new HyoaClass.Hyoa_role();
HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel();
HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig();
HyoaClass.Hyoa_listconfig Hyoa_listconfig = new HyoaClass.Hyoa_listconfig();
HyoaClass.Hyoa_listsearchfield Hyoa_listsearchfield = new HyoaClass.Hyoa_listsearchfield();
HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor();
HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache();
HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();
HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
#region 生成权限
DataTable dt = Hyoa_role.Getrole("Role" + this.txtmudelid.Text);
if (dt.Rows.Count > 0)
{
Response.Write("<script>alert('该权限编号已存在,请重新填写!');history.back();</script>");
return;
}
else
{
Hyoa_role.hy_roleid = "Role" + this.txtmudelid.Text;
Hyoa_role.hy_rolename = this.txtmudelname.Text;
Hyoa_role.hy_sort = System.Int32.Parse(this.txtno.Value);
Hyoa_role.Insert();
}
#endregion
#region 生成模块
dt = Hyoa_mudel.Getmudel("Mudel" + this.txtmudelid.Text);
if (dt.Rows.Count > 0)
{
Response.Write("<script>alert('该模块编号已存在,请重新填写!');history.back();</script>");
return;
}
else
{
Hyoa_mudel.hy_mudelid = "Mudel" + this.txtmudelid.Text;
Hyoa_mudel.hy_mudelname = this.txtmudelname.Text;
Hyoa_mudel.hy_sort = System.Int32.Parse(this.txtno.Value);
Hyoa_mudel.hy_isenabled = "是";
Hyoa_mudel.hy_roleid = "Role" + this.txtmudelid.Text;
Hyoa_mudel.hy_qqroleid = "Role" + this.txtmudelid.Text;
Hyoa_mudel.Insert();
}
#endregion
#region 生成表单
DataTable tableconfigdt = Hyoa_tableconfig.GetTablesbymudelid(this.ddlmudelid.SelectedValue);
if (tableconfigdt.Rows.Count > 0)
{
Hyoa_tableconfig.ID = "Table" + this.txtmudelid.Text;
Hyoa_tableconfig.hy_mudelid = "Mudel" + this.txtmudelid.Text;
Hyoa_tableconfig.hy_name = this.txtmudelname.Text;
Hyoa_tableconfig.hy_onload = tableconfigdt.Rows[0]["hy_onload"].ToString();
Hyoa_tableconfig.hy_sort = float.Parse(this.txtno.Value);
Hyoa_tableconfig.hy_ifflowdoc = tableconfigdt.Rows[0]["hy_ifflowdoc"].ToString();
Hyoa_tableconfig.hy_ifdisplayall = tableconfigdt.Rows[0]["hy_ifdisplayall"].ToString();
Hyoa_tableconfig.hy_ispuballByflowYB = tableconfigdt.Rows[0]["hy_ispuballByflowYB"].ToString();
Hyoa_tableconfig.hy_tablerole = tableconfigdt.Rows[0]["hy_tablerole"].ToString();
Hyoa_tableconfig.hy_ifcomment = tableconfigdt.Rows[0]["hy_ifcomment"].ToString();
Hyoa_tableconfig.hy_colnum = float.Parse(tableconfigdt.Rows[0]["hy_colnum"].ToString());
Hyoa_tableconfig.hy_field1 = tableconfigdt.Rows[0]["hy_field1"].ToString();
Hyoa_tableconfig.hy_field2 = tableconfigdt.Rows[0]["hy_field2"].ToString();
Hyoa_tableconfig.hy_field3 = tableconfigdt.Rows[0]["hy_field3"].ToString();
Hyoa_tableconfig.hy_field4 = tableconfigdt.Rows[0]["hy_field4"].ToString();
Hyoa_tableconfig.hy_field5 = tableconfigdt.Rows[0]["hy_field5"].ToString();
Hyoa_tableconfig.Insert();
}
#endregion
#region 生成表单字段
int i;
DataTable flowfielddt = Hyoa_flowfield.Getflowfieldsbytableid(this.ddltableid.SelectedValue);
if (flowfielddt.Rows.Count > 0)
{
for (i = 0; i < flowfielddt.Rows.Count; i++)
{
Hyoa_flowfield.ID = Hyoa_global.GetRandom();
Hyoa_flowfield.hy_tableid = "Table" + this.txtmudelid.Text;
Hyoa_flowfield.hy_mudelid = "Mudel" + this.txtmudelid.Text;
Hyoa_flowfield.hy_flowid = "Flow" + this.txtmudelid.Text;
Hyoa_flowfield.hy_fieldid = flowfielddt.Rows[i]["hy_fieldid"].ToString();
Hyoa_flowfield.hy_fieldname = flowfielddt.Rows[i]["hy_fieldname"].ToString();
Hyoa_flowfield.hy_fieldtype = flowfielddt.Rows[i]["hy_fieldtype"].ToString();
Hyoa_flowfield.hy_ifreadonly = flowfielddt.Rows[i]["hy_ifreadonly"].ToString();
Hyoa_flowfield.hy_defaultvaluetype = System.Int32.Parse(flowfielddt.Rows[i]["hy_defaultvaluetype"].ToString());
Hyoa_flowfield.hy_defaultvalue = flowfielddt.Rows[i]["hy_defaultvalue"].ToString();
Hyoa_flowfield.hy_optiontype = System.Int32.Parse(flowfielddt.Rows[i]["hy_optiontype"].ToString());
Hyoa_flowfield.hy_options = flowfielddt.Rows[i]["hy_options"].ToString();
//.........这里部分代码省略.........