Esempio n. 1
0
        public sFoorModels GetSearchModels(userData userData, string cuurip)
        {
            List <Dictionary <string, object> > opticonitems = new List <Dictionary <string, object> >();

            foreach (DataRow dr in new database().checkSelectSql("mssql", "flyformstring", "exec web.searchitemform;", new List <dbparam>()).Rows)
            {
                opticonitems.Add(new Dictionary <string, object>()
                {
                    { "opticonPadding", false }, { "icon", dr["icon"].ToString().TrimEnd() }, { "value", dr["value"].ToString().TrimEnd() }
                });
            }
            List <Dictionary <string, object> > answeritems = new List <Dictionary <string, object> >();

            answeritems.Add(new Dictionary <string, object>()
            {
                { "id", 1 }, { "value", "" }, { "showAnswer", false }, { "ansrDelete", false }
            });
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            items.Add(new Dictionary <string, object>()
            {
                { "iid", 1 }, { "showLine", false }, { "title", "" }, { "showOut", false }, { "showVeri", false }, { "showDrop", false }, { "showFile", false }, { "outValue", "text" }, { "type_", "" }, { "showType", false }, { "typeitems", new List <Dictionary <string, object> >().ToArray() }, { "operation", "" }, { "showOperation", false }, { "operationitems", new List <Dictionary <string, object> >().ToArray() }, { "area", "" }, { "eror", "" }, { "showCheck", false }, { "showMore", false }, { "opticonitems", opticonitems.ToArray() }, { "answeritems", answeritems.ToArray() }, { "itemDelete", false }
            });
            List <Dictionary <string, object> > settitems = new List <Dictionary <string, object> >();

            settitems.Add(new Dictionary <string, object>()
            {
                { "stdate", "" }, { "sttime", "" }, { "endate", "" }, { "entime", "" }, { "showExam", false }, { "randOption", false }, { "randSubtile", false }, { "showRestart", false }, { "showLimit", false }, { "dertitems", new List <Dictionary <string, object> >().ToArray() }, { "number", "" }
            });
            return(new sFoorModels()
            {
                items = items, settitems = settitems
            });
        }
Esempio n. 2
0
        public itemsModels GetBadgeModels(userData userData, string cuurip)
        {
            database       database    = new database();
            DataTable      mainRows    = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@inoper", userData.userid.TrimEnd()));
            mainRows = database.checkSelectSql("mssql", "epaperstring", "exec web.updatenoticeform @inoper;", dbparamlist);
            switch (mainRows.Rows.Count)
            {
            case 0:
                return(new itemsModels()
                {
                    showItem = false
                });
            }
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in mainRows.Rows)
            {
                items.Add(new Dictionary <string, object>()
                {
                    { "link", dr["link"].ToString().TrimEnd() }, { "name", dr["username"].ToString().TrimEnd().Substring(0, 1) }, { "value", dr["value"].ToString().TrimEnd() }, { "datetime", $"{dr["indate"].ToString().TrimEnd()} {dr["intime"].ToString().TrimEnd()}" }
                });
            }
            return(new itemsModels()
            {
                showItem = true, items = items
            });
        }
Esempio n. 3
0
        public sVeriModels GetSVeriModels(userData userData, string cuurip)
        {
            database       database    = new database();
            List <dbparam> dbparamlist = new List <dbparam>();
            string         type_       = "";
            List <Dictionary <string, object> > typeitems = new List <Dictionary <string, object> >();

            foreach (DataRow dr in database.checkSelectSql("mssql", "flyformstring", "exec web.searchtypeform;", dbparamlist).Rows)
            {
                type_ = dr["value"].ToString().TrimEnd();
                typeitems.Add(new Dictionary <string, object>()
                {
                    { "optionPadding", dr["optionPadding"].ToString().TrimEnd() == "1" }, { "value", dr["value"].ToString().TrimEnd() }
                });
            }
            string operation = "";

            dbparamlist.Add(new dbparam("@value", type_));
            List <Dictionary <string, object> > operationitems = new List <Dictionary <string, object> >();

            foreach (DataRow dr in database.checkSelectSql("mssql", "flyformstring", "exec web.searchoperationform @value;", dbparamlist).Rows)
            {
                operation = dr["operationValue"].ToString().TrimEnd();
                operationitems.Add(new Dictionary <string, object>()
                {
                    { "optionPadding", dr["optionPadding"].ToString().TrimEnd() == "1" }, { "value", dr["operationValue"].ToString().TrimEnd() }
                });
            }
            return(new sVeriModels()
            {
                type_ = type_, typeitems = typeitems, operation = operation, operationitems = operationitems, status = "istrue"
            });
        }
Esempio n. 4
0
        public itemModels GetSearchModels(userData userData, string cuurip)
        {
            database       database    = new database();
            List <dbparam> dbparamlist = new List <dbparam>();
            int            itemCount   = int.Parse(database.checkSelectSql("mssql", "flyformstring", "exec web.countmainform;", dbparamlist).Rows[0]["itemcount"].ToString().TrimEnd());
            DataTable      mainRows    = new DataTable();

            dbparamlist.Add(new dbparam("@inoper", userData.userid.TrimEnd()));
            mainRows = database.checkSelectSql("mssql", "flyformstring", "exec web.searchmainform @inoper;", dbparamlist);
            switch (mainRows.Rows.Count)
            {
            case 0:
                return(new itemModels()
                {
                    status = "nodata"
                });
            }
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in mainRows.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" }
                });
            }
            return(new itemModels()
            {
                itemCount = itemCount, items = items, status = "istrue"
            });
        }
Esempio n. 5
0
        public itemsModels GetRecordModels(userData userData, string cuurip)
        {
            DataTable      mainRows    = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@newid", userData.userid.TrimEnd()));
            mainRows = new database().checkSelectSql("mssql", "epaperstring", "exec web.searchrecordform @newid;", dbparamlist);
            switch (mainRows.Rows.Count)
            {
            case 0:
                return(new itemsModels()
                {
                    showItem = false
                });
            }
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in mainRows.Rows)
            {
                items.Add(new Dictionary <string, object>()
                {
                    { "link", dr["link"].ToString().TrimEnd() }, { "icon", dr["icon"].ToString().TrimEnd() }, { "value", dr["value"].ToString().TrimEnd() }
                });
            }
            return(new itemsModels()
            {
                showItem = true, items = items
            });
        }
Esempio n. 6
0
        public loginModels GetLoginFormModels(userData userData, string cuurip, string userAgent)
        {
            switch (string.IsNullOrWhiteSpace(userData.userid))
            {
            case true:
                return(new loginModels()
                {
                    status = "errorFormLogin"
                });
            }
            database       database    = new database();
            DataTable      loginRows   = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@newid", userData.userid.TrimEnd()));
            dbparamlist.Add(new dbparam("@externip", cuurip));
            dbparamlist.Add(new dbparam("@status", "1"));
            loginRows = database.checkSelectSql("mssql", "epaperstring", "exec web.checkformlogin @newid,@externip,@status;", dbparamlist);
            switch (loginRows.Rows.Count)
            {
            case 0:
                return(new loginModels()
                {
                    status = "nodata"
                });
            }
            if (loginRows.Rows[0]["isused"].ToString().TrimEnd() == "1" && loginRows.Rows[0]["islogin"].ToString().TrimEnd() == "1")
            {
                datetime    datetime = new datetime();
                information information = new information();
                string      date = datetime.sqldate("mssql", "epaperstring"), time = datetime.sqltime("mssql", "epaperstring");
                dbparamlist.Add(new dbparam("@cpu", ""));
                dbparamlist.Add(new dbparam("@os", information.osystem(userAgent)));
                dbparamlist.Add(new dbparam("@internip", ""));
                dbparamlist.Add(new dbparam("@indate", date));
                dbparamlist.Add(new dbparam("@intime", time));
                switch (database.checkActiveSql("mssql", "epaperstring", "update web.sitelog set cpu = @cpu,os = @os,internip = @internip,indate = @indate,intime = @intime where newid = @newid and externip = @externip and islogin = @status;", dbparamlist))
                {
                case "istrue":
                    return(new loginModels()
                    {
                        newid = loginRows.Rows[0]["newid"].ToString().TrimEnd(), name = loginRows.Rows[0]["username"].ToString().TrimEnd().Substring(0, 1), allname = loginRows.Rows[0]["username"].ToString().TrimEnd(), status = "istrue"
                    });
                }
                return(new loginModels()
                {
                    status = "error"
                });
            }
            return(new loginModels()
            {
                status = "islock"
            });
        }
Esempio n. 7
0
        public sOptonModels GetSlimitModels(userData userData, string cuurip)
        {
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in new database().checkSelectSql("mssql", "epaperstring", "exec web.searchdistinctdert;", new List <dbparam>()).Rows)
            {
                items.Add(new Dictionary <string, object>()
                {
                    { "showPanel", false }, { "dertment", dr["department"].ToString().TrimEnd() }, { "operitems", new List <Dictionary <string, object> >().ToArray() }, { "dertModify", false }
                });
            }
            return(new sOptonModels()
            {
                items = items
            });
        }
Esempio n. 8
0
        public sOptonModels GetAddModels(userData userData, string cuurip)
        {
            List <Dictionary <string, object> > items = new List <Dictionary <string, object> >();

            foreach (DataRow dr in new database().checkSelectSql("mssql", "flyformstring", "exec web.searchitemform;", new List <dbparam>()).Rows)
            {
                items.Add(new Dictionary <string, object>()
                {
                    { "opticonPadding", false }, { "icon", dr["icon"].ToString().TrimEnd() }, { "value", dr["value"].ToString().TrimEnd() }
                });
            }
            return(new sOptonModels()
            {
                items = items
            });
        }
Esempio n. 9
0
        public permissModels GetPermissModels(userData userData, string cuurip)
        {
            DataTable      mainRows    = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@newid", userData.userid.TrimEnd()));
            mainRows = new database().checkSelectSql("mssql", "epaperstring", "exec web.searchallmissform @newid;", dbparamlist);
            switch (mainRows.Rows.Count)
            {
            case 0:
                return(new permissModels()
                {
                    insert = false, update = false, delete = false, export = false
                });
            }
            return(new permissModels()
            {
                insert = mainRows.Rows[0]["isinsert"].ToString().TrimEnd() == "1", update = mainRows.Rows[0]["ismodify"].ToString().TrimEnd() == "1", delete = mainRows.Rows[0]["isdelete"].ToString().TrimEnd() == "1", export = mainRows.Rows[0]["isexport"].ToString().TrimEnd() == "1"
            });
        }
Esempio n. 10
0
 public statusModels GetSearchModels(userData userData, string cuurip)
 {
     /*database database = new database();
      * DataTable mainRows = new DataTable();
      * List<dbparam> dbparamlist = new List<dbparam>();
      * mainRows = database.checkSelectSql("mssql", "epaperstring", "select value,icon from web.qaitemform where inoper = @inoper;", dbparamlist);
      * switch (mainRows.Rows.Count)
      * {
      *  case 0:
      *      return new sItemsModels() { status = "nodata" };
      * }
      * List<Dictionary<string, object>> items = new List<Dictionary<string, object>>();
      * foreach (DataRow dr in mainRows.Rows)
      * {
      *  items.Add(new Dictionary<string, object>() { { "icon", dr["icon"].ToString().TrimEnd() }, { "value", dr["value"].ToString().TrimEnd() } });
      * }*/
     return(new statusModels()
     {
         status = "istrue"
     });
 }
Esempio n. 11
0
        public userModels GetUserModels(userData userData, string cuurip)
        {
            switch (string.IsNullOrWhiteSpace(userData.userid))
            {
            case true:
                return(new userModels()
                {
                    status = "errorUserid"
                });
            }
            database       database    = new database();
            DataTable      userRows    = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@userid", userData.userid.TrimEnd()));
            dbparamlist.Add(new dbparam("@status", "1"));
            userRows = database.checkSelectSql("mssql", "epaperstring", "exec web.checksiteber @userid,@status;", dbparamlist);
            switch (userRows.Rows.Count)
            {
            case 0:
                return(new userModels()
                {
                    status = "nodata"
                });
            }
            switch (userRows.Rows[0]["isused"].ToString().TrimEnd())
            {
            case "1":
                return(new userModels()
                {
                    newid = userRows.Rows[0]["newid"].ToString().TrimEnd(), status = "istrue"
                });
            }
            return(new userModels()
            {
                status = "islock"
            });
        }
Esempio n. 12
0
        public statusModels GetCheckNewModels(userData userData, string cuurip)
        {
            switch (string.IsNullOrWhiteSpace(userData.userid))
            {
            case true:
                return(new statusModels()
                {
                    status = "nodata"
                });
            }
            DataTable      checkRows   = new DataTable();
            List <dbparam> dbparamlist = new List <dbparam>();

            dbparamlist.Add(new dbparam("@newid", userData.userid.TrimEnd()));
            dbparamlist.Add(new dbparam("@status", "1"));
            checkRows = new database().checkSelectSql("mssql", "epaperstring", "exec web.checkformnewid @newid,@status;", dbparamlist);
            switch (checkRows.Rows.Count)
            {
            case 0:
                return(new statusModels()
                {
                    status = "nodata"
                });
            }
            switch (checkRows.Rows[0]["isused"].ToString().TrimEnd())
            {
            case "1":
                return(new statusModels()
                {
                    status = "istrue"
                });
            }
            return(new statusModels()
            {
                status = "islock"
            });
        }