Example #1
0
        //--------------------------------------------------------------------------------------------------------------------------------------------------------------
        #region Upload
        private void Upload_Du_Lieu(object sender, RoutedEventArgs e)
        {
            string result = F_UploadData.Upload(uiapp, doc, thong_tin_quantity_total_project, thong_tin_quantity_project, material_of_element_in_project, id_file, user);

            if (result == "S")
            {
                MessageBox.Show("Upload Success!", "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
Example #2
0
 //----------------------------------------------------------
 private void Upload_Du_Lieu_WEB(object sender, RoutedEventArgs e)
 {
     try
     {
         if (thong_tin_quantity_total_web.SelectedItem != null)
         {
             data_table_note item = (data_table_note)thong_tin_quantity_total_web.SelectedItem;
             Get_Source();
             string result = "F";
             if (thong_tin_quantity_total_project.Items.Count > 0)
             {
                 result = F_UploadData.Upload(uiapp, doc, thong_tin_quantity_total_project, thong_tin_quantity_project, material_of_element_in_project, id_file, user);
             }
             if (thong_tin_quantity_input.Items.Count > 0)
             {
                 F_SaveData.save_data_input(uiapp, doc, input_block, input_level, input_material, input_id, input_quantity, input_unit, id_file, my_quantity_input, false, user);
                 show_data_input(id_file, thong_tin_quantity_input);
                 result = "S";
             }
             if (result == "S")
             {
                 MessageBox.Show("Upload Success!", "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
                 List <string> para = new List <string>()
                 {
                     "@DBProjectNumber", "@DBId", "@DBStatus"
                 };
                 for (int i = 0; i < item.ids.Count(); i++)
                 {
                     var a = JsonConvert.SerializeObject(new data_status()
                     {
                         open = false, edited = item.editeds[i]
                     });
                     List <object> para_value = new List <object>()
                     {
                         project_number, item.ids[i], a
                     };
                     SQL.SQLWrite(Source.path_WEB, "dbo.spUpdate_OnlyStatusQuantityNotes", Source.type_Procedure, para, para_value);
                 }
                 F_QuantityNotes.Get_Data_Notes_Web(project_number, Class, my_table_note, thong_tin_quantity_total_web);
             }
             else
             {
                 MessageBox.Show("Missing data. Upload fail!", "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }