예제 #1
0
 private async void resfreshBtn_Click(object sender, EventArgs e)
 {
     if (uploadChkBx.Checked)
     {
         using (var client = new FileUploadClient())
         {
             try
             {
                 string path;
                 path = ZipHelper.CreateZipDictionary(tbFilePath.Text);
                 DictionaryInfo dictInfo = new DictionaryInfo()
                 {
                     Dictionary_id = Convert.ToInt32(tbDictionaryId.Text)
                     , SenderLogin = AccountHelper.GetAccount(), Action = ActionEnum.EditDict
                 };
                 Stream file = new FileStream(path, FileMode.Open);
                 await client.UploadAsync(dictInfo, file);
             }
             catch (Exception)
             {
             }
         }
     }
     using (var client = new DataClient())
     {
         var dictInfo = new DictionaryData()
         {
             Dictionary_id = Convert.ToInt32(tbDictionaryId.Text),
             Category_id   = ((CategoryData)categoryCb.SelectedItem).Category_id,
             FriendlyName  = FrendlyNameTb.Text,
             Description   = DescriptionRtb.Text
         };
         client.ChangeDictionaryInfo(dictInfo);
         client.ChangeDictionaryStatus(Convert.ToInt32(tbDictionaryId.Text), DictionaryStateEnum.Available);
     }
 }