public SessionInfo() { // //TODO: 在此处添加构造函数逻辑 // GradeEntity = new USR_GradeMod(); CustomerEntity = new USR_CustomerMod(); }
protected void Page_Load(object sender, EventArgs e) { PageBase m_base = new PageBase(); if (m_user.SysNo != m_base.GetSession().CustomerEntity.SysNo) { ltr_me = "TA"; } m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo); }
/// <summary> /// 得到一个对象实体 /// </summary> public USR_GradeMod GetModel(int SysNo) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SysNo, Name, LevelNum, Exp, DR, TS from USR_Grade"); strSql.Append(" where SysNo=@SysNo "); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int, 4) }; parameters[0].Value = SysNo; USR_GradeMod model = new USR_GradeMod(); DataSet ds = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "") { model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString()); } model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); if (ds.Tables[0].Rows[0]["LevelNum"].ToString() != "") { model.LevelNum = int.Parse(ds.Tables[0].Rows[0]["LevelNum"].ToString()); } if (ds.Tables[0].Rows[0]["Exp"].ToString() != "") { model.Exp = int.Parse(ds.Tables[0].Rows[0]["Exp"].ToString()); } if (ds.Tables[0].Rows[0]["DR"].ToString() != "") { model.DR = int.Parse(ds.Tables[0].Rows[0]["DR"].ToString()); } if (ds.Tables[0].Rows[0]["TS"].ToString() != "") { model.TS = DateTime.Parse(ds.Tables[0].Rows[0]["TS"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(USR_GradeMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into USR_Grade("); strSql.Append("Name,LevelNum,Exp)"); strSql.Append(" values ("); strSql.Append("@Name,@LevelNum,@Exp)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@Name",SqlDbType.NVarChar,200), new SqlParameter("@LevelNum",SqlDbType.Int,4), new SqlParameter("@Exp",SqlDbType.Int,4), new SqlParameter("@DR",SqlDbType.TinyInt,1), new SqlParameter("@TS",SqlDbType.DateTime), }; if (model.Name != AppConst.StringNull) parameters[0].Value = model.Name; else parameters[0].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[0]); if (model.LevelNum != AppConst.IntNull) parameters[1].Value = model.LevelNum; else parameters[1].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[1]); if (model.Exp != AppConst.IntNull) parameters[2].Value = model.Exp; else parameters[2].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[2]); if (model.DR != AppConst.IntNull) parameters[3].Value = model.DR; else parameters[3].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[3]); if (model.TS != AppConst.DateTimeNull) parameters[4].Value = model.TS; else parameters[4].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[4]); return SqlHelper.ExecuteNonQuery(cmd,parameters); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { try { m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Request.QueryString["id"])); if (m_user.SysNo == AppConst.IntNull) { ShowError(""); } } catch { ShowError(""); } } else if (Page.RouteData.Values["id"] != null) { try { m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Page.RouteData.Values["id"].ToString())); if (m_user.SysNo == AppConst.IntNull) { ShowError(""); } } catch { ShowError(""); } } else { Login(Request.Url.ToString()); m_user = USR_CustomerBll.GetInstance().GetModel(GetSession().CustomerEntity.SysNo); m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo); } try { if (!IsPostBack) { if (m_user.HomeTown != AppConst.IntNull) { SYS_DistrictMod m_dictrict = SYS_DistrictBll.GetInstance().GetModel(SYS_DistrictBll.GetInstance().GetModel(m_user.HomeTown).UpSysNo); ltrFrom.Text = m_dictrict.Name; } else { ltrFrom.Text = "未知"; } if (m_user.Birth != AppConst.DateTimeNull) { ltrBirth.Text = "生日:" + m_user.Birth.ToString("yyyy年MM月dd日"); } else { ltrBirth.Text = "生日:未知"; } BindArticles(); BindBestAnswer(); BindIcons(); LinkButton1_Click(LinkButton1, e); } if (GetSession().CustomerEntity != null && GetSession().CustomerEntity.SysNo != AppConst.IntNull && m_user.SysNo == GetSession().CustomerEntity.SysNo) { ltrMe = "我"; sendmsg.Visible = false; intro.HRef = AppConfig.HomeUrl() + "Qin/UserInfo.aspx?id=" + m_user.SysNo + "&tab=1"; ImageButton1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo; } else { ltrMe = "Ta"; intro.Visible = false; sendmsg.HRef = AppConfig.HomeUrl() + "Qin/MsgDetail.aspx?UserSysNo=" + m_user.SysNo; ImageButton1.ImageUrl = AppConfig.HomeUrl()+"ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo; ImageButton1.Enabled = false; } RightPannel1.m_user = m_user; RightPannel1.m_grade = m_grade; } catch { ShowError(""); } if (Request.QueryString["pn"] != null) { try { pageindex = int.Parse(Request.QueryString["pn"]); } catch { } } if (Request.QueryString["tab"] != null) { try { tab = int.Parse(Request.QueryString["tab"]); } catch { } } }
protected void BindData() { try { if (m_qustion.DR != (int)AppEnum.State.normal) { ShowError(""); } m_qustion.ReadCount++; QA_QuestionBll.GetInstance().Update(m_qustion); ltrTitle.Text = m_qustion.Title; ltrContext.Text = m_qustion.Context; ltrAward.Text = m_qustion.Award.ToString(); ltrReply.Text = m_qustion.ReplyCount.ToString(); ltrViewNum.Text = m_qustion.ReadCount.ToString(); USR_CustomerMod m_user = USR_CustomerBll.GetInstance().GetModel(m_qustion.CustomerSysNo); USR_GradeMod m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo); ltrNickName.Text = m_user.NickName; ltrQALevel.Text = m_grade.Name; ltrTotalReply.Text = m_user.TotalReply.ToString(); ltrTotalAsk.Text = m_user.TotalQuest.ToString(); Image1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=t&id=" + m_user.Photo; #region 显示命盘 FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(SysNo); if (m_chart != null && m_chart.SysNo != AppConst.IntNull) { if (GetSession().CustomerEntity == null || GetSession().CustomerEntity.SysNo == AppConst.IntNull) { Astro1.input = m_chart; Astro1.Visible = true; } else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.ziwei) { Ziwei1.input = m_chart; Ziwei1.Visible = true; } else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.bazi) { Bazi1.input = m_chart; Bazi1.Visible = true; } else { Astro1.input = m_chart; Astro1.Visible = true; } } #endregion #region 绑定原报价单信息 if (order != 0) { TextBox2.Text = old_order.Words.ToString(); TextBox2.ReadOnly = true; TextBox3.Text = old_order.Price.ToString(); TextBox3.ReadOnly = true; txtDescription.Text = old_order.Description; txtDescription.ReadOnly = true; txtTrial.Text = old_order.Trial; txtTrial.ReadOnly = true; } else { //发布报价单时隐藏结果输入框 resulttitle.Visible = false; resultcontent.Visible = false; } #endregion } catch { ShowError(""); } }
protected void BindData() { try { if (m_qustion.DR != (int)AppEnum.State.normal) { ShowError(""); } m_qustion.ReadCount++; QA_QuestionBll.GetInstance().Update(m_qustion); ltrTitle.Text = m_qustion.Title; ltrContext.Text = m_qustion.Context; ltrAward.Text = m_qustion.Award.ToString(); ltrReply.Text = m_qustion.ReplyCount.ToString(); ltrTime.Text = m_qustion.TS.ToString("yyyy-MM-dd HH:mm:ss"); ltrViewNum.Text = m_qustion.ReadCount.ToString(); if (GetSession().CustomerEntity.SysNo == m_qustion.CustomerSysNo) { LinkButton5.Style["display"] = ""; ltrTime.Text += " | "; } USR_CustomerMod m_user = USR_CustomerBll.GetInstance().GetModel(m_qustion.CustomerSysNo); USR_GradeMod m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo); ltrNickName.Text = m_user.NickName; ltrQALevel.Text = m_grade.Name; ltrTotalReply.Text = m_user.TotalReply.ToString(); ltrTotalAsk.Text = m_user.TotalQuest.ToString(); Image1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=t&id=" + m_user.Photo; #region 显示命盘 FATE_ChartMod m_chart = QA_QuestionBll.GetInstance().GetChartByQuest(SysNo); if (m_chart != null && m_chart.SysNo != AppConst.IntNull) { if (GetSession().CustomerEntity == null || GetSession().CustomerEntity.SysNo == AppConst.IntNull) { Astro1.input = m_chart; Astro1.Visible = true; } else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.ziwei) { Ziwei1.input = m_chart; Ziwei1.Visible = true; } else if (GetSession().CustomerEntity.FateType == (int)AppEnum.FateType.bazi) { Bazi1.input = m_chart; Bazi1.Visible = true; } else { Astro1.input = m_chart; Astro1.Visible = true; } } #endregion BindList(); } catch { ShowError(""); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(USR_GradeMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into USR_Grade("); strSql.Append("Name,LevelNum,Exp)"); strSql.Append(" values ("); strSql.Append("@Name,@LevelNum,@Exp)"); strSql.Append(";select SCOPE_IDENTITY()"); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@Name", SqlDbType.NVarChar, 200), new SqlParameter("@LevelNum", SqlDbType.Int, 4), new SqlParameter("@Exp", SqlDbType.Int, 4), new SqlParameter("@DR", SqlDbType.TinyInt, 1), new SqlParameter("@TS", SqlDbType.DateTime), }; if (model.Name != AppConst.StringNull) { parameters[0].Value = model.Name; } else { parameters[0].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[0]); if (model.LevelNum != AppConst.IntNull) { parameters[1].Value = model.LevelNum; } else { parameters[1].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[1]); if (model.Exp != AppConst.IntNull) { parameters[2].Value = model.Exp; } else { parameters[2].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[2]); if (model.DR != AppConst.IntNull) { parameters[3].Value = model.DR; } else { parameters[3].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[3]); if (model.TS != AppConst.DateTimeNull) { parameters[4].Value = model.TS; } else { parameters[4].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[4]); return(SqlHelper.ExecuteNonQuery(cmd, parameters)); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(USR_GradeMod model) { dal.Update(model); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(USR_GradeMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update USR_Grade set "); strSql.Append("Name=@Name,"); strSql.Append("LevelNum=@LevelNum,"); strSql.Append("Exp=@Exp,"); strSql.Append("DR=@DR,"); strSql.Append("TS=@TS"); strSql.Append(" where SysNo=@SysNo "); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@SysNo",SqlDbType.Int,4), new SqlParameter("@Name",SqlDbType.NVarChar,200), new SqlParameter("@LevelNum",SqlDbType.Int,4), new SqlParameter("@Exp",SqlDbType.Int,4), new SqlParameter("@DR",SqlDbType.TinyInt,1), new SqlParameter("@TS",SqlDbType.DateTime) }; if (model.SysNo != AppConst.IntNull) parameters[0].Value = model.SysNo; else parameters[0].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[0]); if (model.Name != AppConst.StringNull) parameters[1].Value = model.Name; else parameters[1].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[1]); if (model.LevelNum != AppConst.IntNull) parameters[2].Value = model.LevelNum; else parameters[2].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[2]); if (model.Exp != AppConst.IntNull) parameters[3].Value = model.Exp; else parameters[3].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[3]); if (model.DR != AppConst.IntNull) parameters[4].Value = model.DR; else parameters[4].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[4]); if (model.TS != AppConst.DateTimeNull) parameters[5].Value = model.TS; else parameters[5].Value = System.DBNull.Value; cmd.Parameters.Add(parameters[5]); return SqlHelper.ExecuteNonQuery(cmd,parameters); }
/// <summary> /// 得到一个对象实体 /// </summary> public USR_GradeMod GetModel(int SysNo) { StringBuilder strSql = new StringBuilder(); strSql.Append("select SysNo, Name, LevelNum, Exp, DR, TS from USR_Grade"); strSql.Append(" where SysNo=@SysNo "); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int,4 ) }; parameters[0].Value = SysNo; USR_GradeMod model = new USR_GradeMod(); DataSet ds = SqlHelper.ExecuteDataSet(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["SysNo"].ToString() != "") { model.SysNo = int.Parse(ds.Tables[0].Rows[0]["SysNo"].ToString()); } model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); if (ds.Tables[0].Rows[0]["LevelNum"].ToString() != "") { model.LevelNum = int.Parse(ds.Tables[0].Rows[0]["LevelNum"].ToString()); } if (ds.Tables[0].Rows[0]["Exp"].ToString() != "") { model.Exp = int.Parse(ds.Tables[0].Rows[0]["Exp"].ToString()); } if (ds.Tables[0].Rows[0]["DR"].ToString() != "") { model.DR = int.Parse(ds.Tables[0].Rows[0]["DR"].ToString()); } if (ds.Tables[0].Rows[0]["TS"].ToString() != "") { model.TS = DateTime.Parse(ds.Tables[0].Rows[0]["TS"].ToString()); } return model; } else { return null; } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(USR_GradeMod model) { return dal.Add(model); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { try { m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Request.QueryString["id"])); if (m_user.SysNo == AppConst.IntNull) { ShowError(""); } } catch { ShowError(""); } } else if (Page.RouteData.Values["id"] != null) { try { m_user = USR_CustomerBll.GetInstance().GetModel(int.Parse(Page.RouteData.Values["id"].ToString())); if (m_user.SysNo == AppConst.IntNull) { ShowError(""); } } catch { ShowError(""); } } else { Login(Request.Url.ToString()); m_user = USR_CustomerBll.GetInstance().GetModel(GetSession().CustomerEntity.SysNo); m_grade = USR_GradeBll.GetInstance().GetModel(m_user.GradeSysNo); } try { if (!IsPostBack) { if (m_user.HomeTown != AppConst.IntNull) { SYS_DistrictMod m_dictrict = SYS_DistrictBll.GetInstance().GetModel(SYS_DistrictBll.GetInstance().GetModel(m_user.HomeTown).UpSysNo); ltrFrom.Text = m_dictrict.Name; } else { ltrFrom.Text = "未知"; } if (m_user.Birth != AppConst.DateTimeNull) { ltrBirth.Text = "生日:" + m_user.Birth.ToString("yyyy年MM月dd日"); } else { ltrBirth.Text = "生日:未知"; } BindArticles(); BindBestAnswer(); BindIcons(); LinkButton1_Click(LinkButton1, e); } if (GetSession().CustomerEntity != null && GetSession().CustomerEntity.SysNo != AppConst.IntNull && m_user.SysNo == GetSession().CustomerEntity.SysNo) { ltrMe = "我"; sendmsg.Visible = false; intro.HRef = AppConfig.HomeUrl() + "Qin/UserInfo.aspx?id=" + m_user.SysNo + "&tab=1"; ImageButton1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo; } else { ltrMe = "Ta"; intro.Visible = false; sendmsg.HRef = AppConfig.HomeUrl() + "Qin/MsgDetail.aspx?UserSysNo=" + m_user.SysNo; ImageButton1.ImageUrl = AppConfig.HomeUrl() + "ControlLibrary/ShowPhoto.aspx?type=o&id=" + m_user.Photo; ImageButton1.Enabled = false; } RightPannel1.m_user = m_user; RightPannel1.m_grade = m_grade; } catch { ShowError(""); } if (Request.QueryString["pn"] != null) { try { pageindex = int.Parse(Request.QueryString["pn"]); } catch { } } if (Request.QueryString["tab"] != null) { try { tab = int.Parse(Request.QueryString["tab"]); } catch { } } }
/// <summary> /// 更新一条数据 /// </summary> public int Update(USR_GradeMod model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update USR_Grade set "); strSql.Append("Name=@Name,"); strSql.Append("LevelNum=@LevelNum,"); strSql.Append("Exp=@Exp,"); strSql.Append("DR=@DR,"); strSql.Append("TS=@TS"); strSql.Append(" where SysNo=@SysNo "); SqlCommand cmd = new SqlCommand(strSql.ToString()); SqlParameter[] parameters = { new SqlParameter("@SysNo", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 200), new SqlParameter("@LevelNum", SqlDbType.Int, 4), new SqlParameter("@Exp", SqlDbType.Int, 4), new SqlParameter("@DR", SqlDbType.TinyInt, 1), new SqlParameter("@TS", SqlDbType.DateTime) }; if (model.SysNo != AppConst.IntNull) { parameters[0].Value = model.SysNo; } else { parameters[0].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[0]); if (model.Name != AppConst.StringNull) { parameters[1].Value = model.Name; } else { parameters[1].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[1]); if (model.LevelNum != AppConst.IntNull) { parameters[2].Value = model.LevelNum; } else { parameters[2].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[2]); if (model.Exp != AppConst.IntNull) { parameters[3].Value = model.Exp; } else { parameters[3].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[3]); if (model.DR != AppConst.IntNull) { parameters[4].Value = model.DR; } else { parameters[4].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[4]); if (model.TS != AppConst.DateTimeNull) { parameters[5].Value = model.TS; } else { parameters[5].Value = System.DBNull.Value; } cmd.Parameters.Add(parameters[5]); return(SqlHelper.ExecuteNonQuery(cmd, parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(USR_GradeMod model) { return(dal.Add(model)); }