Beispiel #1
0
        async void OnButtonsubmitClicked(object sender, EventArgs e)
        {
            var t     = title.Text;
            var c     = content.Text;
            var uid   = CrossSecureStorage.Current.GetValue("id");
            var uname = CrossSecureStorage.Current.GetValue("firstname") + " " + CrossSecureStorage.Current.GetValue("lastname");

            if (t != null && c != null)
            {
                advise           = new Advise();
                advise.caseName  = t;
                advise.userTalk  = c;
                advise.userId    = uid;
                advise.userName  = uname;
                advise.needReply = 1;

                if (uid != null)
                {
                    await ExecuteInsert();
                    await DisplayAlert("SUCCESS", "Thanks for your advice, and we will solving it in soon", "OK");
                }
                else
                {
                    await DisplayAlert("ERROR", "please login at first", "OK");
                }
            }
            else
            {
                await DisplayAlert("ERROR", "uncompleted content", "OK");
            }
        }
Beispiel #2
0
        public async static Task UpdateAdvise(string aid)
        {
            if (!await Initialize())
            {
                return;
            }

            var    adviseList = new List <Advise>();
            Advise advise     = new Advise();

            var itemQuery = docClient.CreateDocumentQuery <Advise>(
                UriFactory.CreateDocumentCollectionUri(databaseName, collectionName),
                new FeedOptions {
                MaxItemCount = -1, EnableCrossPartitionQuery = true
            })
                            .Where(advise => advise.Id == aid)
                            .AsDocumentQuery();

            while (itemQuery.HasMoreResults)
            {
                var queryResult = await itemQuery.ExecuteNextAsync <Advise>();

                adviseList.AddRange(queryResult);
                advise          = adviseList[0];
                advise.isSolved = 1;
            }

            var docUri = UriFactory.CreateDocumentUri(databaseName, collectionName, advise.Id);
            await docClient.ReplaceDocumentAsync(docUri, advise);
        }
Beispiel #3
0
 public async static Task UpdateAdvise(Advise advise)
 {
     if (!await Initialize())
     {
         return;
     }
     var docUri = UriFactory.CreateDocumentUri(databaseName, collectionName, advise.Id);
     await docClient.ReplaceDocumentAsync(docUri, advise);
 }
Beispiel #4
0
        public async static Task InsertAdvise(Advise advise)
        {
            if (!await Initialize())
            {
                return;
            }

            await docClient.CreateDocumentAsync(
                UriFactory.CreateDocumentCollectionUri(databaseName, collectionName),
                advise);
        }
Beispiel #5
0
        public static StatusReport GetAdvise(string ztName, string phone)
        {
            StatusReport sr        = new StatusReport();
            string       sqlstring = " select ID,分类,姓名,联系电话,地址,表扬建议,内容,提交时间,照片1,照片2,照片3 " +
                                     " from 基础资料_表扬建议管理 " +
                                     " where 分类 = @分类 and 联系电话 = @联系电话" +
                                     " order by ID desc ";
            DataTable dt = SQLHelper.ExecuteQuery("wyt", sqlstring,
                                                  new SqlParameter("@分类", ztName),
                                                  new SqlParameter("@联系电话", phone));

            if (dt.Rows.Count == 0)
            {
                sr.status = "Fail";
                sr.result = "未查询到任何数据";
                return(sr);
            }
            List <Advise> adviseList = new List <Advise>();

            foreach (DataRow dr in dt.Rows)
            {
                List <string> imageList = new List <string>();
                Advise        advise    = new Advise();
                advise.Id         = DataTypeHelper.GetIntValue(dr["ID"]);
                advise.classify   = DataTypeHelper.GetStringValue(dr["分类"]);
                advise.Name       = DataTypeHelper.GetStringValue(dr["姓名"]);
                advise.Phone      = DataTypeHelper.GetStringValue(dr["联系电话"]);
                advise.RoomNumber = DataTypeHelper.GetStringValue(dr["地址"]);
                advise.Type       = DataTypeHelper.GetStringValue(dr["表扬建议"]);
                advise.Content    = DataTypeHelper.GetStringValue(dr["内容"]);
                advise.SubmitDate = DataTypeHelper.GetDateStringValue(dr["提交时间"]);
                imageList.Add(DataTypeHelper.GetStringValue(dr["照片1"]));
                imageList.Add(DataTypeHelper.GetStringValue(dr["照片2"]));
                imageList.Add(DataTypeHelper.GetStringValue(dr["照片3"]));
                advise.Image = imageList.ToArray();
                adviseList.Add(advise);
            }
            sr.status = "Success";
            sr.result = "成功";
            sr.data   = adviseList.ToArray();
            return(sr);
        }
Beispiel #6
0
 async void tap(object sender, ItemTappedEventArgs e)
 {
     tap_num      = e.ItemIndex;
     re.IsEnabled = true;
     advise       = getunSolvedAdviseViewModel.AdviselList[tap_num];
 }
 public AdviseController()
 {
     advise = new Advise();
 }
Beispiel #8
0
 public TitleController()
 {
     title    = new Title();
     advise   = new Advise();
     category = new Category();
 }