ASP.NET员工管理系统简易分了层主要只是就一个传值和CRUD
2021-06-03 22:03
标签:address cti protected abi view 数据 win query 实体 实体类 DAL --BLL UI: --查询 --主页 传值还可以在前端传:DataTextFied="Sname" DataNavigateURLfromatstring=“~fom.aspx?id={0} DataNavigateUrlFields="sid"l ASP.NET员工管理系统简易分了层主要只是就一个传值和CRUD 标签:address cti protected abi view 数据 win query 实体 原文地址:https://www.cnblogs.com/yijieyufu/p/12347126.htmlusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EmpPrj.Entity
{
public class y_EmployeeEntity
{
public int EmployeeId { get; set; }
public string EName { get; set; }
public string Mobile { get; set; }
public string HAddress { get; set; }
public string Kdate { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EmpPrj.Entity
{
public class y_FamilyEntity
{
public int MemberId { get; set; }
public int EmployeeId { get; set; }
public string RelationShip { get; set; }
public string FName { get; set; }
public string Job { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmpPrj.Entity;
using EmpPrj.DAL;
using System.Data.SqlClient;
namespace EmpPrj.DAL
{
public class y_EmployeeDAL
{
//查询所有字段的公共方法(私有)
private List
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmpPrj.Entity;
using EmpPrj.DAL;
using System.Data.SqlClient;
namespace EmpPrj.DAL
{
public class y_FamilyDAL
{
//查询所有字段的公共方法(私有)
private List
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmpPrj.DAL;
using EmpPrj.Entity;
namespace EmpPrj.BLL
{
public class y_FamilyBLL
{
public static bool Inserty_Family(y_FamilyEntity entity)
{
return new y_FamilyDAL().Inserty_Family(entity);
}
public static string selectname(int id)
{
return y_FamilyDAL.selectname(id);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmpPrj.Entity;
using EmpPrj.DAL;
namespace EmpPrj.BLL
{
public class y_EmployeeBLL
{
public static List
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EmpPrj.Entity;
using EmpPrj.BLL;
public partial class Add : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
}
}
protected void Button1_Click(object sender, EventArgs e)
{
y_EmployeeEntity env = new y_EmployeeEntity();
env.EName = Etext_name.Text;
env.Mobile = Etext_mob.Text;
env.HAddress = Etext_HA.Text;
y_FamilyEntity entity = new y_FamilyEntity();
entity.RelationShip = ytext_shop.Text;
entity.FName = ytext_name.Text;
entity.Job = ytext_Job.Text;
y_FamilyEntity entity2= new y_FamilyEntity();
entity2.RelationShip = ytext_shop2.Text;
entity2.FName = ytext_name2.Text;
entity2.Job = ytext_Job2.Text;
if (y_EmployeeBLL.Inserty_Employee(env))
{
int refeid = Convert.ToInt32(y_EmployeeBLL.selectid());
entity.EmployeeId = refeid;
entity2.EmployeeId = refeid;
if (y_FamilyBLL.Inserty_Family(entity) && y_FamilyBLL.Inserty_Family(entity2))
{
Response.Write("");
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EmpPrj.BLL;
public partial class FamilyIndex : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
int id = Convert.ToInt32( Request.QueryString["id"].ToString());
Label1.Text = y_FamilyBLL.selectname(id).ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EmpPrj.BLL;
public partial class Index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = y_EmployeeBLL.Selecty_Employees();
GridView1.DataBind();
}
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
int Eid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
Response.Redirect("~/FamilyIndex.aspx?id=" + Eid);
}
}
上一篇:使用CURL测量网络延时
下一篇:js---交换两个值
文章标题:ASP.NET员工管理系统简易分了层主要只是就一个传值和CRUD
文章链接:http://soscw.com/index.php/essay/90144.html