Ejemplo n.º 1
0
        public sOptonModels GetPollingModels(otherData otherData, string cuurip)
        {
            bool     isbreak  = true;
            database database = new database();
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            while (isbreak)
            {
                Thread.Sleep(5000);
                List <dbparam> dbparamlist = new List <dbparam>();
                int            itemCount = int.Parse(database.checkSelectSql("mssql", "flyformstring", "exec web.countmainform;", dbparamlist).Rows[0]["itemCount"].ToString().TrimEnd()), values = int.Parse(otherData.values.TrimEnd());
                if (itemCount > values)
                {
                    dbparamlist.Clear();
                    dbparamlist.Add(new dbparam("@length", itemCount - values));
                    dbparamlist.Add(new dbparam("@inoper", otherData.userid.TrimEnd()));
                    foreach (DataRow dr in new database().checkSelectSql("mssql", "flyformstring", "exec web.searchmaining @length,@inoper;", dbparamlist).Rows)
                    {
                        items.Add(new Dictionary <string, object>()
                        {
                            { "id", dr["formId"].ToString().TrimEnd() }, { "tile", dr["tile"].ToString().TrimEnd() }, { "datetime", dr["indate"].ToString().TrimEnd() }, { "showOther", false }, { "showFinish", dr["finish"].ToString().TrimEnd() == "1" }
                        });
                    }
                    isbreak = false;
                }
            }
            return(new sOptonModels()
            {
                items = items
            });
        }
Ejemplo n.º 2
0
        public sOptonModels GetSoperModels(otherData otherData, string cuurip)
        {
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@department", otherData.values.TrimEnd()));
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in new database().checkSelectSql("mssql", "epaperstring", "exec web.searchdertoper @department;", dbparamlist).Rows)
            {
                items.Add(new Dictionary <string, object>()
                {
                    { "newid", dr["newid"].ToString().TrimEnd() }, { "userid", dr["userid"].ToString().TrimEnd() }, { "name", dr["username"].ToString().TrimEnd() }, { "showOper", false }
                });
            }
            return(new sOptonModels()
            {
                items = items
            });
        }
Ejemplo n.º 3
0
        public sTypeModels GetSTypeModels(otherData otherData, string cuurip)
        {
            database       database    = new database();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@value", otherData.values.TrimEnd()));
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >(); string value = "";

            foreach (DataRow dr in database.checkSelectSql("mssql", "flyformstring", "exec web.searchoperationform @value;", dbparamlist).Rows)
            {
                value = dr["operationValue"].ToString().TrimEnd();
                items.Add(new Dictionary <string, object>()
                {
                    { "optionPadding", dr["optionPadding"].ToString().TrimEnd() == "1" }, { "value", dr["operationValue"].ToString().TrimEnd() }
                });
            }
            return(new sTypeModels()
            {
                value = value, items = items, status = "istrue"
            });
        }
Ejemplo n.º 4
0
        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", "flytrainstring", "exec web.countnoticeform @newid,@status;", dbparamlist).Rows[0]["counts"].ToString().TrimEnd();
                if (badge != otherData.values.TrimEnd())
                {
                    isbreak = false;
                }
            }
            return(new statusModels()
            {
                status = badge
            });
        }
Ejemplo n.º 5
0
        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", "epaperstring", "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", "epaperstring"), time = datetime.sqltime("mssql", "epaperstring");
            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", "epaperstring", "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", "epaperstring", "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"
            });
        }
Ejemplo n.º 6
0
        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", "epaperstring", "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", "epaperstring"), time = datetime.sqltime("mssql", "epaperstring");

            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", "epaperstring", "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"
            });
        }