public statusModels GetAddCordModels(otherData otherData, string cuurip) { datetime datetime = new datetime(); string stdate = datetime.sqldate("mssql", "sysstring"), sttime = datetime.sqltime("mssql", "sysstring"); List <dbparam> dbparamlist = new List <dbparam>(); dbparamlist.Add(new dbparam("@value", otherData.values.TrimEnd())); dbparamlist.Add(new dbparam("@inoper", otherData.userid.TrimEnd())); dbparamlist.Add(new dbparam("@stdate", stdate)); dbparamlist.Add(new dbparam("@sttime", sttime)); if (new database().checkActiveSql("mssql", "sysstring", "exec web.insertrecordform @value,@inoper,@stdate,@sttime;", dbparamlist) != "istrue") { return(new statusModels() { status = "error" }); } return(new statusModels() { status = "istrue" }); }
public statusModels GetBadgeFormModels(otherData otherData, string cuurip) { bool isbreak = true; string badge = "0"; database database = new database(); List <dbparam> dbparamlist = new List <dbparam>(); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); dbparamlist.Add(new dbparam("@status", "0")); while (isbreak) { Thread.Sleep(5000); badge = database.checkSelectSql("mssql", "sysstring", "exec web.countnoticeform @newid,@status;", dbparamlist).Rows[0]["counts"].ToString().TrimEnd(); if (badge != otherData.values.TrimEnd()) { isbreak = false; } } return(new statusModels() { status = badge }); }
public statusModels GetCodeUserModels(otherData otherData, string cuurip) { switch (string.IsNullOrWhiteSpace(otherData.userid)) { case true: return(new statusModels() { status = "nousers" }); } switch (string.IsNullOrWhiteSpace(otherData.values)) { case true: return(new statusModels() { status = "errorCode" }); } DataTable userRows = new DataTable(); database database = new database(); List <dbparam> dbparamlist = new List <dbparam>(); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); dbparamlist.Add(new dbparam("@vecode", otherData.values.TrimEnd())); dbparamlist.Add(new dbparam("@status", "1")); userRows = database.checkSelectSql("mssql", "sysstring", "exec web.codesiteber @newid,@vecode,@status;", dbparamlist); switch (userRows.Rows.Count) { case 0: return(new statusModels() { status = "nodata" }); } switch (userRows.Rows[0]["isused"].ToString().TrimEnd()) { case "0": return(new statusModels() { status = "islock" }); } datetime datetime = new datetime(); string date = datetime.sqldate("mssql", "sysstring"), time = datetime.sqltime("mssql", "sysstring"); DateTime startdate = DateTime.Parse(date + " " + time); DateTime enddate = DateTime.Parse(userRows.Rows[0]["vedate"].ToString().TrimEnd() + " " + userRows.Rows[0]["vetime"].ToString().TrimEnd()).AddMinutes(10); if (enddate >= startdate) { dbparamlist.Clear(); dbparamlist.Add(new dbparam("@vedate", "")); dbparamlist.Add(new dbparam("@vetime", "")); dbparamlist.Add(new dbparam("@vecode", "")); dbparamlist.Add(new dbparam("@modate", date)); dbparamlist.Add(new dbparam("@motime", time)); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); if (database.checkActiveSql("mssql", "sysstring", "update web.siteber set vedate = @vedate,vetime = @vetime,vecode = @vecode,modate = @modate,motime = @motime where newid = @newid;", dbparamlist) != "istrue") { return(new statusModels() { status = "error" }); } return(new statusModels() { status = "istrue" }); } Random random = new Random(); string vecode = random.Next(100000, 999999).ToString().TrimEnd(); dbparamlist.Clear(); dbparamlist.Add(new dbparam("@vedate", date)); dbparamlist.Add(new dbparam("@vetime", time)); dbparamlist.Add(new dbparam("@vecode", vecode)); dbparamlist.Add(new dbparam("@modate", date)); dbparamlist.Add(new dbparam("@motime", time)); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); if (database.checkActiveSql("mssql", "sysstring", "update web.siteber set vedate = @vedate,vetime = @vetime,vecode = @vecode,modate = @modate,motime = @motime where newid = @newid;", dbparamlist) != "istrue") { return(new statusModels() { status = "error" }); } return(new statusModels() { status = "resend" }); }
public statusModels GetResendUserModels(otherData otherData, string cuurip) { switch (string.IsNullOrWhiteSpace(otherData.userid)) { case true: return(new statusModels() { status = "nousers" }); } switch (string.IsNullOrWhiteSpace(otherData.values)) { case true: return(new statusModels() { status = "errorResend" }); } DataTable userRows = new DataTable(); database database = new database(); List <dbparam> dbparamlist = new List <dbparam>(); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); dbparamlist.Add(new dbparam("@status", "1")); userRows = database.checkSelectSql("mssql", "sysstring", "exec web.resendsiteber @newid,@status;", dbparamlist); switch (userRows.Rows.Count) { case 0: return(new statusModels() { status = "nodata" }); } switch (userRows.Rows[0]["isused"].ToString().TrimEnd()) { case "0": return(new statusModels() { status = "islock" }); } datetime datetime = new datetime(); string date = datetime.sqldate("mssql", "sysstring"), time = datetime.sqltime("mssql", "sysstring"); dbparamlist.Clear(); dbparamlist.Add(new dbparam("@password", new sha256().encry256(otherData.values.TrimEnd()))); dbparamlist.Add(new dbparam("@modate", date)); dbparamlist.Add(new dbparam("@motime", time)); dbparamlist.Add(new dbparam("@newid", otherData.userid.TrimEnd())); if (database.checkActiveSql("mssql", "sysstring", "update web.siteber set password = @password,modate = @modate,motime = @motime where newid = @newid;", dbparamlist) != "istrue") { return(new statusModels() { status = "error" }); } return(new statusModels() { status = "istrue" }); }