public static Model.RegisterUser GetModel(int ID) { string strSql = "select * from RegisterUser where ID = '" + ID + "'"; Model.RegisterUser model = new Model.RegisterUser(); DataSet ds = DBHelperSQL.GetDataSet(strSql, connectionString); model.ID = ID; if (ds.Tables[0].Rows.Count > 0) { model.UserName = Convert.ToString(ds.Tables[0].Rows[0]["UserName"]); model.PassWord = Convert.ToString(ds.Tables[0].Rows[0]["PassWord"]); model.Email = Convert.ToString(ds.Tables[0].Rows[0]["Email"]); model.Phone = Convert.ToString(ds.Tables[0].Rows[0]["Phone"]); model.RegTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["RegTime"]); model.LastLoginTime = Convert.ToDateTime(ds.Tables[0].Rows[0]["LastLoginTime"]); model.TryLoginTimes = Convert.ToInt32(ds.Tables[0].Rows[0]["TryLoginTimes"]); model.CertifiationStatus = Convert.ToInt32(ds.Tables[0].Rows[0]["CertifiationStatus"]); model.CertifiationIndex = Convert.ToString(ds.Tables[0].Rows[0]["CertifiationIndex"]); model.UserType = Convert.ToInt32(ds.Tables[0].Rows[0]["UserType"]); model.IsEnable = Convert.ToInt32(ds.Tables[0].Rows[0]["IsEnable"]); model.BelongArea = Convert.ToString(ds.Tables[0].Rows[0]["BelongArea"]); return(model); } else { return(null); } }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] == "register") { Model.RegisterUser registeruser = new Model.RegisterUser(); registeruser.UserName = Request.Form["username"]; registeruser.PassWord = Request.Form["password"]; registeruser.Email = Request.Form["email"]; registeruser.Phone = Request.Form["phone"]; registeruser.RegTime = DateTime.Now; registeruser.LastLoginTime = DateTime.Now; registeruser.TryLoginTimes = 0; registeruser.CertifiationStatus = 0; registeruser.CertifiationIndex = ""; registeruser.UserType = 1; registeruser.IsEnable = 1; DAL.RegisterUser.Add(registeruser); Response.Write("1"); Response.End(); } if (Request["action"] == "check_username") { if (DAL.RegisterUser.Exists(Request["username"])) { Response.Write("用户名已存在"); Response.End(); } else { Response.Write("true"); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["name"] != "" && Request["name"] != null) { Label1.Text = Request["name"];//要续费的用户名 Session["OrderName"] = Label1.Text; } if (Request["action"] == "order") { Model.OrderList orderlist = new Model.OrderList(); orderlist.UserName = Session["OrderName"].ToString(); Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); orderlist.WorkArea = registerUser.BelongArea; orderlist.OrderNumber = DateTime.Now.ToString("yyyMMddhhmmssfff"); //将订单号存储在session里面用于整个订单的操作流程。 Session["OrderNumber"] = orderlist.OrderNumber; orderlist.SubmitTime = DateTime.Now; orderlist.AccountNum = Convert.ToInt32(Request["applynum"]); orderlist.ServiceDuration = Request["time"].ToString(); orderlist.ServerType = Request["servertype"].ToString(); orderlist.Price = Request["price"].ToString(); string[] otherserver = Request["otherserver"].ToString().Split(','); if (Array.IndexOf(otherserver, "CoorTransEnable") != -1) { orderlist.CoorSystemEnable = 1; } if (Array.IndexOf(otherserver, "HeightTransEnable") != -1) { orderlist.HeightTransEnable = 1; } if (Array.IndexOf(otherserver, "SHPTransEnable") != -1) { orderlist.SHPTransEnable = 1; } if (Array.IndexOf(otherserver, "ObsQualityEnable") != -1) { orderlist.ObsQualityEnable = 1; } //Model.SysLog syslog = new Model.SysLog(); //syslog.LogTime = DateTime.Now; //syslog.LogType = 5; //syslog.Remark = "申请的服务订单待处理"; //syslog.UserName = orderlist.UserName; //DAL.SysLog.Add(syslog); if (DAL.OrderList.Add(orderlist)) { Response.Write(orderlist.OrderNumber); Response.End(); } else { Response.Write("200"); Response.End(); } } }
[WebMethod] //方法前边必须添加 [WebMethod] public static string GetValueAjax(string t) //这个方法需要是静态的方法要用到关键字static { //在这里可以对传进来的参数进行任何操作 string text = t; string strJson1 = string.Empty; Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(rtkID); registerUser.CertifiationStatus = 5; DAL.RegisterUser.Update(registerUser); string aa = ""; string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "用户您好:您的CORS账号资质认证申请未通过原因是:" + t; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", registerUser.Phone); if (cs.HttpHelper.SendSMS(SMS)) { aa = "发送成功!"; } else { aa = "发送失败!"; cs.WebLogger.WriteErroLog("资质认证审未通过核短信发送错误"); //输出到文件中 } return(aa); }
private int Verifycompanyform() { Model.PersonInfo personinfo = new Model.PersonInfo(); personinfo.BelongArea = Request.Form["city"]; personinfo.Contact = Request.Form["contact_name"]; personinfo.ContactIDCardFile = corporate_id_card_front; personinfo.ContactIDCardNumber = corporate_id_card_reverse; DAL.PersonInfo.Add(personinfo); Model.PersonInfo temp_personinfo = DAL.PersonInfo.GetModel(); Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.CertifiationIndex = temp_personinfo.ID.ToString(); registeruser.CertifiationStatus = 3; DAL.RegisterUser.Update(registeruser); string json = "{\"code\":200}"; Response.Write(json); Response.End(); //select top 1 * from tra.dbo.订单 order by 下单时间 desc --时间倒序排列取第一条 // companyinfo. //string map_level = Request.Form["map_level"]; //string corporate = Request.Form["corporate"]; //string province = Request.Form["province"]; //string city = Request.Form["city"]; //string town = Request.Form["town"]; //string address = Request.Form["address"]; //string post_code = Request.Form["post_code"]; //string contact_phone = Request.Form["contact_phone"]; //string contact_email = Request.Form["contact_email"]; //string contact_qq = Request.Form["contact_qq"]; //string contact_wechat = Request.Form["contact_wechat"]; return(1); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } if (Session["UserType"] != null && Session["UserType"].ToString() == "2") { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); cityType.Items.Clear(); cityType.Items.Add(registerUser.BelongArea); cityType.Value = registerUser.BelongArea; belongArea = registerUser.BelongArea; } if (Request["action"] != null && Request["action"] == "GetData") { if (!GetData()) { Response.Write("0"); } } if (Request["action"] != null && Request["action"] == "DeleteCors") { DeleteCors(); } if (Request["qualificationCertifyId"] != null && Request["status"] != null) { qualificationCertifyCheck(Request["qualificationCertifyId"].ToString(), Request["status"].ToString()); } if (Request["action"] != null && Request["action"] == "DownloadAll") { DownloadAll(); } }
//public static string[] zhengzhouCity = { "郑州市", "开封市", "三门峡市", "洛阳市", "焦作市", "新乡市", "鹤壁市", "安阳市", "濮阳市", "商丘市", "许昌市", "漯河市", "平顶山市", "南阳市", "信阳市", "周口市", "驻马店市" }; protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "1"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 1 || Convert.ToInt32(Session["UserType"]) > 3) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } //如果是用户登录,则隐藏分区域栏 if (Session["UserType"].ToString() == "1") { cityType.Items.Clear(); cityType.Items.Add("全部"); cityType.Value = "全部"; dataType.Items.Clear(); dataType.Items.Add("企业用户"); dataType.Value = "企业用户"; rtkUserNum.InnerText = DAL.RTKUserInfo.GetList("RegisterUserName='******'").Tables[0].Rows.Count.ToString(); normalRtkUserNum.Visible = false; //toolbar.Attributes.CssStyle.Value = "display:none"; } else { rtkUserNum.InnerText = DAL.RTKUserInfo.GetList("1=1").Tables[0].Rows.Count.ToString(); normalRtkUserNum.InnerText = DAL.RTKUserPurview.GetList("EndTime>'" + DateTime.Now + "'").Tables[0].Rows.Count.ToString(); } //fd.Visible = false; //toolbar.Attributes.CssStyle.Value = "display:none"; //toolbar.Visible = false; //toolbar.Style.Add(HtmlTextWriterStyle.Display, "none"); //toolbar.Style["display"] = "none"; if (Session["UserType"] != null && Session["UserType"].ToString() == "2") { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); cityType.Items.Clear(); cityType.Items.Add(registerUser.BelongArea); cityType.Value = registerUser.BelongArea; belongArea = registerUser.BelongArea; } if (Request["action"] != null && Request["action"] == "GetData") { if (!GetData()) { Response.Write("0"); } } if (Request["action"] != null && Request["action"] == "DeleteCors") { DeleteCors(); } if (Request["action"] != null && Request["action"] == "DownloadAll") { DownloadAll(); } }
private void qualificationCertifyCheck(string qualificationCertifyId, string status) { rtkID = Convert.ToInt32(qualificationCertifyId); Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Convert.ToInt32(qualificationCertifyId)); if (status == "OK") { //1为单位认证中,加1就是2认证通过 3为个人认证中,加1就是4认证通过 if (registerUser.CertifiationStatus == 1) { registerUser.CertifiationStatus = 2; } if (registerUser.CertifiationStatus == 6) { registerUser.CertifiationStatus = 2; } // string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "用户您好:您的CORS账号资质认证申请已通过,可以登录系统进行查看!"; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", registerUser.Phone); if (cs.HttpHelper.SendSMS(SMS)) { } else { cs.WebLogger.WriteErroLog("资质认证审核成功短信发送错误"); //输出到文件中 } } else { //认证失败就是5 registerUser.CertifiationStatus = 5; //string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; //string message = "用户您好:您的CORS账号资质认证申请未通过,可以登录系统进行查看!"; //SMS = SMS.Replace("@message", message); //SMS = SMS.Replace("@phone", registerUser.Phone); //if (cs.HttpHelper.SendSMS(SMS)) //{ //} //else //{ // cs.WebLogger.WriteErroLog("资质认证审未通过核短信发送错误"); //输出到文件中 //} } DAL.RegisterUser.Update(registerUser); }
protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "3"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 2 || Convert.ToInt32(Session["UserType"]) > 3) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/login/login.aspx\";</script>"); Response.End(); } if (Request["action"] == "username_judge") { Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); if (registeruser.CertifiationIndex != "") { //location.href = location.origin+\"/forms/cors.aspx\"; Response.Write("<script>alert(\"认证审核中,请等待\");</script>"); Response.End(); } else { Response.Write("unregister"); Response.End(); } } if (!IsPostBack) { UserName.InnerText = Session["UserName"].ToString(); if (Session["UserType"].ToString() == "1") { UserType.InnerText = "普通用户"; } else { UserType.InnerText = "超级管理员"; } string search = ""; string strwhere = ""; strwhere = " LogType= 5 "; unreadMailNum = DAL.SysLog.GetRecordCount(search, strwhere).ToString(); if (unreadMailNum == "0") { unreadMailNum = ""; } } }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] == "getcode") { string code; Bitmap bmp = cs.VerifyCodeHelper.CreateVerifyCodeBmp(out code); Bitmap newbmp = new Bitmap(bmp, 108, 36); Session["VerifyCode"] = code; Response.Clear(); Response.ContentType = "image/bmp"; newbmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Bmp); } if (Request["action"] == "login") { string VerifyCode = Request["VerifyCode"]; string username = Request["UserName"]; string password = Request["PassWord"]; string code = Session["VerifyCode"].ToString(); if (VerifyCode.ToLower() != code.ToLower()) { Response.Write("-1"); Response.End(); } Model.RegisterUser registeruser = new Model.RegisterUser(); if (DAL.RegisterUser.Exists(username)) { registeruser = DAL.RegisterUser.GetModel(username); } else { Response.Write("-2"); Response.End(); } if (registeruser.PassWord == password) { Session["UserType"] = DAL.RegisterUser.GetModel(username).UserType; Session["UserName"] = username; Response.Write("1"); Response.End(); } else { Response.Write("0"); Response.End(); } } }
/// <summary> /// 更新一条数据,根据ID /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool Update(Model.RegisterUser model) { string strSql = "update RegisterUser set UserName=@UserName, PassWord=@PassWord, Email=@Email, Phone=@Phone, RegTime=@RegTime, LastLoginTime=@LastLoginTime, TryLoginTimes=@TryLoginTimes, CertifiationStatus=@CertifiationStatus, CertifiationIndex=@CertifiationIndex, UserType=@UserType, IsEnable=@IsEnable where ID = " + model.ID.ToString(); SqlParameter UserName = new SqlParameter("UserName", SqlDbType.NVarChar); UserName.Value = model.UserName; SqlParameter PassWord = new SqlParameter("PassWord", SqlDbType.NVarChar); PassWord.Value = model.PassWord; SqlParameter Email = new SqlParameter("Email", SqlDbType.NVarChar); Email.Value = model.Email; SqlParameter Phone = new SqlParameter("Phone", SqlDbType.NVarChar); Phone.Value = model.Phone; SqlParameter RegTime = new SqlParameter("RegTime", SqlDbType.DateTime); RegTime.Value = model.RegTime; SqlParameter LastLoginTime = new SqlParameter("LastLoginTime", SqlDbType.DateTime); LastLoginTime.Value = model.LastLoginTime; SqlParameter TryLoginTimes = new SqlParameter("TryLoginTimes", SqlDbType.Int); TryLoginTimes.Value = model.TryLoginTimes; SqlParameter CertifiationStatus = new SqlParameter("CertifiationStatus", SqlDbType.Int); CertifiationStatus.Value = model.CertifiationStatus; SqlParameter CertifiationIndex = new SqlParameter("CertifiationIndex", SqlDbType.NVarChar); CertifiationIndex.Value = model.CertifiationIndex; SqlParameter UserType = new SqlParameter("UserType", SqlDbType.Int); UserType.Value = model.UserType; SqlParameter IsEnable = new SqlParameter("IsEnable", SqlDbType.Int); IsEnable.Value = model.IsEnable; return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { UserName, PassWord, Email, Phone, RegTime, LastLoginTime, TryLoginTimes, CertifiationStatus, CertifiationIndex, UserType, IsEnable }, connectionString) == 1 ? true : false); }
private int Verifycompanyform() { Model.CompanyInfo companyinfo = new Model.CompanyInfo(); companyinfo.Address = Request.Form["address"]; companyinfo.BelongArea = Request.Form["city"]; companyinfo.BusinessLicense = business_licence_path; companyinfo.Company = Request.Form["company_name"]; companyinfo.CompanyTel = Request.Form["corporate_tel"]; companyinfo.Contact = Request.Form["contact_name"]; companyinfo.ContactIDCardFile = operator_id_card_front; companyinfo.ContactIDCardNumer = ""; companyinfo.Industry = Request.Form["company_type_id"]; companyinfo.LegalIDCardFile = corporate_id_card_front; companyinfo.LegalIDCardNumber = ""; companyinfo.LegalPerson = Request.Form["corporate"]; companyinfo.OrganizationCode = Request.Form["business_licence"]; companyinfo.PowerOfAttorney = client_authorization_path; companyinfo.SurveyingFile = map_qualification_path; companyinfo.SurveyingNumber = Request.Form["map_qualification_sn"]; companyinfo.SurveyingQualification = Request.Form["map_level"]; DAL.CompanyInfo.Add(companyinfo); Model.CompanyInfo temp_companyinfo = DAL.CompanyInfo.GetModel(); Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.CertifiationIndex = temp_companyinfo.ID.ToString(); registeruser.CertifiationStatus = 1; DAL.RegisterUser.Update(registeruser); string json = "{\"code\":200}"; Response.Write(json); Response.End(); //select top 1 * from tra.dbo.订单 order by 下单时间 desc --时间倒序排列取第一条 // companyinfo. //string map_level = Request.Form["map_level"]; //string corporate = Request.Form["corporate"]; //string province = Request.Form["province"]; //string city = Request.Form["city"]; //string town = Request.Form["town"]; //string address = Request.Form["address"]; //string post_code = Request.Form["post_code"]; //string contact_phone = Request.Form["contact_phone"]; //string contact_email = Request.Form["contact_email"]; //string contact_qq = Request.Form["contact_qq"]; //string contact_wechat = Request.Form["contact_wechat"]; return(1); }
/// <summary> /// 增加一个用户信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public static bool Add(Model.RegisterUser model) { string strSql = "insert into RegisterUser(UserName,PassWord,Email,Phone,RegTime,LastLoginTime,TryLoginTimes,CertifiationStatus,CertifiationIndex,UserType,IsEnable,BelongArea) values(@UserName,@PassWord,@Email,@Phone,@RegTime,@LastLoginTime,@TryLoginTimes,@CertifiationStatus,@CertifiationIndex,@UserType,@IsEnable,@BelongArea)"; SqlParameter UserName = new SqlParameter("UserName", SqlDbType.NVarChar); UserName.Value = model.UserName; SqlParameter PassWord = new SqlParameter("PassWord", SqlDbType.NVarChar); PassWord.Value = model.PassWord; SqlParameter Email = new SqlParameter("Email", SqlDbType.NVarChar); Email.Value = model.Email; SqlParameter Phone = new SqlParameter("Phone", SqlDbType.NVarChar); Phone.Value = model.Phone; SqlParameter RegTime = new SqlParameter("RegTime", SqlDbType.DateTime); RegTime.Value = model.RegTime; SqlParameter LastLoginTime = new SqlParameter("LastLoginTime", SqlDbType.DateTime); LastLoginTime.Value = model.LastLoginTime; SqlParameter TryLoginTimes = new SqlParameter("TryLoginTimes", SqlDbType.Int); TryLoginTimes.Value = model.TryLoginTimes; SqlParameter CertifiationStatus = new SqlParameter("CertifiationStatus", SqlDbType.Int); CertifiationStatus.Value = model.CertifiationStatus; SqlParameter CertifiationIndex = new SqlParameter("CertifiationIndex", SqlDbType.NVarChar); CertifiationIndex.Value = model.CertifiationIndex; SqlParameter UserType = new SqlParameter("UserType", SqlDbType.Int); UserType.Value = model.UserType; SqlParameter IsEnable = new SqlParameter("IsEnable", SqlDbType.Int); IsEnable.Value = model.IsEnable; SqlParameter BelongArea = new SqlParameter("BelongArea", SqlDbType.NVarChar); BelongArea.Value = model.BelongArea; return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { UserName, PassWord, Email, Phone, RegTime, LastLoginTime, TryLoginTimes, CertifiationStatus, CertifiationIndex, UserType, IsEnable, BelongArea }, connectionString) == 1 ? true : false); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } if (Request["action"] == null) { string id = Request["id"]; Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(int.Parse(id)); userName.Value = registerUser.UserName; belongArea.Value = registerUser.BelongArea; oldPassword.Value = registerUser.PassWord; } if (Request["action"] != null) { string inf = Request["action"].ToString().Trim(); string[] a = inf.Split('}'); if (a.Length == 2 && a[1] != "") { //string usr = a[1]; //string pas = a[2]; string tempPassWord = AES_Key.AESEncrypt(a[1], a[0].PadLeft(16, '0')); // string aa = AES_Key.AESDecrypt(tempPassWord, a[0].PadLeft(16, '0')); Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(a[0]); registerUser.PassWord = tempPassWord; DAL.RegisterUser.Update(registerUser); Response.Clear(); Response.Write("1"); Response.End(); } else { Response.Clear(); Response.Write("0"); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 2 || Convert.ToInt32(Session["UserType"]) > 3) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } if (Session["UserType"] != null && Session["UserType"].ToString() == "2") { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); cityType.Items.Clear(); cityType.Items.Add(registerUser.BelongArea); cityType.Value = registerUser.BelongArea; belongArea = registerUser.BelongArea; } if (Request["action"] != null && Request["action"] == "GetData") { GetCors(); } if (Request["action"] != null && Request["action"] == "DeleteCors") { DeleteCors(); } if (Request["id"] != null) { Model.OrderList orderlist = DAL.OrderList.GetModel(Convert.ToInt32(Request["id"])); string img_path = orderlist.TransferCertificate; Response.Write("<img src='" + img_path + "' />"); Response.End(); } if (Request["verify"] != null) { AddData(); } if (Request["action"] != null && Request["action"] == "DownloadAll") { DownloadAll(); } }
protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "3"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 2 || Convert.ToInt32(Session["UserType"]) > 3) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } if (Session["UserType"] != null && Session["UserType"].ToString() == "2") { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); cityType.Items.Clear(); cityType.Items.Add(registerUser.BelongArea); cityType.Value = registerUser.BelongArea; belongArea = registerUser.BelongArea; } if (Request["action"] != null && Request["action"] == "GetData") { if (!Get_invoice()) { Response.Write("0"); } } if (Request["action"] != null && Request["action"] == "DeleteCors") { DeleteCors(); } if (Request["verify"] != null && Request["status"] != null) { int invoiceListID = Convert.ToInt32(Request["verify"]); string status = Request["status"].ToString(); verify(invoiceListID, status); } if (Request["action"] != null && Request["action"] == "DownloadAll") { DownloadAll(); } }
protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "1"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } //加载前端数据 userName = Session["UserName"].ToString(); companyInfo = DAL.CompanyInfo.GetModel(Convert.ToInt32(DAL.RegisterUser.GetModel(userName).CertifiationIndex)); oldCompany = companyInfo.Company; // if (Request["action"] != null && Request["action"].ToString() == "changeCompanyInfo") { registerUser = DAL.RegisterUser.GetModel(userName); companyInfo.Company = Request["new_company"].ToString(); DAL.CompanyInfo.Update(companyInfo); //string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; //string message = "尊敬的用户您好:平台绑定单位已经成功修改为:" + companyInfo.Company + ",请及时登录系统查看!"; //SMS = SMS.Replace("@message", message); //SMS = SMS.Replace("@phone", registerUser.Phone); //try //{ // cs.HttpHelper.SendSMS(SMS); //} //catch (Exception ex) //{ // cs.WebLogger.WriteErroLog("修改单位短信发送错误" + ex.ToString()); //输出到文件中 //} Response.Write("{\"code\":200}"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request["KEY"] == "Ld3Fx17etlofT3fT7D") { #region 查询 if (Request["UserName"] != null && Request["PassWord"] != null) { string result = "{\"result\":\"@result\",\"message\": @message,\"code\": \"@code\"}"; try { string username = Request["UserName"].ToString(); string PassWord = AES_Key.AESEncrypt(Request["PassWord"].ToString(), username.PadLeft(16, '0')); DataSet data = DAL.RegisterUser.GetUserNameList(" UserName='******' and PassWord='******'"); if (data.Tables[0].Rows.Count > 0) { Model.RegisterUser RegisterUser = DAL.RegisterUser.GetModel(username); if (RegisterUser.UserType == 1) { DataSet ds = DAL.RTKUserInfo.GetList("RegisterUserName ='******'"); if (ds.Tables[0].Rows.Count > 0) { //result = result.Replace("@result", "success"); //result = result.Replace("@message", JsonConvert.SerializeObject(ds.Tables[0])); //result = result.Replace("@code", "1"); result = "{\"result\":\"@failed\",\"message\": " + JsonConvert.SerializeObject(ds.Tables[0]) + ",\"code\": \"1\"}"; Response.Clear(); Response.Write(result); Response.End(); } else { //result = result.Replace("@result", "failed"); //result = result.Replace("@message", "没有数据!"); //result = result.Replace("@code", "-3"); result = "{\"result\":\"@failed\",\"message\": \"没有数据\",\"code\": \"-3\"}"; Response.Clear(); Response.Write(result); Response.End(); } } if (RegisterUser.UserType == 3) { DataSet ds = DAL.RTKUserInfo.GetList("1=1"); if (ds.Tables[0].Rows.Count > 0) { result = result.Replace("@result", "success"); result = result.Replace("@message", JsonConvert.SerializeObject(ds.Tables[0])); result = result.Replace("@code", "1"); Response.Clear(); Response.Write(result); Response.End(); } else { //result = result.Replace("@result", "failed"); //result = result.Replace("@message", "没有数据!"); //result = result.Replace("@code", "-3"); result = "{\"result\":\"@failed\",\"message\": \"没有数据\",\"code\": \"-3\"}"; Response.Clear(); Response.Write(result); Response.End(); } } } else { //result = result.Replace("@result", "failed"); //result = result.Replace("@message", "用户名或密码错误!"); //result = result.Replace("@code", "-2"); result = "{\"result\":\"@failed\",\"message\": \"用户名或密码错误\",\"code\": \"-2\"}"; Response.Clear(); Response.Write(result); Response.End(); } } catch (Exception) { if (result.Contains("@message")) { //result = result.Replace("@result", "failed"); //result = result.Replace("@message", "数据错误!"); //result = result.Replace("@code", "-1"); result = "{\"result\":\"@failed\",\"message\": \"数据错误\",\"code\": \"-1\"}"; Response.Clear(); Response.Write(result); Response.End(); } } } } }
private bool AddData() { try { Model.OrderList orderlist = DAL.OrderList.GetModel(Convert.ToInt32(Request["verify"])); if (Request["status"] == "OK") { orderlist.OrderStatus = 2; if (orderlist.OrdeType == 0)//账号申请 { //订单审核通过后添加发票信息 Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderlist.ID.ToString(); invoicelist.OrderNumber = orderlist.OrderNumber; invoicelist.BelongArea = orderlist.WorkArea; invoicelist.PayTime = orderlist.PayTime; invoicelist.Price = orderlist.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderlist.UserName; invoicelist.Type = 0; DAL.InvoiceList.Add(invoicelist); Model.RTKUserInfo rtkUserInfo = new Model.RTKUserInfo(); for (int i = 0; i < orderlist.AccountNum; i++) { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(orderlist.UserName); System.Random a = new Random(DateTime.Now.Millisecond); // use System.DateTime.Now.Millisecond as seed int RandKey = a.Next(100, 999); Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(Convert.ToInt32(registerUser.CertifiationIndex)); rtkUserInfo.RegisterUserName = orderlist.UserName; rtkUserInfo.UserName = orderlist.UserName + RandKey.ToString(); rtkUserInfo.Company = companyInfo.Company; rtkUserInfo.PassWord = AES_Key.AESEncrypt(rtkUserInfo.UserName, rtkUserInfo.UserName.PadLeft(16, '0')); rtkUserInfo.UserType = 0; rtkUserInfo.OrderNumber = orderlist.OrderNumber; rtkUserInfo.CORSCardNum = ""; rtkUserInfo.BelongArea = registerUser.BelongArea; rtkUserInfo.Contact = companyInfo.Contact; rtkUserInfo.ContactPhone = registerUser.Phone; rtkUserInfo.ContactEmail = registerUser.Email; rtkUserInfo.RegTime = DateTime.Now; if (!DAL.RTKUserInfo.Exists(rtkUserInfo.UserName)) { DAL.RTKUserInfo.Add(rtkUserInfo); } else { //如何已经存在则重新循环一次 i = i - 1; continue; } #region 权限信息部分 Model.RTKUserPurview rtkUserPurview = new Model.RTKUserPurview(); Model.RTKPostPurview rTKPostPurview = new Model.RTKPostPurview(); string startTime = DateTime.Now.ToString(); rtkUserPurview.UserName = rtkUserInfo.UserName; rtkUserPurview.StartTime = DateTime.Now; rtkUserPurview.EndTime = DateTime.Now.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); rtkUserPurview.ServerType = orderlist.ServerType; string CoorSystem = ""; string SourceTable = ""; rtkUserPurview.VRSEnable = 1; rtkUserPurview.SourceTable = SourceTable; rtkUserPurview.CoorSystem = CoorSystem; if (orderlist.RoamID == "" || orderlist.RoamID == null) { rtkUserPurview.RoamID = ""; } else { rtkUserPurview.RoamID = orderlist.RoamID; } if (orderlist.ElevationEnable == 1) { rtkUserPurview.ElevationEnable = 1; } else { rtkUserPurview.ElevationEnable = 0; } rTKPostPurview.UserName = rtkUserInfo.UserName; rTKPostPurview.StartTime = DateTime.Now; rTKPostPurview.EndTime = DateTime.Now.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); DAL.RTKPostPurview.Add(rTKPostPurview); DAL.RTKUserPurview.Add(rtkUserPurview); companyInfo.Balance = companyInfo.Balance - Convert.ToSingle(orderlist.Price); DAL.CompanyInfo.Update2(companyInfo); #endregion } } if (orderlist.OrdeType == 3)//账号申请(自定义账号) { //订单审核通过后添加发票信息 Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderlist.ID.ToString(); invoicelist.OrderNumber = orderlist.OrderNumber; invoicelist.BelongArea = orderlist.WorkArea; invoicelist.PayTime = orderlist.PayTime; invoicelist.Price = orderlist.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderlist.UserName; invoicelist.Type = 0; DAL.InvoiceList.Add(invoicelist); Model.RTKUserInfo rtkUserInfo = new Model.RTKUserInfo(); Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(orderlist.UserName); Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(Convert.ToInt32(registerUser.CertifiationIndex)); DataSet ds = DAL.DeUserInfo.GetList(orderlist.OrderNumber); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { rtkUserInfo.RegisterUserName = orderlist.UserName; rtkUserInfo.UserName = ds.Tables[0].Rows[i]["UserName"].ToString(); rtkUserInfo.Company = companyInfo.Company; rtkUserInfo.PassWord = AES_Key.AESEncrypt(rtkUserInfo.UserName, rtkUserInfo.UserName.PadLeft(16, '0')); rtkUserInfo.UserType = 0; rtkUserInfo.OrderNumber = orderlist.OrderNumber; rtkUserInfo.BelongArea = registerUser.BelongArea; rtkUserInfo.Contact = companyInfo.Contact; rtkUserInfo.ContactPhone = registerUser.Phone; rtkUserInfo.ContactEmail = registerUser.Email; rtkUserInfo.CORSCardNum = ""; rtkUserInfo.RegTime = DateTime.Now; if (!DAL.RTKUserInfo.Exists(rtkUserInfo.UserName)) { DAL.RTKUserInfo.Add(rtkUserInfo); } else { //如何已经存在则重新循环一次 i = i - 1; continue; } #region 权限信息部分 Model.RTKUserPurview rtkUserPurview = new Model.RTKUserPurview(); Model.RTKPostPurview rTKPostPurview = new Model.RTKPostPurview(); string startTime = DateTime.Now.ToString(); rtkUserPurview.UserName = rtkUserInfo.UserName; rtkUserPurview.StartTime = DateTime.Now; rtkUserPurview.EndTime = DateTime.Now.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); rtkUserPurview.ServerType = orderlist.ServerType; string CoorSystem = ""; string SourceTable = ""; rtkUserPurview.VRSEnable = 1; rtkUserPurview.SourceTable = SourceTable; rtkUserPurview.CoorSystem = CoorSystem; if (orderlist.RoamID == "" || orderlist.RoamID == null) { rtkUserPurview.RoamID = ""; } else { rtkUserPurview.RoamID = orderlist.RoamID; } if (orderlist.ElevationEnable == 1) { rtkUserPurview.ElevationEnable = 1; } else { rtkUserPurview.ElevationEnable = 0; } rTKPostPurview.UserName = rtkUserInfo.UserName; rTKPostPurview.StartTime = DateTime.Now; rTKPostPurview.EndTime = DateTime.Now.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); DAL.RTKPostPurview.Add(rTKPostPurview); DAL.RTKUserPurview.Add(rtkUserPurview); #endregion } companyInfo.Balance = companyInfo.Balance - Convert.ToSingle(orderlist.Price); DAL.CompanyInfo.Update2(companyInfo); Model.PaymentRecord paymentRecord = new Model.PaymentRecord(); paymentRecord.ProductName = "账号申请"; paymentRecord.Company = orderlist.company; paymentRecord.Type = orderlist.OrdeType; paymentRecord.Money = "-" + orderlist.Price; paymentRecord.RechargeTime = DateTime.Now; paymentRecord.UserName = orderlist.UserName; DAL.PaymentRecord.Add(paymentRecord); } if (orderlist.OrdeType == 1)//账号续费 { Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderlist.ID.ToString(); invoicelist.OrderNumber = orderlist.OrderNumber; invoicelist.BelongArea = orderlist.WorkArea; invoicelist.PayTime = orderlist.PayTime; invoicelist.Price = orderlist.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderlist.UserName; invoicelist.Type = 1; DAL.InvoiceList.Add(invoicelist); string a = orderlist.OrderContent; string name = orderlist.OrderContent.Substring(4); Regex regex = new Regex(";");//以 [##] 分割 string[] result = regex.Split(name); for (int i = 0; i < result.Length; i++) { if (result[i] != "") { Model.RTKUserPurview rtkUserPurview = DAL.RTKUserPurview.GetModel(result[i]); Model.RTKPostPurview rTKPostPurview = DAL.RTKPostPurview.GetModel(result[i]); rtkUserPurview.UserName = result[i]; rtkUserPurview.EndTime = rtkUserPurview.EndTime.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); rTKPostPurview.UserName = result[i]; rTKPostPurview.EndTime = rTKPostPurview.EndTime.AddMonths(Convert.ToInt32(orderlist.ServiceDuration)); DAL.RTKPostPurview.Update1(rTKPostPurview); DAL.RTKUserPurview.Update1(rtkUserPurview); } } Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(orderlist.company); companyInfo.Balance = companyInfo.Balance - Convert.ToSingle(orderlist.Price); DAL.CompanyInfo.Update2(companyInfo); Model.PaymentRecord paymentRecord = new Model.PaymentRecord(); paymentRecord.ProductName = "账号续费"; paymentRecord.Company = orderlist.company; paymentRecord.Type = orderlist.OrdeType; paymentRecord.Money = "-" + orderlist.Price; paymentRecord.RechargeTime = DateTime.Now; paymentRecord.UserName = orderlist.UserName; DAL.PaymentRecord.Add(paymentRecord); } if (orderlist.OrdeType == 2)//账号充值 { Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderlist.ID.ToString(); invoicelist.OrderNumber = orderlist.OrderNumber; invoicelist.BelongArea = orderlist.WorkArea; invoicelist.PayTime = orderlist.PayTime; invoicelist.Price = orderlist.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderlist.UserName; invoicelist.Type = 2; DAL.InvoiceList.Add(invoicelist); Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(orderlist.company); companyInfo.Balance += Convert.ToSingle(orderlist.Price); DAL.CompanyInfo.Update2(companyInfo); Model.PaymentRecord paymentRecord = new Model.PaymentRecord(); paymentRecord.ProductName = "账号充值"; paymentRecord.Company = orderlist.company; paymentRecord.Type = orderlist.OrdeType; paymentRecord.Money = orderlist.Price; paymentRecord.RechargeTime = DateTime.Now; paymentRecord.UserName = orderlist.UserName; DAL.PaymentRecord.Add(paymentRecord); } } else { orderlist.OrderStatus = 3; } DAL.OrderList.Update(orderlist); return(true); } catch (System.Threading.ThreadAbortException) { return(true); } catch (Exception ex) { cs.WebLogger.WriteErroLog(ex.ToString()); //输出到文件中 //Response.Write("<script>alert(\"1\")</script>"); return(true); } }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] == "register") { string user = Request.Form["userPhone"].ToString(); string userNum = Session["num"].ToString(); if (Request.Form["userPhone"] == Session["num"].ToString()) { Model.RegisterUser registeruser = new Model.RegisterUser(); registeruser.UserName = Request.Form["username"]; string tempPassWord = Request.Form["password"]; registeruser.PassWord = AES_Key.AESEncrypt(tempPassWord, registeruser.UserName.PadLeft(16, '0')); registeruser.Email = Request.Form["email"]; registeruser.Phone = Request.Form["phone"]; registeruser.RegTime = DateTime.Now; registeruser.LastLoginTime = DateTime.Now; registeruser.TryLoginTimes = 0; registeruser.CertifiationStatus = 0; registeruser.CertifiationIndex = ""; registeruser.UserType = 1; registeruser.IsEnable = 1; DAL.RegisterUser.Add(registeruser); Response.Write("1"); Response.End(); } } if (Request["action"] == "aaa") { string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; Session["num"] = cs.VerifyCodeHelper.Number(4, true); string message = "您的短信验证码为:" + Session["num"] + ",用于注册验证,为保证账号安全,请勿将验证码告知他人"; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", Request["phone"]); if (cs.HttpHelper.SendSMS(SMS)) { } else { cs.WebLogger.WriteErroLog("注册短信发送错误"); //输出到文件中 } } if (Request["action"] == "check_username") { if (DAL.RegisterUser.Exists(Request["username"])) { Response.Write("用户名已存在"); Response.End(); } else { Response.Write("true"); Response.End(); } } if (Request["action"] == "check_phone") { if (DAL.RegisterUser.ExistsPhone(Request["phone"])) { Response.Write("手机号已注册"); Response.End(); } else { Response.Write("true"); Response.End(); } } }
public void save() { int companyCertifiationIndex = Convert.ToInt32(DAL.RegisterUser.GetModel(Session["UserName"].ToString()).CertifiationIndex); Model.CompanyInfo updateinfo = DAL.CompanyInfo.GetModel(companyCertifiationIndex); updateinfo.Company = company_name.Value; type_id.SelectedIndex = Convert.ToInt32(updateinfo.Industry) - 1; switch (type_id.Value) { case "市内测绘资质单位": updateinfo.Industry = "1"; break; case "政府机构": updateinfo.Industry = "2"; break; case "仪器公司": updateinfo.Industry = "3"; break; case "科研院所": updateinfo.Industry = "4"; break; case "其他非测绘资质执证单位": updateinfo.Industry = "5"; break; case "市外测绘资质单位": updateinfo.Industry = "6"; break; case "市外非测绘资质单位": updateinfo.Industry = "7"; break; case "市内非测绘资质单位": updateinfo.Industry = "8"; break; } updateinfo.SurveyingQualification = maplevel.Value; updateinfo.SurveyingNumber = map_qualification_sn.Value; updateinfo.LegalPerson = corporate.Value; updateinfo.CompanyTel = corporate_tel.Value; updateinfo.OrganizationCode = business_licence.Value; updateinfo.Address = address.Value; updateinfo.Industry = type_id.Value; updateinfo.Contact = contact_name.Value; //contact_phone.Value = companyinfo.CompanyTel; updateinfo.CompanyTel = phone.Value; updateinfo.ID = companyCertifiationIndex; if (business_licence_path == "") { updateinfo.BusinessLicense = business_licence_path_file_.Src; } else { updateinfo.BusinessLicense = business_licence_path; } //if (corporate_id_card_front == "") //{ // updateinfo.LegalIDCardFile = corporate_id_card_front_file_.Src; //} //else //{ // updateinfo.LegalIDCardFile = corporate_id_card_front; //} if (map_qualification_path == "") { updateinfo.SurveyingFile = map_qualification_path_file_.Src; } else { updateinfo.SurveyingFile = map_qualification_path; } //if (secrecy_agreement_path=="") //{ // updateinfo.ServiceAgreementFile = secrecy_agreement_path_file_.Src; //} //else //{ // updateinfo.ServiceAgreementFile = secrecy_agreement_path; //} //if (client_authorization_path=="") //{ // updateinfo.PowerOfAttorney = client_authorization_path_file_.Src; //} //else //{ // updateinfo.PowerOfAttorney = client_authorization_path; //} if (DAL.CompanyInfo.Exists(updateinfo.Company)) { Response.Clear(); Response.Write("-1"); Response.End(); } else { DAL.CompanyInfo.Update(updateinfo); Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.CertifiationStatus = 6; DAL.RegisterUser.Update(registeruser); Response.Clear(); Response.Write("1"); Response.End(); } }
private int Verifycompanyform() { Model.CompanyInfo companyinfo = new Model.CompanyInfo(); companyinfo.Address = Request.Form["address"]; try { companyinfo.BelongArea = Request.Form["city"]; } catch { companyinfo.BelongArea = "重庆"; } companyinfo.BusinessLicense = business_licence_path; companyinfo.Company = Request.Form["company_name"]; companyinfo.CompanyTel = Request.Form["corporate_tel"]; companyinfo.Contact = Request.Form["contact_name"]; companyinfo.ContactIDCardFile = operator_id_card_front; companyinfo.ContactIDCardNumer = ""; try { companyinfo.Industry = Request.Form["company_type_id"]; } catch { companyinfo.Industry = "1"; } // companyinfo.LegalIDCardFile = corporate_id_card_front; companyinfo.LegalIDCardNumber = ""; companyinfo.LegalPerson = Request.Form["corporate"]; companyinfo.OrganizationCode = Request.Form["business_licence"]; //companyinfo.PowerOfAttorney = client_authorization_path; companyinfo.SurveyingFile = map_qualification_path; companyinfo.SurveyingNumber = Request.Form["map_qualification_sn"]; //companyinfo.ServiceAgreementFile = secrecy_agreement_path; try { companyinfo.SurveyingQualification = Request.Form["map_level"]; } catch { companyinfo.SurveyingQualification = "1"; } if (DAL.CompanyInfo.Exists(companyinfo.Company)) { //Response.Write(" <script>function window.onload() {alert( '该机构已认证,不能重复认证!' ); } </script> "); // string json = "{\"code\":200}"; Response.Write("{\"code\":100}"); Response.End(); //Model.CompanyInfo companyInfo1= DAL.CompanyInfo.GetModel(companyinfo.Company); //companyinfo.ID = companyInfo1.ID; //DAL.CompanyInfo.Update1(companyinfo); //Model.CompanyInfo temp_companyinfo = DAL.CompanyInfo.GetModel(companyinfo.Company); //Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); //registeruser.CertifiationIndex = temp_companyinfo.ID.ToString(); //registeruser.CertifiationStatus = 1; //registeruser.BelongArea = companyinfo.BelongArea; //DAL.RegisterUser.Update(registeruser); } else { companyinfo.Balance = 0; DAL.CompanyInfo.Add(companyinfo); Model.CompanyInfo temp_companyinfo = DAL.CompanyInfo.GetModel(); Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.CertifiationIndex = temp_companyinfo.ID.ToString(); //registeruser.CertifiationIndex = temp_companyinfo.ID.ToString(); registeruser.CertifiationStatus = 1; registeruser.BelongArea = companyinfo.BelongArea; DAL.RegisterUser.Update(registeruser); } string json = "{\"code\":200}"; Response.Write(json); Response.End(); return(1); //选择最新添加的一条数据 //select top 1 * from tra.dbo.订单 order by 下单时间 desc --时间倒序排列取第一条 // companyinfo. //string map_level = Request.Form["map_level"]; //string corporate = Request.Form["corporate"]; //string province = Request.Form["province"]; //string city = Request.Form["city"]; //string town = Request.Form["town"]; //string address = Request.Form["address"]; //string post_code = Request.Form["post_code"]; //string contact_phone = Request.Form["contact_phone"]; //string contact_email = Request.Form["contact_email"]; //string contact_qq = Request.Form["contact_qq"]; //string contact_wechat = Request.Form["contact_wechat"]; }
protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "1"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } string UserName = Session["UserName"].ToString(); if (Request["action"] != null) { switch (Request["action"]) { case "AddData": //Response.ContentType = "text/plain"; AddData(); //Response.End(); break; case "verifycompanyform": Verifycompanyform(); break; case "company_judge": company_judge(Request["company_name"]); break; default: break; } if (Request["action"].ToString() == "check") { string username = Request["data"].ToString(); DAL.CompanyInfo du = new DAL.CompanyInfo(); if (DAL.CompanyInfo.Exists(username)) { Response.Clear(); Response.Write("0"); Response.End(); } else { Response.Clear(); Response.Write("1"); Response.End(); } } } if (DAL.RegisterUser.Exists(Session["UserName"].ToString())) { Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); if (registerUser.CertifiationStatus == 5) { try { Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(Convert.ToInt32(registerUser.CertifiationIndex)); company_name.Value = companyInfo.Company; map_level.Value = companyInfo.SurveyingQualification; map_qualification_sn.Value = companyInfo.SurveyingNumber; business_licence.Value = companyInfo.OrganizationCode; corporate.Value = companyInfo.LegalPerson; corporate_tel.Value = companyInfo.CompanyTel; province.SelectedIndex = 1; city.SelectedIndex = 1; town.SelectedIndex = 1; address.Value = companyInfo.Address; post_code.Value = ""; map_qualification_path_file_.Src = companyInfo.SurveyingFile; map_qualification_path = companyInfo.SurveyingFile; business_licence_path_file_.Src = companyInfo.BusinessLicense; business_licence_path = companyInfo.BusinessLicense; // corporate_id_card_front_file_.Src = companyInfo.LegalIDCardFile; //corporate_id_card_front = companyInfo.LegalIDCardFile; // operator_id_card_front_file_.Src = companyInfo.ContactIDCardFile; // operator_id_card_front = companyInfo.ContactIDCardFile; // client_authorization_path_file_.Src = companyInfo.PowerOfAttorney; // client_authorization_path = companyInfo.PowerOfAttorney; contact_name.Value = companyInfo.Contact; qcphone.Value = companyInfo.CompanyTel; //secrecy_agreement_path_file_.Src = companyInfo.ServiceAgreementFile; } catch { } } } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { Model.RegisterUser registerUser3 = new Model.RegisterUser(); this.grpNewSysUserRegistration = new System.Windows.Forms.GroupBox(); this.ucSystemUserRegistration1 = new UserControls.ucSystemUserRegistration(); this.menuNewSysUserForm = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.logoutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.closeApplicationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuNewStudent = new System.Windows.Forms.ToolStripMenuItem(); this.addStudentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitStudentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); this.logoutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.btnExit = new System.Windows.Forms.Button(); this.btnSubmit = new System.Windows.Forms.Button(); this.grpNewSysUserRegistration.SuspendLayout(); this.menuNewSysUserForm.SuspendLayout(); this.SuspendLayout(); // // grpNewSysUserRegistration // this.grpNewSysUserRegistration.Controls.Add(this.ucSystemUserRegistration1); this.grpNewSysUserRegistration.Controls.Add(this.menuNewSysUserForm); this.grpNewSysUserRegistration.Controls.Add(this.btnExit); this.grpNewSysUserRegistration.Controls.Add(this.btnSubmit); this.grpNewSysUserRegistration.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.grpNewSysUserRegistration.ForeColor = System.Drawing.SystemColors.ControlDarkDark; this.grpNewSysUserRegistration.Location = new System.Drawing.Point(8, 12); this.grpNewSysUserRegistration.Name = "grpNewSysUserRegistration"; this.grpNewSysUserRegistration.Size = new System.Drawing.Size(551, 585); this.grpNewSysUserRegistration.TabIndex = 1; this.grpNewSysUserRegistration.TabStop = false; this.grpNewSysUserRegistration.Text = "New System Users"; // // ucSystemUserRegistration1 // this.ucSystemUserRegistration1.EditOnly = false; this.ucSystemUserRegistration1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ucSystemUserRegistration1.Location = new System.Drawing.Point(8, 48); this.ucSystemUserRegistration1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4); this.ucSystemUserRegistration1.Name = "ucSystemUserRegistration1"; registerUser3.EmployeeFirstName = ""; registerUser3.EmployeeId = 0; registerUser3.EmployeeLastName = ""; registerUser3.EmployeeUsername = ""; registerUser3.JobTitle = ""; registerUser3.ManagerEmail = ""; registerUser3.ManagerFirstName = ""; registerUser3.ManagerId = ""; registerUser3.ManagerLastName = ""; registerUser3.Password = "******"; registerUser3.UserStatus = ""; registerUser3.UserType = ""; this.ucSystemUserRegistration1.NewUser = registerUser3; this.ucSystemUserRegistration1.ReadOnly = false; this.ucSystemUserRegistration1.Size = new System.Drawing.Size(543, 490); this.ucSystemUserRegistration1.TabIndex = 5; // // menuNewSysUserForm // this.menuNewSysUserForm.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.menuNewStudent }); this.menuNewSysUserForm.Location = new System.Drawing.Point(3, 20); this.menuNewSysUserForm.Name = "menuNewSysUserForm"; this.menuNewSysUserForm.Size = new System.Drawing.Size(545, 24); this.menuNewSysUserForm.TabIndex = 4; this.menuNewSysUserForm.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.logoutToolStripMenuItem, this.closeApplicationToolStripMenuItem }); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; // // logoutToolStripMenuItem // this.logoutToolStripMenuItem.Name = "logoutToolStripMenuItem"; this.logoutToolStripMenuItem.Size = new System.Drawing.Size(167, 22); this.logoutToolStripMenuItem.Text = "Login"; this.logoutToolStripMenuItem.Click += new System.EventHandler(this.logoutToolStripMenuItem_Click); // // closeApplicationToolStripMenuItem // this.closeApplicationToolStripMenuItem.Name = "closeApplicationToolStripMenuItem"; this.closeApplicationToolStripMenuItem.Size = new System.Drawing.Size(167, 22); this.closeApplicationToolStripMenuItem.Text = "Close Application"; this.closeApplicationToolStripMenuItem.Click += new System.EventHandler(this.closeApplicationToolStripMenuItem_Click); // // menuNewStudent // this.menuNewStudent.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.addStudentToolStripMenuItem, this.exitStudentToolStripMenuItem, this.toolStripMenuItem2, this.logoutToolStripMenuItem1 }); this.menuNewStudent.Name = "menuNewStudent"; this.menuNewStudent.Size = new System.Drawing.Size(60, 20); this.menuNewStudent.Text = "Student"; // // addStudentToolStripMenuItem // this.addStudentToolStripMenuItem.Name = "addStudentToolStripMenuItem"; this.addStudentToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.addStudentToolStripMenuItem.Text = "Add Student"; // // exitStudentToolStripMenuItem // this.exitStudentToolStripMenuItem.Name = "exitStudentToolStripMenuItem"; this.exitStudentToolStripMenuItem.Size = new System.Drawing.Size(194, 22); this.exitStudentToolStripMenuItem.Text = "Edit Student"; // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(194, 22); this.toolStripMenuItem2.Text = "View Enrolled Students"; // // logoutToolStripMenuItem1 // this.logoutToolStripMenuItem1.Name = "logoutToolStripMenuItem1"; this.logoutToolStripMenuItem1.Size = new System.Drawing.Size(194, 22); this.logoutToolStripMenuItem1.Text = "Logout"; // // btnExit // this.btnExit.Location = new System.Drawing.Point(147, 550); this.btnExit.Name = "btnExit"; this.btnExit.Size = new System.Drawing.Size(85, 30); this.btnExit.TabIndex = 3; this.btnExit.Text = "Exit"; this.btnExit.UseVisualStyleBackColor = true; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // // btnSubmit // this.btnSubmit.Location = new System.Drawing.Point(313, 550); this.btnSubmit.Name = "btnSubmit"; this.btnSubmit.Size = new System.Drawing.Size(86, 30); this.btnSubmit.TabIndex = 0; this.btnSubmit.Text = "Submit"; this.btnSubmit.UseVisualStyleBackColor = true; this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click); // // SysUserRegistration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(571, 604); this.Controls.Add(this.grpNewSysUserRegistration); this.Name = "SysUserRegistration"; this.Text = "SysUserRegistration"; this.Load += new System.EventHandler(this.SysUserRegistration_Load); this.grpNewSysUserRegistration.ResumeLayout(false); this.grpNewSysUserRegistration.PerformLayout(); this.menuNewSysUserForm.ResumeLayout(false); this.menuNewSysUserForm.PerformLayout(); this.ResumeLayout(false); }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] == "getcode") { //string code; Bitmap bmp = cs.VerifyCodeHelper.CreateVerifyCodeBmp(out code); Bitmap newbmp = new Bitmap(bmp, 108, 36); //GetMD5Hash32(code); // Session["VerifyCode"] = code; Response.Clear(); Response.ContentType = "image/bmp"; newbmp.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Bmp); } if (Request["action"] == "login") { string VerifyCode = Request["VerifyCode"]; string username = Request["UserName"]; string password = Request["PassWord"]; //string code = Session["VerifyCode"].ToString(); //验证输入的验证码是否正确 if (VerifyCode.ToLower() != code.ToLower()) { Response.Write("-1"); Response.End(); } //Response.Write("<script>alert(\"1\")</script>"); //return; Model.RegisterUser registeruser = new Model.RegisterUser(); Model.RTKUserInfo rtkUserInfo = new Model.RTKUserInfo(); string sessionUserName = ""; string tempUserName = ""; string tempPassWord = ""; int tempUserType = 0; string symbol = ""; try { if (DAL.RegisterUser.Exists(username)) { tempUserName = username; registeruser = DAL.RegisterUser.GetModel(username); sessionUserName = registeruser.UserName; // 求时间差 TimeSpan ts = DateTime.Now - registeruser.LastLoginTime; //如果登录时间在300分钟外并且为超级管理员 则检索数据库 向过期RTK用户发短信 if (Math.Abs(ts.TotalMinutes) > 300 && registeruser.UserType == 3) { DataSet ds = DAL.RTKUserPurview.GetList("1=1"); foreach (DataRow dr in ds.Tables[0].Rows) { DateTime dt1 = Convert.ToDateTime(dr["EndTime"].ToString()); DateTime dt2 = DateTime.Now; TimeSpan deta = DateTime.Now - dt1; if (Math.Abs(deta.TotalDays) < 30) { string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "用户您好:RTK账号即将到期,请及时登录CORS管理系统查看!"; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", DAL.RTKUserInfo.GetModel(dr["UserName"].ToString()).ContactPhone); if (cs.HttpHelper.SendSMS(SMS)) { } else { cs.WebLogger.WriteErroLog("续费提醒短信发送错误"); //输出到文件中 } } } } //如果登录在半小时内超过三次则无效 if (Math.Abs(ts.TotalMinutes) < 30 && registeruser.TryLoginTimes > 3) { //登录频繁则返回 symbol = "-3"; } else { registeruser.TryLoginTimes += 1; registeruser.LastLoginTime = DateTime.Now; tempPassWord = AES_Key.AESDecrypt(registeruser.PassWord, registeruser.UserName.PadLeft(16, '0')); tempUserType = registeruser.UserType; DAL.RegisterUser.Update(registeruser); } } else if (DAL.RegisterUser.ExistsPhone(username)) { registeruser = DAL.RegisterUser.GetModelByPhone(username); tempUserName = registeruser.Phone; sessionUserName = registeruser.UserName; // 求时间差 TimeSpan ts = DateTime.Now - registeruser.LastLoginTime; //如果登录时间在300分钟外并且为超级管理员 则检索数据库 向过期RTK用户发短信 if (Math.Abs(ts.TotalMinutes) > 300 && registeruser.UserType == 3) { DataSet ds = DAL.RTKUserPurview.GetList("1=1"); foreach (DataRow dr in ds.Tables[0].Rows) { DateTime dt1 = Convert.ToDateTime(dr["EndTime"].ToString()); DateTime dt2 = DateTime.Now; TimeSpan deta = DateTime.Now - dt1; if (Math.Abs(deta.TotalDays) < 30) { string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "用户您好:RTK账号" + dr["UserName"].ToString() + "即将到期,请及时登录CORS管理系统查看!"; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", DAL.RTKUserInfo.GetModel(dr["UserName"].ToString()).ContactPhone); if (cs.HttpHelper.SendSMS(SMS)) { } else { cs.WebLogger.WriteErroLog("续费提醒短信发送错误"); //输出到文件中 } } } } //如果登录在半小时内超过三次则无效 if (Math.Abs(ts.TotalMinutes) < 30 && registeruser.TryLoginTimes > 3) { //登录频繁则返回 symbol = "-3"; Session["UserType"] = tempUserType; Session["UserName"] = sessionUserName; Model.SysLog mSysLog = new Model.SysLog(); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "登录次数超出限制:"; DAL.SysLog.Add(mSysLog); Response.End(); } else { registeruser.TryLoginTimes += 1; registeruser.LastLoginTime = DateTime.Now; tempPassWord = AES_Key.AESDecrypt(registeruser.PassWord, registeruser.UserName.PadLeft(16, '0')); tempUserType = registeruser.UserType; DAL.RegisterUser.Update(registeruser); } } else if (DAL.RTKUserInfo.Exists(username)) { tempUserName = username; sessionUserName = username; rtkUserInfo = DAL.RTKUserInfo.GetModel(username); tempPassWord = AES_Key.AESDecrypt(rtkUserInfo.PassWord, rtkUserInfo.UserName.PadLeft(16, '0')); tempUserType = 0; } else { //用户名不存在则返回 symbol = "-2"; } } catch (System.Threading.ThreadAbortException) { } catch (Exception ex) { cs.WebLogger.WriteErroLog(ex.ToString()); //输出到文件中 //Response.Write("<script>alert(\"1\")</script>"); return; } if (symbol == "-2") { Response.Write("-2"); Response.End(); return; } if (symbol == "-3") {//111 Response.Write("-3"); Response.End(); return; } if (getEncryption(tempPassWord, tempUserName, code, true) == password) { //StreamReader sr = new StreamReader("D:\\jizhan.txt"); //sr.ReadLine(); //while (!sr.EndOfStream) //{ // string line = sr.ReadLine(); // string[] mm = Regex.Split(line.Trim(), "\\s+", RegexOptions.IgnoreCase); // Model.CORSStationInfo cORSStationInfo = new Model.CORSStationInfo(); // cORSStationInfo.StationName = mm[1]; // cORSStationInfo.StationOName = mm[0]; // cORSStationInfo.Lat = Convert.ToDouble(mm[2]); // cORSStationInfo.Lon = Convert.ToDouble(mm[3]); // cORSStationInfo.H = Convert.ToDouble(mm[4]); // cORSStationInfo.Remark = ""; // cORSStationInfo.IP = mm[5]; // cORSStationInfo.Port = "9902"; // cORSStationInfo.TransferType = "TCP/IP"; // cORSStationInfo.IsOK = 1; // DAL.CORSStationInfo.Add(cORSStationInfo); // Model.EquipmentInfo eq = new Model.EquipmentInfo(); // eq.StationOName = cORSStationInfo.StationOName; // eq.StationName = cORSStationInfo.StationName; // eq.IP = cORSStationInfo.IP; // eq.Port = cORSStationInfo.Port; // DAL.EquipmentInfo.Add(eq); // Model.SiteMonitoring ms = new Model.SiteMonitoring(); // ms.StationOName = cORSStationInfo.StationOName; // DAL.SiteMonitoring.Add(ms); //} //sr.Close(); Session["UserType"] = tempUserType; Session["UserName"] = sessionUserName; Model.SysLog mSysLog = new Model.SysLog(); switch (tempUserType) { case 0: Response.Write("<script>location.href = \"/forms/cors_user.aspx\";</script>"); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "登录成功:"; DAL.SysLog.Add(mSysLog); Response.End(); break; case 1: //registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.TryLoginTimes = 0; DAL.RegisterUser.Update(registeruser); Response.Write("<script>location.href = \"/forms/cors_user.aspx\";</script>"); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "登录成功:"; DAL.SysLog.Add(mSysLog); Response.End(); break; case 2: //registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.TryLoginTimes = 0; DAL.RegisterUser.Update(registeruser); Response.Write("<script>location.href = \"/forms/cors_admin.aspx\";</script>"); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "登录成功:"; DAL.SysLog.Add(mSysLog); Response.End(); break; case 3: //registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); registeruser.TryLoginTimes = 0; DAL.RegisterUser.Update(registeruser); Response.Write("<script>location.href = \"/forms/cors_admin.aspx\";</script>"); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "管理员登录成功:"; DAL.SysLog.Add(mSysLog); Response.End(); break; default: break; } if (Session["UserType"].ToString() == "1") { Response.Write("1"); Response.End(); } if (Session["UserType"].ToString() == "3") { Response.Write("3"); Response.End(); } } else { Model.SysLog mSysLog = new Model.SysLog(); mSysLog.LogTime = DateTime.Now; mSysLog.LogType = 0; mSysLog.UserName = sessionUserName; mSysLog.Remark = "登录密码错误"; DAL.SysLog.Add(mSysLog); //密码错误则返回 Response.Write("0"); Response.End(); return; } //Model.RegisterUser registeruser = new Model.RegisterUser(); // if (DAL.RegisterUser.Exists(username)) // { // registeruser = DAL.RegisterUser.GetModel(username); // } // else // { // Response.Write("-2"); // Response.End(); // } // Response.Write("<script>alert(\"1\")</script>"); // return; //string ff=GetMD5Hash32(registeruser.PassWord); //string rff=GetMD5Hash16(registeruser.PassWord); //string frf = getEncryption(registeruser.PassWord, username, code, true); } }
protected void Page_Load(object sender, EventArgs e) { userName = Session["UserName"].ToString(); if (Request["action"] != null && Request["action"].ToString() == "getCode") { string ff = Request["action"].ToString(); string phone = DAL.RegisterUser.GetModel(userName).Phone; code = Number(6, false); string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "用户您好,您正在修改平台密码,验证码为:" + code; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", phone); if (cs.HttpHelper.SendSMS(SMS)) { Response.Write("1"); Response.End(); } else { cs.WebLogger.WriteErroLog("验证码短信发送错误"); //输出到文件中 } } if (Request["action"] != null && Request["action"].ToString() == "checkCode" && Request["code"] != null) { string tempcode = Request["code"].ToString(); if (tempcode == code && code.Length == 6) { Response.Write("true"); Response.End(); } else { Response.Write("输入验证码错误"); Response.End(); } } if (Request["action"] != null && Request["action"].ToString() == "resetPassword") { string tempPassWord = Request["password"].ToString(); string phone = DAL.RegisterUser.GetModel(userName).Phone; Model.RegisterUser registerUser = DAL.RegisterUser.GetModelByPhone(phone); registerUser.PassWord = AES_Key.AESEncrypt(tempPassWord, registerUser.UserName.PadLeft(16, '0')); DAL.RegisterUser.Update(registerUser); string SMS = "http://39.108.107.73:8090/sysmonitor/services/monitor/sendmessage.json?key=is8ji3&phone=@phone&message=@message"; string message = "尊敬的用户您好:平台密码已经成功修改为:" + tempPassWord + ",请及时登录系统查看!"; SMS = SMS.Replace("@message", message); SMS = SMS.Replace("@phone", phone); if (cs.HttpHelper.SendSMS(SMS)) { } else { cs.WebLogger.WriteErroLog("短信发送错误"); //输出到文件中 } Response.Write("{\"code\":200}"); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { if (Request["name"] != null) { Session["RegisterUserName"] = Request["name"].ToString(); } DataSet ds = DAL.CoorSysPars.GetList("YSZBXM ='WGS84'"); foreach (DataRow dr in ds.Tables[0].Rows) { ssdfzbx.Items.Add(dr["MDZBXM"].ToString()); ssdfzbx1.Items.Add(dr["MDZBXM"].ToString()); } DataSet ds1 = DAL.SourceTable.GetList("1=1"); foreach (DataRow dr in ds1.Tables[0].Rows) { ssylbpz.Items.Add(dr["Source"].ToString()); ssylbpz1.Items.Add(dr["Source"].ToString()); } int companyCertifiationIndex = Convert.ToInt32(DAL.RegisterUser.GetModel(Session["RegisterUserName"].ToString()).CertifiationIndex); Model.CompanyInfo companyInfo = DAL.CompanyInfo.GetModel(companyCertifiationIndex); Model.RegisterUser registerUser = DAL.RegisterUser.GetModel(Session["RegisterUserName"].ToString()); Company.Value = companyInfo.Company; Contacts.Value = companyInfo.Contact; phone.Value = registerUser.Phone; email.Value = registerUser.Email; Company1.Value = companyInfo.Company; Contacts1.Value = companyInfo.Contact; phone1.Value = registerUser.Phone; email1.Value = registerUser.Email; if (Request["action"] != null) { if (Request["action"].ToString() == "check") { string username = Request["data"].ToString(); DAL.RegisterUser du = new DAL.RegisterUser(); if (DAL.RTKUserInfo.GetModel(username) == null && DAL.RegisterUser.GetModel(username) == null) { Response.Clear(); Response.Write("1"); Response.End(); } else { Response.Clear(); Response.Write("0"); Response.End(); } } if (Request["action"].ToString() == "AddUser") { bool dele = true; string UserName = Request.Form["username"].ToString(); try { // 个人信息部分 DAL.RegisterUser du1 = new DAL.RegisterUser(); if (DAL.RTKUserInfo.GetModel(UserName) == null && DAL.RegisterUser.GetModel(UserName) == null) { } else { dele = false; Response.Clear(); Response.Write("-1"); Response.End(); return; } string PassWord = Request.Form["password"].ToString(); string WorkType = Request.Form["WorkType"].ToString(); string Contacts = Request.Form["Contacts"].ToString(); string Phone = Request.Form["phone"].ToString(); string Email = Request.Form["email"].ToString(); string Company = Request.Form["Company"].ToString(); int Enable = int.Parse(Request.Form["status"].ToString()); Model.RTKUserInfo rtkUserInfo = new Model.RTKUserInfo(); rtkUserInfo.RegisterUserName = Session["RegisterUserName"].ToString(); rtkUserInfo.UserName = UserName; rtkUserInfo.Company = Company; rtkUserInfo.PassWord = AES_Key.AESEncrypt(PassWord, UserName.PadLeft(16, '0')); rtkUserInfo.UserType = 0; //rtkUserInfo.OrderNumber = ; // rtkUserInfo.BelongArea = registerUser.BelongArea; rtkUserInfo.Contact = Contacts; rtkUserInfo.ContactPhone = Phone; rtkUserInfo.ContactEmail = Email; rtkUserInfo.RegTime = DateTime.Now; rtkUserInfo.CORSCardNum = ""; if (DAL.RTKUserInfo.Add(rtkUserInfo)) { } else { Response.Clear(); Response.Write("0"); Response.End(); return; } // 权限信息部分 Model.RTKUserPurview mrtkp = new Model.RTKUserPurview(); int PostEnable = int.Parse(Request.Form["ssfwky"].ToString()); string StartTime = Request.Form["ssbsks"].ToString(); string EndTime = Request.Form["ssbsjs"].ToString(); string CoorSystem = Request.Form["sskyzbx"].ToString(); string SourceTable = Request.Form["sskyylb"].ToString(); int ElevationEnable = int.Parse(Request.Form["sszcghq"].ToString()); string ElevationMode = Request.Form["ssgcjz"].ToString(); mrtkp.AreaID = ""; mrtkp.ElevationEnable = ElevationEnable; mrtkp.ElevationMode = ElevationMode; mrtkp.SourceTable = SourceTable; mrtkp.UserName = UserName; mrtkp.VRSEnable = PostEnable; mrtkp.ServerType = WorkType; mrtkp.CoorSystem = CoorSystem; mrtkp.RoamID = ""; mrtkp.StartTime = Convert.ToDateTime(StartTime); mrtkp.EndTime = Convert.ToDateTime(EndTime); if (!DAL.RTKUserPurview.Exists(mrtkp.UserName)) { if (!DAL.RTKUserPurview.Add(mrtkp)) { DAL.RTKUserInfo.Delete(UserName); Response.Clear(); Response.Write("0"); Response.End(); return; } } Model.RTKPostPurview rTKPostPurview = new Model.RTKPostPurview(); rTKPostPurview.UserName = UserName; rTKPostPurview.CoorTransEnable = 0; rTKPostPurview.HeightTransEnable = 0; rTKPostPurview.SHPTransEnable = 0; rTKPostPurview.DXFTransEnable = 0; rTKPostPurview.PPPserverEnable = 0; rTKPostPurview.ObsQualityEnable = 0; rTKPostPurview.BaseLineEnable = 0; rTKPostPurview.StartTime = Convert.ToDateTime(StartTime); rTKPostPurview.EndTime = Convert.ToDateTime(EndTime); DAL.RTKPostPurview.Add(rTKPostPurview); //添加用户状态信息 Model.RTKUserStatus mrtks = new Model.RTKUserStatus(); mrtks.UserName = UserName; mrtks.Company = Company; mrtks.IsOnline = 0; mrtks.Lat = 0; mrtks.Lon = 0; mrtks.StartTime = Convert.ToDateTime(StartTime); mrtks.Remark = ""; DAL.RTKUserStatus bllrtkus = new DAL.RTKUserStatus(); if (!bllrtkus.Exists(UserName)) { if (DAL.RTKUserStatus.Add(mrtks)) { } } Model.OrderList orderList = new Model.OrderList(); orderList.UserName = Session["RegisterUserName"].ToString(); orderList.OrderNumber = DateTime.Now.ToString("yyyMMddhhmmssfff"); orderList.company = Company; orderList.Price = "1000"; orderList.DealTime = DateTime.Now; orderList.OrderContent = "账号申请"; orderList.OrderStatus = 2; orderList.OrdeType = 0; orderList.RoamID = ""; DAL.OrderList.Add(orderList); //修改单位余额 Model.CompanyInfo UpdatecompanyInfo = DAL.CompanyInfo.GetModel(Company); UpdatecompanyInfo.Balance = UpdatecompanyInfo.Balance - 1000; DAL.CompanyInfo.Update(UpdatecompanyInfo); //添加发票信息 Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderList.ID.ToString(); invoicelist.OrderNumber = orderList.OrderNumber; invoicelist.BelongArea = orderList.WorkArea; invoicelist.PayTime = orderList.PayTime; invoicelist.Price = orderList.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderList.UserName; DAL.InvoiceList.Add(invoicelist); //添加缴费记录 Model.PaymentRecord paymentRecord = new Model.PaymentRecord(); paymentRecord.ProductName = "账号申请"; paymentRecord.Company = Company; paymentRecord.Type = orderList.OrdeType; paymentRecord.Money = "-" + orderList.Price; paymentRecord.RechargeTime = DateTime.Now; paymentRecord.UserName = orderList.UserName; DAL.PaymentRecord.Add(paymentRecord); } catch { DAL.RTKUserInfo.Delete(UserName); DAL.RTKUserPurview.Delete(UserName); DAL.RTKUserStatus.Delete(UserName); DAL.RTKPostPurview.Delete(UserName); DAL.InvoiceList.Delete(UserName); Response.Clear(); Response.Write("0"); Response.End(); return; } Response.Clear(); Response.Write("1"); Response.End(); } if (Request["action"].ToString() == "AddUser1") { bool dele = true; for (int i = 0; i < Convert.ToInt32(AccountNumber.Value); i++) { int[] RandKey = cs.RandomNumber.UseHashTableToNonRepeatedRandom(4, 0, 9); string UserName = Session["RegisterUserName"].ToString() + string.Join("", RandKey); try { // 个人信息部分 DAL.RegisterUser du1 = new DAL.RegisterUser(); if (DAL.RTKUserInfo.GetModel(UserName) == null && DAL.RegisterUser.GetModel(UserName) == null) { } else { dele = false; Response.Clear(); Response.Write("-1"); Response.End(); return; } string PassWord = UserName; string WorkType = Request.Form["WorkType1"].ToString(); string Contacts = Request.Form["Contacts1"].ToString(); string Phone = Request.Form["phone1"].ToString(); string Email = Request.Form["email1"].ToString(); string Company = Request.Form["Company1"].ToString(); int Enable = int.Parse(Request.Form["status1"].ToString()); Model.RTKUserInfo rtkUserInfo = new Model.RTKUserInfo(); rtkUserInfo.RegisterUserName = Session["RegisterUserName"].ToString(); rtkUserInfo.UserName = UserName; rtkUserInfo.Company = Company; rtkUserInfo.PassWord = AES_Key.AESEncrypt(PassWord, UserName.PadLeft(16, '0')); rtkUserInfo.UserType = 0; //rtkUserInfo.OrderNumber = ; // rtkUserInfo.BelongArea = registerUser.BelongArea; rtkUserInfo.Contact = Contacts; rtkUserInfo.ContactPhone = Phone; rtkUserInfo.ContactEmail = Email; rtkUserInfo.RegTime = DateTime.Now; rtkUserInfo.CORSCardNum = ""; if (DAL.RTKUserInfo.Add(rtkUserInfo)) { } else { Response.Clear(); Response.Write("0"); Response.End(); return; } // 权限信息部分 Model.RTKUserPurview mrtkp = new Model.RTKUserPurview(); int PostEnable = int.Parse(Request.Form["ssfwky1"].ToString()); string StartTime = Request.Form["ssbsks1"].ToString(); string EndTime = Request.Form["ssbsjs1"].ToString(); string CoorSystem = Request.Form["sskyzbx1"].ToString(); string SourceTable = Request.Form["sskyylb1"].ToString(); int ElevationEnable = int.Parse(Request.Form["sszcghq1"].ToString()); string ElevationMode = Request.Form["ssgcjz1"].ToString(); mrtkp.AreaID = ""; mrtkp.ElevationEnable = ElevationEnable; mrtkp.ElevationMode = ElevationMode; mrtkp.SourceTable = SourceTable; mrtkp.UserName = UserName; mrtkp.VRSEnable = PostEnable; mrtkp.ServerType = WorkType; mrtkp.CoorSystem = CoorSystem; mrtkp.RoamID = ""; mrtkp.StartTime = Convert.ToDateTime(StartTime); mrtkp.EndTime = Convert.ToDateTime(EndTime); mrtkp.RoamID = ""; if (!DAL.RTKUserPurview.Exists(mrtkp.UserName)) { if (!DAL.RTKUserPurview.Add(mrtkp)) { DAL.RTKUserInfo.Delete(UserName); Response.Clear(); Response.Write("0"); Response.End(); return; } } Model.RTKPostPurview rTKPostPurview = new Model.RTKPostPurview(); rTKPostPurview.UserName = UserName; rTKPostPurview.CoorTransEnable = 0; rTKPostPurview.HeightTransEnable = 0; rTKPostPurview.SHPTransEnable = 0; rTKPostPurview.DXFTransEnable = 0; rTKPostPurview.PPPserverEnable = 0; rTKPostPurview.ObsQualityEnable = 0; rTKPostPurview.BaseLineEnable = 0; rTKPostPurview.StartTime = Convert.ToDateTime(StartTime); rTKPostPurview.EndTime = Convert.ToDateTime(EndTime); DAL.RTKPostPurview.Add(rTKPostPurview); //添加用户状态信息 Model.RTKUserStatus mrtks = new Model.RTKUserStatus(); mrtks.UserName = UserName; mrtks.Company = Company; mrtks.IsOnline = 0; mrtks.Lat = 0; mrtks.Lon = 0; mrtks.StartTime = Convert.ToDateTime(StartTime); mrtks.Remark = ""; DAL.RTKUserStatus bllrtkus = new DAL.RTKUserStatus(); if (!bllrtkus.Exists(UserName)) { if (DAL.RTKUserStatus.Add(mrtks)) { } } Model.OrderList orderList = new Model.OrderList(); orderList.UserName = Session["RegisterUserName"].ToString(); orderList.OrderNumber = DateTime.Now.ToString("yyyMMddhhmmssfff"); orderList.company = Company; orderList.Price = "1000"; orderList.DealTime = DateTime.Now; orderList.OrderContent = "账号申请"; orderList.OrderStatus = 2; orderList.OrdeType = 0; orderList.RoamID = ""; DAL.OrderList.Add(orderList); //修改单位余额 Model.CompanyInfo UpdatecompanyInfo = DAL.CompanyInfo.GetModel(Company); UpdatecompanyInfo.Balance = UpdatecompanyInfo.Balance - 1000; DAL.CompanyInfo.Update(UpdatecompanyInfo); //添加发票信息 Model.InvoiceList invoicelist = new Model.InvoiceList(); invoicelist.OrderDetail = orderList.ID.ToString(); invoicelist.OrderNumber = orderList.OrderNumber; invoicelist.BelongArea = orderList.WorkArea; invoicelist.PayTime = orderList.PayTime; invoicelist.Price = orderList.Price; invoicelist.Status = 1; invoicelist.ContractStatus = 1; invoicelist.UserName = orderList.UserName; DAL.InvoiceList.Add(invoicelist); //添加缴费记录 Model.PaymentRecord paymentRecord = new Model.PaymentRecord(); paymentRecord.ProductName = "账号申请"; paymentRecord.Company = Company; paymentRecord.Type = orderList.OrdeType; paymentRecord.Money = "-" + orderList.Price; paymentRecord.RechargeTime = DateTime.Now; paymentRecord.UserName = orderList.UserName; DAL.PaymentRecord.Add(paymentRecord); } catch { DAL.RTKUserInfo.Delete(UserName); DAL.RTKUserPurview.Delete(UserName); DAL.RTKUserStatus.Delete(UserName); DAL.RTKPostPurview.Delete(UserName); DAL.InvoiceList.Delete(UserName); Response.Clear(); Response.Write("0"); Response.End(); return; } } Response.Clear(); Response.Write("1"); Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { //Session["UserName"] = "******"; //Session["UserType"] = "3"; //Session["UserName"] = "******"; //Session["UserType"] = "1"; if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");parent.window.location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } if (Convert.ToInt32(Session["UserType"]) == 0) { businessManage.Style.Add("display", "none"); userManage.Style.Add("display", "none"); qualification.Style.Add("display", "none"); } //如果是普通平台用户登录的时候则不显示数据处理 else { dataProcess.Style.Add("display", "none"); } if (Request["action"] == "username_judge") { Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); if (registeruser.CertifiationStatus == 2 || registeruser.CertifiationStatus == 4) { //location.href = location.origin+\"/forms/cors.aspx\"; Response.Write("OK"); Response.End(); } else if (registeruser.CertifiationStatus == 1) { Response.Write("checking"); Response.End(); } else if (registeruser.CertifiationStatus == 6) { Response.Write("changeing"); Response.End(); } else { Response.Write("NO"); Response.End(); } } if (Request["action"] == "checkQualification") { Model.RegisterUser registeruser = DAL.RegisterUser.GetModel(Session["UserName"].ToString()); if (registeruser.CertifiationStatus == 2 || registeruser.CertifiationStatus == 4) { //location.href = location.origin+\"/forms/cors.aspx\"; Response.Write("OK"); Response.End(); } else if (registeruser.CertifiationStatus == 1) { Response.Write("checking"); Response.End(); } else if (registeruser.CertifiationStatus == 6) { Response.Write("changeing"); Response.End(); } else { Response.Write("NO"); Response.End(); } } if (!IsPostBack) { UserName.InnerText = Session["UserName"].ToString(); if (Session["UserType"].ToString() == "1") { UserType.InnerText = "普通用户"; } else { UserType.InnerText = "RTK用户"; } string strwhere = "(ToUser = '******' or ToUser ='******') and IsRead=0 "; //查询该用户收件箱里里面未读信个数 unreadMailNum = DAL.UserMessage.GetRecordCountNew("", strwhere).ToString(); if (unreadMailNum == "0") { unreadMailNum = ""; } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserName"] == null || Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) < 0 || Convert.ToInt32(Session["UserType"]) > 5) { Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/publicforms/Login/Login.aspx\";</script>"); Response.End(); } userName = Session["UserName"].ToString(); if (Request["action"] == "check_username") { if (DAL.RegisterUser.Exists(Request["username"])) { Response.Write("用户名已存在"); Response.End(); } else { Response.Write("true"); Response.End(); } } if (Request["actionAdd"] != null) { string inf = Request["actionAdd"].ToString().Trim(); string[] a = inf.Split('}'); if (a.Length == 3 && a[0] != "" && a[1] != "") { string usr = a[0]; //string tempPassWord = AES_Key.AESEncrypt(a[1], a[0].PadLeft(16, '0')); //string aa = AES_Key.AESDecrypt(tempPassWord, a[0].PadLeft(16, '0')); if (DAL.RegisterUser.Exists(a[0])) { Response.Write("2"); Response.End(); } Model.RegisterUser registerUser = new Model.RegisterUser(); registerUser.UserName = a[0]; registerUser.PassWord = AES_Key.AESEncrypt(a[1], a[0].PadLeft(16, '0')); registerUser.UserType = 2; registerUser.BelongArea = a[2]; registerUser.CertifiationStatus = 2; DAL.RegisterUser.Add(registerUser); Response.Write("1"); Response.End(); } } //if (Request["action"] != null && Request["action"].ToString() == "checkPassword") //{ // registerUser = DAL.RegisterUser.GetModel(userName); // if (registerUser.PassWord != Request["old_password"].ToString()) // { // Response.Write("旧密码输入错误"); // Response.End(); // } // else // { // Response.Write("true"); // Response.End(); // } //} //if (Request["action"] != null && Request["action"].ToString() == "changePassword") //{ // registerUser.PassWord = Request["new_password"].ToString(); // DAL.RegisterUser.Update(registerUser); // Response.Write("{\"code\":200}"); // Response.End(); //} }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] != null && Request["key"] != null) { //给微信小程序传数据 if (Request["action"] == "GetData" && Request["key"] == "kZJdqQGFq1SntAI/SE9IMQ==") { #region 基站信息 DataSet DSStationInfo = DAL.CORSStationInfo.GetList("1=1"); string StationInfo = cs.JSONHelper.DataTableToJSON(DSStationInfo.Tables[0]); #endregion #region 务平台信息 //基站状态 int StationCount = DSStationInfo.Tables[0].Rows.Count; int StationFineCount = DAL.CORSStationInfo.GetList("IsOK=1").Tables[0].Rows.Count; //获取用户数和固定率 double Rtk = 0; string strGD = ""; double rtkNum = DAL.RTKUserStatus.GetList("IsOnline =1").Tables[0].Rows.Count; double rtkGd = DAL.RTKUserStatus.GetList("IsOnline=1 and Remark like '%RTK固定%'").Tables[0].Rows.Count; if (rtkNum != 0 && rtkGd != 0) { double GD = Math.Round(rtkGd / rtkNum * 100, 2); strGD = GD + "%"; } //对流层实时值 string pwvValue = ""; string pwvfilepath = Server.MapPath("~\\Product\\PWV_AVERAGE_REALTIME.rtpwv"); if (System.IO.File.Exists(pwvfilepath)) { StreamReader readrtpwv = new StreamReader(pwvfilepath); string pwvline = readrtpwv.ReadLine(); string[] pwv = getnewstr(pwvline).Split(' '); pwvValue = pwv[pwv.Length - 1]; readrtpwv.Close(); readrtpwv.Dispose(); } //电离层实时值 string tecValue = ""; string ionopath = Server.MapPath("~\\Product\\SLM_AVERAGE_REALTIME.rttec"); if (System.IO.File.Exists(ionopath)) { StreamReader readrttec = new StreamReader(ionopath); string tecline = readrttec.ReadLine(); string[] tec = getnewstr(tecline).Split(' '); tecValue = tec[tec.Length - 2] + ' ' + tec[tec.Length - 1]; readrttec.Close(); } //电离层预报值 string retecValue = ""; string strpath = Server.MapPath("~/Product/SLM_THREEDY.forecast"); if (File.Exists(strpath)) { try { StreamReader readeriono = new StreamReader(strpath); List <List <string> > Dataiono = new List <List <string> >(); for (string line = readeriono.ReadLine(); line != null; line = readeriono.ReadLine()) { string[] ll = getnewstr(line).Split(' '); List <string> l = new List <string>(); l.Add(ll[0]); l.Add(ll[1]); Dataiono.Add(l); } readeriono.Close(); for (int i = 0; i < Dataiono.Count; i++) { if (int.Parse(Dataiono[i][0]) == DateTime.Now.AddHours(2).Hour) { retecValue = Dataiono[i][1] + "TECU"; } } } catch (Exception) { } } DataSet DSPlatInfo = new DataSet(); DataTable DTPlatInfo = new DataTable(); DTPlatInfo.Columns.Add("Item", typeof(string)); DTPlatInfo.Columns.Add("Value", typeof(string)); DataRow DRPlatInfo1 = DTPlatInfo.NewRow(); DRPlatInfo1["Item"] = "CORS当前服务状态"; DRPlatInfo1["Value"] = "正常"; DTPlatInfo.Rows.Add(DRPlatInfo1); DataRow DRPlatInfo2 = DTPlatInfo.NewRow(); DRPlatInfo2["Item"] = "CORS基准站运行状态(正常站点/总站点)"; DRPlatInfo2["Value"] = StationFineCount.ToString() + "/" + StationCount.ToString(); DTPlatInfo.Rows.Add(DRPlatInfo2); DataRow DRPlatInfo3 = DTPlatInfo.NewRow(); DRPlatInfo3["Item"] = "作业用户数"; DRPlatInfo3["Value"] = rtkNum; DTPlatInfo.Rows.Add(DRPlatInfo3); DataRow DRPlatInfo4 = DTPlatInfo.NewRow(); DRPlatInfo4["Item"] = "固定率"; DRPlatInfo4["Value"] = strGD; DTPlatInfo.Rows.Add(DRPlatInfo4); DataRow DRPlatInfo5 = DTPlatInfo.NewRow(); DRPlatInfo5["Item"] = "对流层实时数值"; DRPlatInfo5["Value"] = pwvValue; DTPlatInfo.Rows.Add(DRPlatInfo5); DataRow DRPlatInfo6 = DTPlatInfo.NewRow(); DRPlatInfo6["Item"] = "电离层实时数值"; DRPlatInfo6["Value"] = tecValue; DTPlatInfo.Rows.Add(DRPlatInfo6); DataRow DRPlatInfo7 = DTPlatInfo.NewRow(); DRPlatInfo7["Item"] = "电离层预报数值(未来两个小时)"; DRPlatInfo7["Value"] = retecValue; DTPlatInfo.Rows.Add(DRPlatInfo7); string PlatInfo = cs.JSONHelper.DataTableToJSON(DTPlatInfo); #endregion #region 空间环境产品 #endregion string result = "{\"StationInfo\":" + StationInfo + ",\"PlatInfo\":" + PlatInfo + "}"; Response.Clear(); Response.Write(result); Response.End(); } //给微信小程序登录 if (Request["action"] == "Login" && Request["key"] == "kZJdqQGFq1SntAI/SE9IMQ==") { #region 验证用户名和密码 if (Request["UserName"] != null && Request["PassWord"] != null) { string UserName = Request["UserName"].ToString(); string PassWord = Request["PassWord"].ToString(); //userinfo-->RTKuser // DAL.UserInfoWeb duserinfo = new DAL.UserInfoWeb(); Model.RegisterUser muinfo = DAL.RegisterUser.GetModel(UserName); if (muinfo != null) { if (PassWord == AES_Key.AESDecrypt(muinfo.PassWord, muinfo.UserName.PadLeft(16, '0'))) { Response.Clear(); Response.Write("1"); Response.End(); } else { Response.Clear(); Response.Write("0"); Response.End(); } } else { Model.RTKUserInfo mrtk = DAL.RTKUserInfo.GetModel2(UserName); if (mrtk != null) { if (PassWord == AES_Key.AESDecrypt(mrtk.PassWord, mrtk.UserName.PadLeft(16, '0'))) { Response.Clear(); Response.Write("2"); Response.End(); } else { Response.Clear(); Response.Write("0"); Response.End(); } } else { Response.Clear(); Response.Write("0"); Response.End(); } } } #endregion } //微信小程序修改密码 if (Request["action"] == "ChangePass" && Request["key"] == "kZJdqQGFq1SntAI/SE9IMQ==") { if (Request["UserName"] != null && Request["PassWord"] != null && Request["NewPassWord"] != null) { string UserName = Request["UserName"].ToString(); string PassWord = Request["PassWord"].ToString(); string NewPassWord = Request["NewPassWord"].ToString(); //userinfo-->RTKuser Model.RegisterUser muinfo = DAL.RegisterUser.GetModel(UserName); if (muinfo != null) { if (PassWord == AES_Key.AESDecrypt(muinfo.PassWord, muinfo.UserName.PadLeft(16, '0'))) { muinfo.PassWord = AES_Key.AESEncrypt(NewPassWord, UserName.PadLeft(16, '0')); if (DAL.RegisterUser.Update(muinfo)) { Response.Clear(); Response.Write("1"); Response.End(); } else { Response.Clear(); Response.Write("-1"); Response.End(); } } else { Response.Clear(); Response.Write("0"); Response.End(); } } else { Model.RTKUserInfo mrtk = DAL.RTKUserInfo.GetModel2(UserName); if (mrtk != null) { if (PassWord == AES_Key.AESDecrypt(mrtk.PassWord, mrtk.UserName.PadLeft(16, '0'))) { mrtk.PassWord = AES_Key.AESEncrypt(NewPassWord, UserName.PadLeft(16, '0')); if (DAL.RTKUserInfo.Update(mrtk)) { Response.Clear(); Response.Write("1"); Response.End(); } else { Response.Clear(); Response.Write("-1"); Response.End(); } } else { Response.Clear(); Response.Write("0"); Response.End(); } } else { Response.Clear(); Response.Write("-1"); Response.End(); } } } } } }