protected void imgBtnSave_Click(object sender, ImageClickEventArgs e)
 {
     Scores insertExamScore = new Scores();  //创建Scores类对象
     insertExamScore.UserID = Request.QueryString["UserID"].ToString();
     insertExamScore.ExamTime = Convert.ToDateTime(lblExamtime.Text);
     insertExamScore.PaperID = int.Parse(Request.QueryString["PaperID"].ToString());
     insertExamScore.Score = Convert.ToInt32(sumScore.Text);
     insertExamScore.PingYu = tbxPingyu.Text;
     //实例化公共类Paper
     Paper mypaper = new Paper();
     mypaper.UserID = Request.QueryString["UserID"].ToString();
     mypaper.PaperID = int.Parse(Request.QueryString["PaperID"].ToString());
     mypaper.state = "已评阅";
     //使用CheckScore方法验证成绩是否存在
     if (!insertExamScore.CheckScore(insertExamScore.UserID, insertExamScore.PaperID))
     {
         //调用InsertByProc方法向数据库中插入成绩
         if (insertExamScore.InsertByProc())
         {
             mypaper.UpdateByProc(mypaper.UserID, mypaper.PaperID, mypaper.state);
             //给出成功提示信息
             lblMessage.Text = "考生成绩保存成功!";
         }
         else
         {
             lblMessage.Text = "考生成绩保存失败!";
         }
     }
     else
     {
         lblMessage.Text = "该用户的成绩已存在,请先删除成绩再评阅!";
     }
 }
Example #2
0
 public Report(Paper paper)
 {
     //copies the common data between reports and papers;
     this.m_aid = paper.AID;
     this.m_Link = paper.Link;
     this.m_UserID = paper.UserID;
 }
 protected void InitData()
 {
     Paper paper = new Paper();
     DataSet ds = paper.QueryAllPaper(courseName);
     GridView1.DataSource = ds;
     GridView1.DataBind();
 }
Example #4
0
 public Report(Paper paper)
 {
     //copies the common data between reports and papers;
     this.m_aid = paper.AID;
     this.m_Link = paper.Link;
     this.m_UserID = paper.UserID;
     this.compared= new LinkedList<Compare>();
 }
Example #5
0
 public Page2(MainWindow mw, TabPage page, Paper paper, Favourites fav)
 {
     InitializeComponent();
     this.fav = fav;
     this.mw = mw;
     this.page = page;
     this.paper = paper;
 }
 //初始化试卷表格
 protected void InitData()
 {
     Paper paper = new Paper();
     DataSet ds = paper.QueryUserPaperList();
     GridView1.DataSource = ds;
     GridView1.DataBind();
     LabelPageInfo.Text = "当前(第" + (GridView1.PageIndex + 1).ToString() + "页 共" + GridView1.PageCount.ToString() + "页)";
 }
Example #7
0
        public void RockVsPaperLose()
        {
            var user = new Rock();
            var computer = new Paper();

            var result = user.Challenge(computer);

            Assert.AreEqual(GameResult.Lose, result);
        }
        public void ScissorsVsScissorsNotEqaulTie()
        {
            var user = new Scissors();
            var computer = new Paper();

            var result = user.Challenge(computer);

            Assert.AreNotEqual(GameResult.Tie, result);
        }
Example #9
0
        public void ScissorsCutPaper()
        {
            var s = new Scissor();
            var p = new Paper();

            var r = s.Engage(p);

            Assert.Equal(r, true);
        }
Example #10
0
        public void PaperVsRockNotEqualTie()
        {
            var user = new Paper();
            var computer = new Rock();

            var result = user.Challenge(computer);

            Assert.AreNotEqual(GameResult.Tie, result);
        }
Example #11
0
        public void PaperVsRockWin()
        {
            var user = new Paper();
            var computer = new Rock();

            var result = user.Challenge(computer);

            Assert.AreEqual(GameResult.Win, result);
        }
Example #12
0
        public void PaperVsScissorsLose()
        {
            var user = new Paper();
            var computer = new Scissors();

            var result = user.Challenge(computer);

            Assert.AreEqual(GameResult.Lose, result);
        }
Example #13
0
        public void PaperVsScissorsNotEqualWin()
        {
            var user = new Paper();
            var computer = new Scissors();

            var result = user.Challenge(computer);

            Assert.AreNotEqual(GameResult.Win, result);
        }
        public void SetPaper(Paper paper)
        {
            RunOnUiThread (() => {
                var paperView = (WebView)FindViewById (Resource.Id.detailsWebView);
                paperView.LoadData (paper.HtmlContent, "text/html", "utf-8");
            });

            //			this.Title = paper.title;
        }
    //GridView控件RowDeleting事件
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        // 程军修改,删除试卷后,重新绑定,让该页面刷新.2010-5-5
        Paper paper = new Paper();      //创建Paper对象
        int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString()); //取出要删除记录的主键值
        paper.DeleteByProc(ID);

        GridView1.EditIndex = -1;
        InitData();
        // 程军修改,删除试卷后,重新绑定,让该页面刷新.2010-5-5
    }
Example #16
0
 public void AuthorPublication_invalidAuthorName_integer()
 {
     string invalidName = "123";
     Paper publication = new Paper("P1");
     Author chosenAuthor = new Author(invalidName);
     SystematicMappingSystem sms = new SystematicMappingSystem();
     sms.AddPaper(publication);
     int expected = chosenAuthor.numberOfPublications(sms, chosenAuthor);
     int actual = 0;
     Assert.AreEqual(expected, actual);
 }
Example #17
0
 public void AuthorPublication_invalidAuthorName_controlCharacters()
 {
     Paper publication = new Paper("P1");
     string invalidName = "./(())())()()";
     Author chosenAuthor = new Author(invalidName);
     SystematicMappingSystem sms = new SystematicMappingSystem();
     sms.AddPaper(publication);
     int expected = chosenAuthor.numberOfPublications(sms, chosenAuthor);
     int actual = 0;
     Assert.AreEqual(expected, actual);
 }
Example #18
0
 public override void write(String message, Paper sheet)
 {
     int len = message.Length;
     if ( graphiteAmount < len ) {
         sheet.writeOn(message.Substring(0, graphiteAmount));
         graphiteAmount = 0;
     } else {
         sheet.writeOn(message);
         graphiteAmount -= len;
     }
 }
Example #19
0
 public override void write(String message, Paper sheet)
 {
     int len = message.Length;
     if ( inkQuantity < len ) {
         sheet.writeOn(message.Substring(0, inkQuantity));
         inkQuantity = 0;
     } else {
         sheet.writeOn(message);
         inkQuantity -= len;
     }
 }
 //GridView控件RowDeleting事件
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     Paper paper = new Paper();      //创建Paper对象
     int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString()); //取出要删除记录的主键值
     if (!paper.DeleteAllByProc(ID))
     {
         Page.RegisterStartupScript("", "<script language=javascript>alert('删除试卷失败!')</script>");
     }
     //InitData();
     Response.Redirect("PaperLists.aspx");
 }
Example #21
0
 public void AuthorPublication_authorDoesNotExist()
 {
     Paper publication = new Paper("P1");
     string fakeAuthor = "Joe";
     Author chosenAuthor = new Author(fakeAuthor);
     SystematicMappingSystem sms = new SystematicMappingSystem();
     sms.AddPaper(publication);
     int expected = chosenAuthor.numberOfPublications(sms, chosenAuthor);
     int actual = 0;
     Assert.AreEqual(expected, actual);
 }
    public bool IsPaperNameNotExist()
    {
        Paper pp = new Paper();
        if (pp.IsPaperNameExist(txtPaperName.Text.Trim()))
        {
            txtPaperName.Text = "";
            return false;
        }
        else
        {
            return true;

        }
    }
Example #23
0
 public override void write(String message, Paper sheet)
 {
     if (!isOpen) {
         throw new ClosedPenException();
     }
     int len = message.Length;
     if ( inkQuantity < len ) {
         sheet.writeOn(message.Substring(0, inkQuantity));
         inkQuantity = 0;
     } else {
         sheet.writeOn(message);
         inkQuantity -= len;
     }
 }
Example #24
0
        public void TestPaperCrud()
        {
            IDataReader reader;
            Paper paper = new Paper ();

            paper.Title = "The refined structure of nascent HDL reveals a key functional domain for particle maturation and dysfunction";
            paper.Authors = "Zhiping Wu, Matthew A Wagner, Lemin Zheng, John S Parks, Jacinto M Shy Jr, Jonathan D Smith, Valentin Gogonea  &  Stanley L Hazen";
            paper.Journal = "Nature Structural & Molecular Biology";
            paper.Volume = "14";
            paper.Pages = "861 - 868";
            paper.Year = "2007";
            paper.Save ();

            Assert.That (paper.ID, Is.EqualTo (1));

            reader = Database.Query (String.Format ("SELECT title, authors, journal, volume, pages, year, uri, doi FROM papers WHERE id = {0}", paper.ID));
            Assert.That (reader, Is.Not.Null);

            if (reader != null) {
                reader.Read ();
                Assert.That (reader.GetString (0), Is.EqualTo (paper.Title));
                Assert.That (reader.GetString (1), Is.EqualTo (paper.Authors));
                Assert.That (reader.GetString (2), Is.EqualTo (paper.Journal));
                Assert.That (reader.GetString (3), Is.EqualTo (paper.Volume));
                Assert.That (reader.GetString (4), Is.EqualTo (paper.Pages));
                Assert.That (reader.GetString (5), Is.EqualTo (paper.Year));
                Assert.That (reader.IsDBNull (6), Is.True);
                Assert.That (reader.IsDBNull (7), Is.True);
                reader.Close ();
            }

            paper.Uri = "http://www.nature.com/nsmb/journal/v14/n9/abs/nsmb1284.html";
            paper.Doi = "10.1038/nsmb1284";
            paper.Save ();

            reader = Database.Query (String.Format ("SELECT uri, doi FROM papers WHERE id = {0}", paper.ID));
            Assert.That (reader, Is.Not.Null);

            if (reader != null) {
                reader.Read ();
                Assert.That (reader.GetString (0), Is.EqualTo (paper.Uri));
                Assert.That (reader.GetString (1), Is.EqualTo (paper.Doi));
                reader.Close ();
            }

            paper.Delete ();
            reader = Database.Query (String.Format ("SELECT title FROM papers WHERE id = {0}", paper.ID));
            Assert.That (reader, Is.Null);
        }
		protected override void OnListItemClick (ListView l, View v, int position, long id)
		{
			base.OnListItemClick (l, v, position, id);

			SelectedPaper = Papers [position];

			OnPaperSelected (this, new EventArgs ());

			if(Model != null){
				Model.CurrentPaper = SelectedPaper;
			}

			var detailsView = new Intent(this, typeof(PaperDetailActivity));
			StartActivity ( detailsView );
		}
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     string UserID = GridView1.DataKeys[e.RowIndex].Values[0].ToString(); //取出要删除记录的主键值1
     int PaperID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[1].ToString().Trim());//取出要删除记录的主键值2
     Paper paper = new Paper();
     if (paper.DeleteByProc(UserID, PaperID))
     {
         Page.RegisterStartupScript("", "<script language=javascript>alert('成功删除!')</script>");
     }
     else
     {
         Page.RegisterStartupScript("", "<script language=javascript>alert('删除失败!')</script>");
     }
     InitData();
 }
Example #27
0
        public static void Add(string filename)
        {
            Paper paper = new Paper (filename);

            // FIXME Check for metadata
            paper.Title = "Unknown";
            paper.Authors = "Unknown";
            paper.Journal = "Unknown";
            paper.Year = "Unknown";
            paper.Save ();

            papers.Add (paper);
            Log.DebugFormat ("Added new paper (ID = {0}) at '{1}' to database", paper.ID, paper.FilePath);

            if (PaperAdded != null)
                PaperAdded (paper);
        }
Example #28
0
        public void TestMethod1()
        {
            //Create Keyword and Paper
            Keyword expectedKeyword = new Keyword("Testing");
            Paper expectedPaper = new Paper("Some Paper About Testing");

            //Add keyword to paper
            expectedPaper.AddKeyword(expectedKeyword);

            //A mapping system to store the papers in
            SystematicMappingSystem sms = new SystematicMappingSystem();
            //Add paper to the system
            sms.AddPaper(expectedPaper);

            List<Keyword> keyWordsList = sms.GetKeywordsFromPaper("Some Paper About Testing");
            Assert.IsTrue(expectedKeyword.Equals(keyWordsList.First()) && keyWordsList.Count() == 1);
        }
    /// /////////
    public void TransitionUp(Paper p)
    {
        if (smc.GetCurrentState() != idle)
            return;
        //takes the place of the state_start
        paperMesh.setEnabled(true);
        paperMesh.mMaterial.SetTexture(p.PaperTexture);

        //might be reference checks
        gameObject.transform.SetPosition(p.gameObject.transform.position);
        downPos = p.gameObject.transform.position;
        gameObject.transform.rotation.Angles = p.gameObject.transform.rotation.Angles;
        downRot = gameObject.transform.rotation.Angles;

        smc.SetState(transitionUp);
        isPaperSelected = true;
    }
Example #30
0
        public void TestMethod3()
        {
            //Create Keyword and Paper
            Keyword expectedKeyword = new Keyword(null);
            Paper expectedPaper = new Paper("Some Paper About Testing");

            //Add keyword to paper
            expectedPaper.AddKeyword(expectedKeyword);

            //A mapping system to store the papers in
            SystematicMappingSystem sms = new SystematicMappingSystem();
            //Add paper to the system
            sms.AddPaper(expectedPaper);

            List<Keyword> keyWordsList = sms.GetKeywordsFromPaper("Some Paper About Testing");
            Assert.Fail();
        }
Example #31
0
        /// <summary>
        /// 通过Id查询
        /// </summary>
        /// <param name="Id">主键Id</param>
        /// <returns>Paper实体类对象</returns>
        public Paper SelectById(int Id)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@PaperId", Id)
            };
            Paper model = new Paper();

            using (SqlDataReader dr = DBHelper.RunProcedure("Paper_SelectById", param))
            {
                if (dr.Read())
                {
                    model.PaperId = Convert.ToInt32(dr["PaperId"]);
                    if (DBNull.Value != dr["PaperName"])
                    {
                        model.PaperName = dr["PaperName"].ToString();
                    }
                    model.PaperTypeId = Convert.ToInt32(dr["PaperTypeId"]);
                    if (DBNull.Value != dr["OrderIndex"])
                    {
                        model.OrderIndex = Convert.ToInt32(dr["OrderIndex"]);
                    }
                    if (DBNull.Value != dr["CreateDate"])
                    {
                        model.CreateDate = Convert.ToDateTime(dr["CreateDate"]);
                    }
                    if (DBNull.Value != dr["LastUpdateDate"])
                    {
                        model.LastUpdateDate = Convert.ToDateTime(dr["LastUpdateDate"]);
                    }
                    if (DBNull.Value != dr["AuthorName"])
                    {
                        model.AuthorName = dr["AuthorName"].ToString();
                    }
                    model.CreateUserId = Convert.ToInt32(dr["CreateUserId"]);
                    if (DBNull.Value != dr["TimeLimit"])
                    {
                        model.TimeLimit = Convert.ToInt32(dr["TimeLimit"]);
                    }
                    if (DBNull.Value != dr["FullScore"])
                    {
                        model.FullScore = Convert.ToInt32(dr["FullScore"]);
                    }
                    if (DBNull.Value != dr["PaperDesc"])
                    {
                        model.PaperDesc = dr["PaperDesc"].ToString();
                    }
                    if (DBNull.Value != dr["AnswerMode"])
                    {
                        model.AnswerMode = Convert.ToInt32(dr["AnswerMode"]);
                    }
                    if (DBNull.Value != dr["BuildAction"])
                    {
                        model.BuildAction = Convert.ToInt32(dr["BuildAction"]);
                    }
                    if (DBNull.Value != dr["Status"])
                    {
                        model.Status = Convert.ToInt32(dr["Status"]);
                    }
                    model.IsDelete = Convert.ToBoolean(dr["IsDelete"]);
                }
            }
            return(model);
        }
Example #32
0
 public Paper AddPaper(Paper paper)
 {
     context.Papers.Add(paper);
     context.SaveChanges();
     return(paper);
 }
Example #33
0
 public override bool?Beats(Paper other)
 {
     return(true);
 }
Example #34
0
 private void MenuItem_Close(object sender, RoutedEventArgs e)
 {
     Paper.Clear();
     documentFilename = notpad.Properties.Resources.NewTextFile;
     Title            = notpad.Properties.Resources.MainWIndowTitle + documentFilename;
 }
Example #35
0
 public async Task <ActionResult> GetPdfAsync(Paper paper)
 {
     return(await Task.Run <ActionResult>(() => GetPdf(paper)));
 }
Example #36
0
        public void Paper_Append()
        {
            var ppr = new Paper();

            ppr.Append("Hello");
        }
Example #37
0
        static void Main(string[] args)
        {
            int  optionSelect;
            bool validOption;

            var paper  = new Paper();
            var pencil = new Pencil();



            Console.WriteLine("*****     Pencil Simulation 1.0     *****");
            NewLine();
            NewLine();
            Console.WriteLine("Select from the following list of options: ");
            Console.WriteLine("1. New Paper\r\n2. Quit");

            InitialMenuOptions(out optionSelect, out validOption);

            while (!validOption || optionSelect < 1 || optionSelect > 2)
            {
                WriteInvalidInput();
                Console.WriteLine("1. New Paper\r\n2. Quit");
                InitialMenuOptions(out optionSelect, out validOption);
            }

            switch (optionSelect)
            {
            case 1:
                NewPaper();
                break;

            case 2:
                Quit();
                break;
            }

            PencilActionMenu(out optionSelect, out validOption);
            while (!validOption || optionSelect < 1 || optionSelect > 8)
            {
                WriteInvalidInput();
                PencilActionMenu(out optionSelect, out validOption);
            }

            while (optionSelect != 8)
            {
                switch (optionSelect)
                {
                case 1:     //Write
                    Write();
                    break;

                case 2:     //Erase
                    Erase();
                    break;

                case 3:     //Edit
                    Edit();
                    break;

                case 4:     //Read
                    Read();
                    break;

                case 5:     //Read
                    NewPaper();
                    break;

                case 6:     //Read
                    Sharpen();
                    break;

                case 7:     //Read
                    NewPencil();
                    break;

                case 8:     //Quit
                    Quit();
                    break;
                }

                PencilActionMenu(out optionSelect, out validOption);
                while (!validOption || optionSelect < 1 || optionSelect > 8)
                {
                    WriteInvalidInput();
                    PencilActionMenu(out optionSelect, out validOption);
                }
            }



            /* Local Functions
             */

            void Quit()
            {
                NewLine();
                Console.WriteLine("Thank you for using Pencil Simulator 1.0. Goodbye!");
                Environment.Exit(0);
            }

            void NewPaper()
            {
                NewLine();
                paper.NewSheet();
                Console.WriteLine("... ... ... New piece of Paper ready!");
                NewPencil();
            }

            void NewPencil()
            {
                NewLine();
                int newPencilOption;

                Console.WriteLine("What Kind of Pencil would you like? ");
                NewLine();
                Console.WriteLine("Select from the following list of options: ");
                Console.WriteLine("1. Small Pencil\r\n2. Big Pencil\r\n3. Custom Pencil\r\n4.Quit\r\n");



                while (!(int.TryParse(Console.ReadLine(), out newPencilOption)) || newPencilOption < 1 || newPencilOption > 4)
                {
                    Console.WriteLine("Invalid Selection. Please try again.");
                    Console.WriteLine("1. Small Pencil\r\n2. Big Pencil\r\n3. Custom Pencil\r\n4. Quit");
                }

                switch (newPencilOption)
                {
                case 1:
                    SmallPencil();
                    break;

                case 2:
                    BigPencil();
                    break;

                case 3:
                    CustomPencil();
                    break;

                case 4:
                    Quit();
                    break;
                }
            }

            void SmallPencil()
            {
                pencil = new Pencil(40, 5, 10);
                Console.WriteLine("Small pencil can write between 20 and 40 characters, be sharpened 5 times, and erase 10 characters. Go write!\r\n\r\n");
            }

            void BigPencil()
            {
                pencil = new Pencil(80, 10, 20);
                Console.WriteLine("A Big pencil can write between 40 and 80 characters, be sharpened 10 times, and erase 20 characters. Go write!\r\n\r\n");
            }

            void CustomPencil()
            {
                int length, tip, eraser;

                string input;

                Console.WriteLine("Enter Length: ");
                input = Console.ReadLine();

                length = ErrorHandle(input);

                Console.WriteLine("Enter Tip Durability: ");
                input = Console.ReadLine();

                tip = ErrorHandle(input);

                Console.WriteLine("Enter Eraser Durability: ");
                input = Console.ReadLine();

                eraser = ErrorHandle(input);


                Console.WriteLine("Allright. Pencil created with " + tip + " tip durability, " + eraser + " eraser durability, and a length of " + length + "\r\n\r\n");

                pencil = new Pencil(tip, length, eraser);
            }

            int ErrorHandle(string value)
            {
                bool NaN = int.TryParse(value, out int number);

                while (!NaN || number <= 0)
                {
                    Console.Write("\r\n");
                    Console.WriteLine("Sorry! That is not a valid input. Please enter a number above 0!");
                    value = Console.ReadLine();

                    NaN = int.TryParse(value, out number);
                }

                return(number);
            }

            void WriteInvalidInput()
            {
                Console.Write("\r\n");
                Console.WriteLine("Invalid Selection. Please try again.");
            }

            void NewLine()
            {
                Console.Write("\r\n");
            }

            void Sharpen()
            {
                NewLine();
                pencil.Sharpen();
                Console.Write("... ... ... Pencil Sharpened! Tip durability is once again " + pencil.Tip + ". You have " + pencil.Length + " length of pencil left. \r\n");
                NewLine();
            }

            void Write()
            {
                NewLine();
                Console.WriteLine("What do you want to write on your paper?");
                string input = Console.ReadLine();

                paper.Prose(pencil.Write(input));
                NewLine();
                Read();
            }

            void Read()
            {
                Console.Write("\r\n --- Your Paper -- \r\n");
                Console.WriteLine(paper.Content);
                NewLine();
            }

            void Erase()
            {
                NewLine();
                Console.WriteLine("What would you like to erase?");
                string input = Console.ReadLine();

                try
                {
                    paper.Delete(pencil.Erase(input));
                }catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                NewLine();
                Read();
            }

            void Edit()
            {
                NewLine();
                Console.WriteLine("What would you like to edit into the last empty space created?");
                string input = Console.ReadLine();

                paper.Edit(pencil.Write(input));
                NewLine();
                Read();
            }
        }
Example #38
0
        public void AddBidding(Paper paper, string bidEnum, User currentUser)
        {
            BidEnum bide = (BidEnum)Enum.Parse(typeof(BidEnum), bidEnum);

            server.AddBidding(paper, bide, currentUser);
        }
Example #39
0
    private void Show()
    {
        IList all = PaperType.Init().GetAll(null, null);

        this.TypeID.Items.Clear();
        this.TypeID.Items.Add(new ListItem("所有电子档案分类", ""));
        foreach (object current in all)
        {
            PaperTypeInfo paperTypeInfo = current as PaperTypeInfo;
            this.TypeID.Items.Add(new ListItem(paperTypeInfo.TypeName, string.Concat(paperTypeInfo.id)));
        }
        IList list = null;

        if (!string.IsNullOrEmpty(base.Request.QueryString["TypeID"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperName"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperSymbol"]) || !string.IsNullOrEmpty(base.Request.QueryString["SendDep"]) || !string.IsNullOrEmpty(base.Request.QueryString["PaperGrade"]) || !string.IsNullOrEmpty(base.Request.QueryString["StartTime"]) || !string.IsNullOrEmpty(base.Request.QueryString["EndTime"]))
        {
            string text  = base.Request.QueryString["TypeID"];
            string text2 = base.Request.QueryString["PaperName"];
            string text3 = base.Request.QueryString["PaperSymbol"];
            string text4 = base.Request.QueryString["SendDep"];
            string text5 = base.Request.QueryString["PaperGrade"];
            string text6 = base.Request.QueryString["StartTime"];
            string text7 = base.Request.QueryString["EndTime"];
            string text8 = " 1=1 and (ShareDeps='' or ShareDeps like '%#" + this.DepID + "#%') ";
            if (!string.IsNullOrEmpty(text))
            {
                text8 = text8 + " and (TypeID=" + text + ") ";
            }
            if (!string.IsNullOrEmpty(text2))
            {
                text8 = text8 + " and (PaperName like '%" + text2 + "%') ";
            }
            if (!string.IsNullOrEmpty(text3))
            {
                text8 = text8 + " and (PaperSymbol like '%" + text3 + "%') ";
            }
            if (!string.IsNullOrEmpty(text4))
            {
                text8 = text8 + " and (SendDep like '%" + text4 + "%') ";
            }
            if (!string.IsNullOrEmpty(text5))
            {
                text8 = text8 + " and (PaperGrade like '%" + text5 + "%') ";
            }
            if (!string.IsNullOrEmpty(text6) && !string.IsNullOrEmpty(text7))
            {
                string text9 = text8;
                text8 = string.Concat(new string[]
                {
                    text9,
                    " and (PaperDate between '",
                    text6,
                    "' and '",
                    text7,
                    "')"
                });
            }
            if (!string.IsNullOrEmpty(text6) && string.IsNullOrEmpty(text7))
            {
                text8 = text8 + " and (PaperDate between '" + text6 + "' and getdate())";
            }
            if (string.IsNullOrEmpty(text6) && !string.IsNullOrEmpty(text7))
            {
                text8 = text8 + " and (PaperDate between getdate() and '" + text7 + "')";
            }
            list = Paper.Init().GetAll(text8, "order by id desc");
        }
        else
        {
            if (base.Request.QueryString["td"] != null)
            {
                list = Paper.Init().GetAll("TypeID=" + base.Request.QueryString["td"], "order by id desc");
            }
            else
            {
                list = Paper.Init().GetAll(null, "order by id desc");
            }
        }
        Hashtable hashtable = (Hashtable)HttpContext.Current.Application["config_fenye"];
        int       pageSize  = Convert.ToInt32(hashtable["fenye_commom"]);
        int       num       = 0;

        try
        {
            if (!string.IsNullOrEmpty(base.Request.QueryString["page"]))
            {
                num = Convert.ToInt32(base.Request.QueryString["page"]);
            }
        }
        catch
        {
        }
        if (num == 0)
        {
            num = 1;
        }
        PagedDataSource pagedDataSource = new PagedDataSource();

        pagedDataSource.DataSource       = list;
        pagedDataSource.AllowPaging      = true;
        pagedDataSource.PageSize         = pageSize;
        pagedDataSource.CurrentPageIndex = num - 1;
        this.rpt.DataSource = pagedDataSource;
        this.rpt.DataBind();
        if (base.Request.QueryString["PaperName"] == null)
        {
            if (base.Request.QueryString["td"] != null)
            {
                this.Page1.sty("meneame", num, pagedDataSource.PageCount, "?td=" + base.Request.QueryString["td"] + "&page=");
            }
            else
            {
                this.Page1.sty("meneame", num, pagedDataSource.PageCount, "?page=");
            }
        }
        if (base.Request.QueryString["PaperName"] != null)
        {
            this.Page1.sty("meneame", num, pagedDataSource.PageCount, string.Concat(new string[]
            {
                "?PaperName=",
                base.Request.QueryString["PaperName"],
                "&TypeID=",
                base.Request.QueryString["TypeID"],
                "&PaperSymbol=",
                base.Request.QueryString["PaperSymbol"],
                "&SendDep=",
                base.Request.QueryString["SendDep"],
                "&PaperGrade=",
                base.Request.QueryString["PaperGrade"],
                "&StartTime=",
                base.Request.QueryString["StartTime"],
                "&EndTime=",
                base.Request.QueryString["EndTime"],
                "&page="
            }));
        }
        this.num.InnerHtml = "当前查询条件总计 - <span style='color:#ff0000; font-weight:bold;'>" + list.Count + "</span> 条 记录数据";
    }
 public void Initialize()
 {
     paper  = new Paper();
     pencil = new Pencil();
 }
Example #41
0
        /// <summary>
        /// 查看全部
        /// </summary>
        /// <returns>list集合</returns>
        public List <Paper> SelectAll()
        {
            List <Paper> list  = new List <Paper>();
            Paper        model = null;

            using (SqlDataReader dr = DBHelper.RunProcedure("Paper_SelectAll", null))
            {
                while (dr.Read())
                {
                    model         = new Paper();
                    model.PaperId = Convert.ToInt32(dr["PaperId"]);
                    if (DBNull.Value != dr["PaperName"])
                    {
                        model.PaperName = dr["PaperName"].ToString();
                    }
                    model.PaperTypeId = Convert.ToInt32(dr["PaperTypeId"]);
                    if (DBNull.Value != dr["OrderIndex"])
                    {
                        model.OrderIndex = Convert.ToInt32(dr["OrderIndex"]);
                    }
                    if (DBNull.Value != dr["CreateDate"])
                    {
                        model.CreateDate = Convert.ToDateTime(dr["CreateDate"]);
                    }
                    if (DBNull.Value != dr["LastUpdateDate"])
                    {
                        model.LastUpdateDate = Convert.ToDateTime(dr["LastUpdateDate"]);
                    }
                    if (DBNull.Value != dr["AuthorName"])
                    {
                        model.AuthorName = dr["AuthorName"].ToString();
                    }
                    model.CreateUserId = Convert.ToInt32(dr["CreateUserId"]);
                    if (DBNull.Value != dr["TimeLimit"])
                    {
                        model.TimeLimit = Convert.ToInt32(dr["TimeLimit"]);
                    }
                    if (DBNull.Value != dr["FullScore"])
                    {
                        model.FullScore = Convert.ToInt32(dr["FullScore"]);
                    }
                    if (DBNull.Value != dr["PaperDesc"])
                    {
                        model.PaperDesc = dr["PaperDesc"].ToString();
                    }
                    if (DBNull.Value != dr["AnswerMode"])
                    {
                        model.AnswerMode = Convert.ToInt32(dr["AnswerMode"]);
                    }
                    if (DBNull.Value != dr["BuildAction"])
                    {
                        model.BuildAction = Convert.ToInt32(dr["BuildAction"]);
                    }
                    if (DBNull.Value != dr["Status"])
                    {
                        model.Status = Convert.ToInt32(dr["Status"]);
                    }
                    model.IsDelete = Convert.ToBoolean(dr["IsDelete"]);
                    list.Add(model);
                }
            }
            return(list);
        }
Example #42
0
 public Roshambo(Name nm, Rock rk, Paper pr, Scissors sc, bool en) : this(new Id("0"), nm, rk, pr, sc, en)
 {
 }
Example #43
0
 /// <summary>for iPhone</summary>
 public PaperElement(Paper p) : base(p.title)
 {
     paper = p;
 }
Example #44
0
 public Roshambo(Name nm, Rock rk, Paper pr, Scissors sc) : this(new Id("0"), nm, rk, pr, sc, true)
 {
 }
Example #45
0
 public ActionResult Edit(Paper paper)
 {
     db.Entry(paper).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
Example #46
0
 public Outcome GetOutcome(Paper paper)
 {
     return(Outcome.WIN);
 }