Пример #1
0
    private void getDicContent(string keys)
    {
        QATable qa = new QATable();

        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.AppendLine(@"<?xml version='1.0' encoding='UTF-8' ?>");
        sb.AppendLine(@"<contents>");
        string[] name = qa.getDicContent(keys);

        if (name == null)
        {
            return;//没有数据返回
        }

        foreach (string n in name)
        {
            if (n != "")
            {
                sb.AppendLine(@"<content>" + n + "</content>");
            }
        }
        sb.AppendLine(@"</contents>");
        Response.Charset     = "utf-8";
        Response.ContentType = "text/xml";
        Response.Write(sb.ToString());
    }
Пример #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] == null)
        {
            Response.Redirect("../Err/Err.aspx");
        }
        QATable qat          = new QATable();
        string  scheckstair  = checkStair.Text;
        string  scheckperson = doc.Text;
        string  scheckdate   = checkdate.Text;
        string  score        = tableScore.Text;

        if (score == "")
        {
            Response.Redirect("../Err/Err.aspx");
        }

        string[] tableInfo = Request.QueryString["id"].ToString().Split(',');
        try
        {
            if ("ok".Equals(qat.saveBrifeInfo(scheckperson, scheckdate, scheckstair, tableInfo[0], tableInfo[1], tableInfo[2], score, GridView1)))
            {
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "javascript", "<script>alert('添加成功');window.location='../tableList.aspx'</script>");
            }
        }
        catch (Exception ex)
        {
            throw;
        }
    }
Пример #3
0
        public static void SyncAsync()
        {
            MobileService.SyncContext.PushAsync().ConfigureAwait(false);

            ModuleTable.PullAsync("allModules", ModuleTable.CreateQuery());
            QATable.PullAsync("allQA", QATable.CreateQuery());
            CommentTable.PullAsync("allComments", CommentTable.CreateQuery());
            SkillsTable.PullAsync("allSkills", SkillsTable.CreateQuery());
        }
Пример #4
0
        public static int InsertOrUpdateQA(QA qa)
        {
            var lookup = MobileService.GetTable <QA> ().LookupAsync(qa.id);

            if (lookup == null || qa.id == null)
            {
                QATable.InsertAsync(qa);
            }
            else
            {
                QATable.UpdateAsync(qa);
            }
            MobileService.SyncContext.PushAsync();
            return(1);
        }
Пример #5
0
        public static async Task <ObservableCollection <QA> > GetAllQA()
        {
            var x = new ObservableCollection <QA>(await QATable.ToCollectionAsync <QA>().ConfigureAwait(false));

            return(x);
        }