void ValidateLogin() { var context = System.Web.HttpContext.Current; bool returnvalue = false; string username = context.Request.Params["txt_username"]; string password = context.Request.Params["txt_password"]; //判断是否是 登陆成功 password = Eastcom.Common.DeseEncode.DESEncryptMethod(password); Eastcom.Model.v_Sys_User_Info model = new Eastcom.BLL.Sys_User_Info().GetModel(username, password); if (model != null) //登陆成功 { //User_Manage.BLL.SessionConfig.SetUserInfo(model); //System.Web.HttpContext.Current.Session.Timeout = 60; if (Common.SetCookies(PageBase.CookieName, model.UserID.ToString(), 30)) { //success = 1; CommonClass.Cache.CacheClass.Clear(string.Format("RightCacheName_{0}", model.UserID.ToString())); returnvalue = true; } //returnvalue=true; //if (Common.SetCookies(BasePage.BasePage.CookieName, model.UserID.ToString(), 30)) //{ // success = 1; //} } context.Response.Write(returnvalue ? "true" : "false"); }
void Run(HttpContext context) { string GetType = this.TypeName; string GetMethod = this.MethodName; Eastcom.Model.v_Sys_User_Info model = Eastcom.BLL.SessionConfig.GetUserInfo(); Eastcom.Model.Sys_User_Info UserModel = new Eastcom.BLL.Sys_User_Info().GetModel(model.UserID); if (model == null) { throw new Exception("操作超时"); } string returnValue = ""; /*受理*/ if (GetMethod == "Accept")//受理操作 { if (UserModel == null) { returnValue = @"{""Data"":"""",""Message"":""操作超时"",""IsError"":true}"; } else { } returnValue = @"{""Data"":"""",""Message"":""密码修改失败"",""IsError"":true}"; context.Response.Write(returnValue); context.ApplicationInstance.CompleteRequest(); return; } }
private void Form1_Load(object sender, EventArgs e) { DateTime Now = DateTime.Now; string CheckYear = Now.Year.ToString(); string CheckMonth = Now.Month.ToString(); /*每月1号执行*/ if (Now.Day == 1) { List <Eastcom.Model.Sys_User_Info> modelList = new Eastcom.BLL.Sys_User_Info().GetModelList(""); foreach (Eastcom.Model.Sys_User_Info m in modelList) { new DWKS.StartExam.StartExam().GetHTMLValue(CheckYear, CheckMonth, m.UserID.ToString(), m.RealName.ToString()); } } Application.Exit(); }
public void AjaxMethod() { StringBuilder strMsg = new StringBuilder(); int isReload = 0;//0:不刷新父页面 1:刷新父页面 bool IsError = false; string HTMLWriter = ""; switch (this.PageType) //this.PageType { case EnumPageType.修改: string CheckYear = ddl_year.SelectedValue; string CheckMonth = ddl_month.SelectedValue; DataTable dt = new DataTable(); #region // 写遍历 List <Eastcom.Model.Sys_User_Info> modelList = new Eastcom.BLL.Sys_User_Info().GetModelList(""); foreach (Eastcom.Model.Sys_User_Info m in modelList) { HTMLWriter += GetHTMLValue(CheckYear, CheckMonth, m.UserID.ToString(), m.RealName.ToString()); } //Eastcom.Common.MessageBox.ResponseScript(this, "getresult(\"" + HTMLWriter + "\");"); #endregion break; default: strMsg.Append("页面操作类型不明确,操作失败!"); break; } CommonClass.Message.Log.WriteMessage(new CommonClass.Message.GoAjaxPara() { msg = strMsg.ToString(), isReload = isReload, isError = IsError, msnLog = HTMLWriter, Data = null }); }
public void AjaxMethod() { Eastcom.BLL.Sys_User_Info BLL_model_列表 = new Eastcom.BLL.Sys_User_Info(); Eastcom.Model.Sys_User_Info model_列表 = null; StringBuilder strMsg = new StringBuilder(); int isReload = 0;//0:不刷新父页面 1:刷新父页面 bool IsError = false; switch (this.PageType) //this.PageType { case EnumPageType.修改: #region 查看 model_列表 = BLL_model_列表.GetModel(CommonClass.StringHander.Common.GetInt(CurrentUserModel.UserID)); model_列表.Pwd = Eastcom.Common.DeseEncode.DESEncryptMethod(txt_password.Text); if (BLL_model_列表.Update(model_列表)) { IsError = false; strMsg.Append("修改成功!"); } else { IsError = true; strMsg.Append(strMsg); } #endregion break; default: strMsg.Append("页面操作类型不明确,操作失败!"); break; } CommonClass.Message.Log.WriteMessage(new CommonClass.Message.GoAjaxPara() { msg = strMsg.ToString(), isReload = isReload, isError = IsError, msnLog = "", Data = null }); }
public void btn_add_Click(object sender, EventArgs e) { string CheckYear = ddl_year.SelectedValue; string CheckMonth = ddl_month.SelectedValue; string HTMLWriter = ""; DataTable dt = new DataTable(); #region // 写遍历 List <Eastcom.Model.Sys_User_Info> modelList = new Eastcom.BLL.Sys_User_Info().GetModelList(""); foreach (Eastcom.Model.Sys_User_Info m in modelList) { HTMLWriter += GetHTMLValue(CheckYear, CheckMonth, m.UserID.ToString(), m.RealName.ToString()); } Eastcom.Common.MessageBox.ResponseScript(this, "getresult(\"" + HTMLWriter + "\");"); #endregion }
void Run(HttpContext context) { string GetType = this.TypeName; string GetMethod = this.MethodName; string GetLoginPasswordName = this.LoginPasswordName; string GetOldPasswordName = this.OldPasswordName; Eastcom.Model.v_Sys_User_Info model = Eastcom.BLL.SessionConfig.GetUserInfo(); Eastcom.Model.Sys_User_Info UserModel = new Eastcom.BLL.Sys_User_Info().GetModel(model.UserID); string returnValue = ""; if (GetMethod == "GetMyFavorite") { return; } if (GetMethod == "ChangePassword") { if (model == null) { returnValue = @"{""Data"":"""",""Message"":""操作超时"",""IsError"":true}"; } else { if (Eastcom.Common.DeseEncode.DESEncryptMethod(GetOldPasswordName) != UserModel.Pwd) { returnValue = @"{""Data"":"""",""Message"":""密码错误"",""IsError"":true}"; } else { UserModel.Pwd = Eastcom.Common.DeseEncode.DESEncryptMethod(GetLoginPasswordName); if (new Eastcom.BLL.Sys_User_Info().Update(UserModel)) { returnValue = @"{""Data"":"""",""Message"":""密码修改成功""}"; } else { returnValue = @"{""Data"":"""",""Message"":""密码修改失败"",""IsError"":true}"; } } } context.Response.Write(returnValue); context.ApplicationInstance.CompleteRequest(); return; } /*受理*/ if (GetMethod == "Accept")//受理操作 { //if (UserModel == null) //{ // returnValue = @"{""Data"":"""",""Message"":""操作超时"",""IsError"":true}"; //} //else //{ // if (TypeName == "Public") //Public // { // BTSMng.Model.Public_Complaint_Info Model = new Model.Public_Complaint_Info(); // Model = new BLL.Public_Complaint_Info().GetModel(CommonClass.StringHander.Common.GetInt(GetID)); // Model.预处理受理人 = UserModel.RealName; // Model.预处理受理时间 = DateTime.Now; // if (new BLL.Public_Complaint_Info().Update(Model)) // returnValue = string.Format(@"{{""Data"":{{""userName"":""{0}"",""OperDataTime"":""{1}""}},""Message"":""受理成功"",""IsError"":false}}", UserModel.RealName, Model.预处理受理时间.ToString()); // else // returnValue = @"{""Data"":"""",""Message"":""受理失败"",""IsError"":true}"; // } // else if (TypeName == "InSite") //Public // { // BTSMng.Model.InSite_Complaint_Info Model = new Model.InSite_Complaint_Info(); // Model = new BLL.InSite_Complaint_Info().GetModelBy_FK(Common.GetInt(this.GetID), false); // // Model = new BLL.InSite_Complaint_Info().GetModel(CommonClass.StringHander.Common.GetInt(GetID)); // //InterNetComplaint.Model.InSite_Complaint_Info model = new Model.InSite_Complaint_Info(); // //model = bll.GetModelBy_FK(Common.GetInt(this.id), false);//Fk_Id // Model.现场处理受理人 = UserModel.RealName; // Model.现场处理受理时间 = DateTime.Now; // if (new BLL.InSite_Complaint_Info().Update(Model)) // returnValue = string.Format(@"{{""Data"":{{""userName"":""{0}"",""OperDataTime"":""{1}""}},""Message"":""受理成功"",""IsError"":false}}", UserModel.RealName, Model.现场处理受理时间.ToString()); // else // returnValue = @"{""Data"":"""",""Message"":""受理失败"",""IsError"":true}"; // } // else if (TypeName == "Optimization") //Public // { // InterNetComplaint.Model.Optimization_Info Model = new Model.Optimization_Info(); // //Model = new BLL.Optimization_Info().GetModel(CommonClass.StringHander.Common.GetInt(GetID)); // Model = new BLL.Optimization_Info().GetModelBy_FK(Common.GetInt(this.GetID), false); // Model.优化处理受理人 = UserModel.RealName; // Model.优化处理受理时间 = DateTime.Now; // if (new BLL.Optimization_Info().Update(Model)) // returnValue = string.Format(@"{{""Data"":{{""userName"":""{0}"",""OperDataTime"":""{1}""}},""Message"":""受理成功"",""IsError"":false}}", UserModel.RealName, Model.优化处理受理人.ToString()); // else // returnValue = @"{""Data"":"""",""Message"":""受理失败"",""IsError"":true}"; // } // else // returnValue = @"{""Data"":"""",""Message"":""受理失败"",""IsError"":true}"; //} context.Response.Write(returnValue); context.ApplicationInstance.CompleteRequest(); return; } }