protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { int id = int.Parse(Request.QueryString["ID"]); EmployeeModel employee = new EmployeeModel(); employee = bll.GetEmployeeByID(id); txtName.Text = employee.EmlpoyeeName; if (employee.Sex == 0) lbSex.Text = "男"; else lbSex.Text = "女"; lbID.Text = employee.CardID; txtArrage.Text = employee.Arrage; txtTel.Text = employee.Tel; txtMobile.Text = employee.Mobile; txtAddress.Text = employee.Address; path = employee.PhotoPath; Photo.ImageUrl = path; } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { DDLPa.DataSource = pabll.GetAllPavilion(); DDLPa.DataBind(); DDLCell.DataSource = typebll.GetType("Cell"); DDLCell.DataBind(); string str = DDLPa.SelectedValue; int i = Convert.ToInt32(DDLCell.SelectedValue); if (i < 10) str += "0" + i.ToString(); else str += i.ToString(); List<RoomModel> list = roombll.GetAllRoomNotUsed(str); if (list.Count != 0) { DDLRoomID.DataSource = list; DDLRoomID.DataBind(); Panel1.Visible = true; } else { Panel1.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { BaseInfoBLL bll = new BaseInfoBLL(); List<BaseInfoModel> list = bll.ShowBaseInfo(); if (list.Count != 0) { txtBaseName.Text = list[0].HomeName; txtAmount.Text = list[0].Amount.ToString(); txtBuildArea.Text = list[0].BuildArea.ToString(); txtGreenArea.Text = list[0].GreenArea.ToString(); txtRoadArea.Text = list[0].RoadArea.ToString(); txtParkArea.Text = list[0].ParkingArea.ToString(); txtBuildDate.Value = list[0].BuildDate.ToString("yyy-MM-dd"); txtMainHead.Text = list[0].MainHead; txtTelephone.Text = list[0].Tel; txtAddress.Text = list[0].Address; txtMemo.Text = list[0].Memo; } } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { DDLRoomFormat.DataSource = bll.GetType("RoomFormat"); DDLRoomFormat.DataBind(); DDLSunny.DataSource = bll.GetType("Sunny"); DDLSunny.DataBind(); DDLRoomUse.DataSource = bll.GetType("RoomUse"); DDLRoomUse.DataBind(); DDLIndoor.DataSource = bll.GetType("Indoor"); DDLIndoor.DataBind(); string code = Request.QueryString["ID"].ToString(); RoomModel room = roombll.GetRoomByID(code); lbCode.Text = room.Code; lbRoomID.Text = room.RoomID; lbPaName.Text = room.PaName; txtBuildArea.Text = room.BuildArea.ToString(); txtUseArea.Text = room.UseArea.ToString(); DDLRoomFormat.SelectedValue = room.RoomFormatID.ToString(); DDLSunny.SelectedValue = room.SunnyID.ToString(); DDLRoomUse.SelectedValue = room.RoomUseID.ToString(); DDLIndoor.SelectedValue = room.IndoorID.ToString(); } } }
public int InsertHomeHold(HomeHoldModel homeHold,UserModel user,string code,int state) { SqlParameter[] param = { new SqlParameter("@Code", SqlDbType.VarChar, 9), new SqlParameter("@Name", SqlDbType.VarChar, 20), new SqlParameter("@Tel",SqlDbType.VarChar,13),new SqlParameter("@Contact",SqlDbType.VarChar,50), new SqlParameter("@Mobile",SqlDbType.VarChar,11),new SqlParameter("@Email",SqlDbType.VarChar,40), new SqlParameter("@CardID",SqlDbType.VarChar,19),new SqlParameter("@OwnerID",SqlDbType.VarChar,20), new SqlParameter("@Unit",SqlDbType.VarChar,20),new SqlParameter("@Memo",SqlDbType.Text) }; param[0].Value = homeHold.Code; param[1].Value = homeHold.UserName; param[2].Value = homeHold.Tel; param[3].Value = homeHold.Contact; param[4].Value = homeHold.Mobile; param[5].Value = homeHold.Email; param[6].Value = homeHold.CardID; param[7].Value = homeHold.OwnerID; param[8].Value = homeHold.Unit; param[9].Value = homeHold.Memo; SqlParameter[] param1 = { new SqlParameter("@UID", SqlDbType.VarChar, 20), new SqlParameter("@Password", SqlDbType.VarChar,20), new SqlParameter("@UserType",SqlDbType.SmallInt),new SqlParameter("@SubID",SqlDbType.Int) }; param1[0].Value = user.UID; param1[1].Value = user.Password; param1[2].Value = user.UserType; param1[3].Value = user.SubID; SqlParameter[] param2 = { new SqlParameter("@Code", SqlDbType.VarChar, 9), new SqlParameter("@State", SqlDbType.Int) }; param2[0].Value = code; param2[1].Value = state; string[] commandText = { "prc_InsertHomeHold", "prc_InsertUser", "prc_UpdateRoomForSale" }; SqlParameter[][] paramArray = { param, param1, param2 }; int result = SqlHelp.ExecuteNonQueryTransaction(commandText, CommandType.StoredProcedure, paramArray); return result; }
public int InsertEmployee(EmployeeModel employee, UserModel user) { SqlParameter[] param = { new SqlParameter("@Name", SqlDbType.VarChar, 20), new SqlParameter("@Sex", SqlDbType.SmallInt), new SqlParameter("@Arrage",SqlDbType.VarChar,20),new SqlParameter("@Address",SqlDbType.VarChar,30), new SqlParameter("@Tel",SqlDbType.VarChar,12),new SqlParameter("@Mobile",SqlDbType.VarChar,12), new SqlParameter("@CardID",SqlDbType.VarChar,18),new SqlParameter("@PhotoPath",SqlDbType.VarChar,255) }; param[0].Value = employee.EmlpoyeeName; param[1].Value = employee.Sex; param[2].Value = employee.Arrage; param[3].Value = employee.Address; param[4].Value = employee.Tel; param[5].Value = employee.Mobile; param[6].Value = employee.CardID; param[7].Value = employee.PhotoPath; SqlParameter[] param1 = { new SqlParameter("@UID", SqlDbType.VarChar, 20), new SqlParameter("@Password", SqlDbType.VarChar,20), new SqlParameter("@UserType",SqlDbType.SmallInt),new SqlParameter("@SubID",SqlDbType.Int) }; param1[0].Value = user.UID; param1[1].Value = user.Password; param1[2].Value = user.UserType; param1[3].Value = user.SubID; string[] commandText = { "prc_InsertEmployee", "prc_InsertUser" }; SqlParameter[][] paramArray = { param, param1 }; int result = SqlHelp.ExecuteNonQueryTransaction(commandText, CommandType.StoredProcedure, paramArray); return result; }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { BaseInfoBLL bll = new BaseInfoBLL(); List<BaseInfoModel> list = bll.ShowBaseInfo(); if (list.Count != 0) { Session["BaseInfoID"] = list[0].ID; BaseName.Text = list[0].HomeName; Amount.Text = list[0].Amount.ToString() + "栋"; BuildArea.Text = list[0].BuildArea.ToString() + "亩"; GreenArea.Text = list[0].GreenArea.ToString() + "亩"; RoadArea.Text = list[0].RoadArea.ToString() + "亩"; ParkArea.Text = list[0].ParkingArea.ToString() + "亩"; BuildDate.Text = list[0].BuildDate.ToString("yyy年MM月dd日"); MainHead.Text = list[0].MainHead; Telephone.Text = list[0].Tel; Address.Text = list[0].Address; BaseMemo.Text = list[0].Memo; } else { Response.Redirect("AddBaseInfo.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); UserName.Text = user.UID; }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); if (Session["BaseInfoID"] != null) Response.Redirect("Default.aspx"); }
protected void Add_Click(object sender, EventArgs e) { EmployeeBLL bll = new EmployeeBLL(); EmployeeModel employee = new EmployeeModel(); UserModel addUser = new UserModel(); UsersBLL userbll = new UsersBLL(); employee.EmlpoyeeName = txtName.Text.Trim(); employee.Sex=Convert.ToInt32(RBLSex.SelectedValue); employee.Arrage = txtArrage.Text.Trim(); employee.Address = txtAddress.Text.Trim(); employee.Tel = txtTel.Text.Trim(); employee.Mobile = txtMobile.Text.Trim(); employee.CardID = txtID.Text.Trim(); if (path == "") { employee.PhotoPath = @"~\Admin\UserHeadImages\Default.jpg"; } else { employee.PhotoPath = path; } if (txtUID.Text.Trim() == "") { addUser.UID = txtID.Text.Trim(); } else { addUser.UID = txtUID.Text.Trim(); } if (txtPassword.Text.Trim() == "") { addUser.Password = txtID.Text.Trim(); } else { addUser.Password = txtPassword.Text.Trim(); } addUser.UserType = 1; addUser.SubID = bll.GetMaxID() + 1; if (userbll.CheckUserByUID(addUser.UID)) { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('用户名已存在!');</script>"); return; } else { bool flag = bll.InsertEmployee(employee, addUser); if (flag) { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加成功');location.href='EmployeeInfo.aspx';</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加失败');</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { DDLPa.DataSource = pabll.GetAllPavilion(); DDLPa.DataBind(); DDLCell.DataSource = bll.GetType("Cell"); DDLCell.DataBind(); DDLLayerBegin.Items.Clear(); DDLLayerEnd.Items.Clear(); PavilionModel pavilion = pabll.GetPavilionByID(DDLPa.SelectedValue); for (int i = 1; i <= pavilion.Layer; i++) { ListItem items = new ListItem(); items.Text = i.ToString(); if (i < 10) { items.Value = "0" + i.ToString(); } else { items.Value = i.ToString(); } DDLLayerBegin.Items.Add(items); DDLLayerEnd.Items.Add(items); } DDLLayerBegin.DataBind(); DDLLayerEnd.DataBind(); if (dttable.Columns.Count == 0) { dttable.Columns.Add("ID", typeof(int)); dttable.Columns.Add("SunnyID", typeof(int)); dttable.Columns.Add("SunnyName", typeof(string)); dttable.Columns.Add("IndoorID", typeof(int)); dttable.Columns.Add("IndoorName", typeof(string)); dttable.Columns.Add("RoomUseID", typeof(int)); dttable.Columns.Add("RoomUseName", typeof(string)); dttable.Columns.Add("RoomFormatID", typeof(int)); dttable.Columns.Add("RoomFormatName", typeof(string)); dttable.Columns.Add("BuildArea", typeof(double)); dttable.Columns.Add("UseArea", typeof(double)); DataColumn[] key = { dttable.Columns["ID"] }; dttable.PrimaryKey = key; } } } }
protected void Save_Click(object sender, EventArgs e) { HomeHoldBLL homebll = new HomeHoldBLL(); HomeHoldModel homeHold = new HomeHoldModel(); UserModel addUser = new UserModel(); UsersBLL userbll = new UsersBLL(); homeHold.Code = DDLRoomID.SelectedValue; homeHold.UserName = txtName.Text.Trim(); homeHold.Tel = txtTelephone.Text.Trim(); homeHold.Contact = txtAddress.Text.Trim(); homeHold.Mobile = txtMobile.Text.Trim(); homeHold.Email = txtEmail.Text.Trim(); homeHold.CardID = txtID.Text.Trim(); homeHold.OwnerID = txtOwnerID.Text.Trim(); homeHold.Unit = txtUnit.Text.Trim(); homeHold.Memo = txtMemo.Text.Trim(); if (txtUID.Text.Trim() == "") { addUser.UID = txtID.Text.Trim(); } else { addUser.UID = txtUID.Text.Trim(); } if (txtPassword.Text.Trim() == "") { addUser.Password = txtID.Text.Trim(); } else { addUser.Password = txtPassword.Text.Trim(); } addUser.UserType = 0; addUser.SubID = homebll.GetMaxID() + 1; if (userbll.CheckUserByUID(addUser.UID)) { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('用户名已存在!');</script>"); return; } else { bool flag = homebll.InsertHomeHold(homeHold, addUser, DDLRoomID.SelectedValue, 1); if (flag) { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加成功');location.href='HomeHoldInfo.aspx';</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "OnSubmit", "<script>alert('添加失败');</script>"); } } }
public bool InsertHomeHold(HomeHoldModel homeHold,UserModel user,string code,int state) { int result; try { result = dal.InsertHomeHold(homeHold, user, code, state); } catch { return false; } return result == 0 ? false : true; }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { txtFileName.Text = DateTime.Now.ToString("yyyyMMddHHmmss") + "Backup"; } } }
public bool InsertEmployee(EmployeeModel employee, UserModel user) { int result; try { result = dal.InsertEmployee(employee, user); } catch { return false; } return result == 0 ? false : true; }
protected void Page_Load(object sender, EventArgs e) { homerepair.ID = Request.QueryString["ID"].ToString(); user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { homerepair = bll.ShowHomeRepairByID(homerepair.ID); lbRepairText.Text = homerepair.RepairText; lbRepairDate.Text = homerepair.RepairDate.ToString("yyy年MM月dd日"); lbRepairMemo.Text = homerepair.RepairMemo; } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { FixGridView.DataSource = bll.GetAllFix(); FixGridView.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { lbCurrentPage.Text = "1"; currentPage = 0; Bind(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { List<HomeReportModel> list = bll.ShowHomeReportByCode(user.Code); HomeReportGridView.DataSource = list; HomeReportGridView.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { List<ChargeFreeTypeModel> list = bll.GetChargeFreeType(); ChargeFreeGridView.DataSource = list; ChargeFreeGridView.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { int id = int.Parse(Request.QueryString["ID"]); NewsModel news = bll.ShowNewsByID(id); txtNoticeTitle.Text = news.Title; ftbContent.Text = news.NoticeContent; } } }
protected void Page_Load(object sender, EventArgs e) { HomeReportModel homereport = new HomeReportModel(); homereport.ID = Request.QueryString["ID"].ToString(); user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); else { homereport = bll.ShowHomeReportByID(homereport.ID); lbReportText.Text = homereport.ReportText; lbReportDate.Text = homereport.ReportDate.ToString("yyy年MM月dd日"); lbReportMemo.Text = homereport.ReportMemo; lbProcessResult.Text = homereport.FinshText; } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { DDLType.DataSource = bll.GetCodeTable(); DDLType.DataBind(); CodeGridView.DataSource = bll.GetTypeByID(Convert.ToInt32(DDLType.SelectedValue)); CodeGridView.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { int parkID = int.Parse(Request.QueryString["ID"]); BaseParkModel basePark = bll.GetBaseParkByID(parkID); txtParkName.Text = basePark.Name; txtParkAmount.Text = basePark.Amount.ToString(); txtMemo.Text = basePark.Memo; } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { int typeID = Convert.ToInt32(Request.QueryString["ID"].ToString()); chargeFeeType = bll.GetChargeFreeTypeByID(typeID); lbName.Text = chargeFeeType.TypeName; lbFormat.Text = chargeFeeType.Format; txtPrice.Text = chargeFeeType.Price.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["ID"].ToString(); user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { homereport = bll.ShowHomeReportByID(id); lbID.Text = homereport.ID; txtTitle.Text = homereport.ReportText; txtMemo.Text = homereport.ReportMemo; } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 0) Response.Redirect("../Login.aspx"); else { int i = bll.GetMaxID(); if (i == -1) { lbID.Text = DateTime.Now.ToString("yyyy-MM-dd") + "BX100001"; } else { lbID.Text = DateTime.Now.ToString("yyyy-MM-dd") + "BX" + (i + 1).ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { string mydir = Server.MapPath("~/Backup") + "\\"; string extname = "*.bak"; foreach (string myfile in Directory.GetFiles(mydir, extname, SearchOption.AllDirectories)) { DDLFileName.Items.Add(Path.GetFileNameWithoutExtension(myfile)); } } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { string fixID = Request.QueryString["ID"].ToString(); FixModel fix = bll.GetFixByID(fixID); lbID.Text = fix.FixID; txtFixName.Text = fix.Name; txtFixAmount.Text = fix.Amount.ToString(); txtFixFactory.Text = fix.Factory; txtFixFactoryDate.Value = fix.FactoryDate.ToString("yyyy-MM-dd"); } } }
protected void Page_Load(object sender, EventArgs e) { user = (UserModel)Session["User"]; if (Session["User"] == null || Session["User"].ToString() == "" || user.UserType != 1) Response.Redirect("../Login.aspx"); else { if (!IsPostBack) { DDLPa.DataSource = pabll.GetAllPavilion(); DDLCell.DataSource = bll.GetType("Cell"); DDLSunny.DataSource = bll.GetType("Sunny"); DDLUse.DataSource = bll.GetType("RoomUse"); DDLFormat.DataSource = bll.GetType("RoomFormat"); DDLIndoor.DataSource = bll.GetType("Indoor"); RoomGridView.DataSource = roombll.GetAllRoom(); DataBind(); } } }