Пример #1
0
 public async void Edit_Designation()
 {
     if (selectDesignation.DESIGNATION_ID != null && selectDesignation.DESIGNATION_ID != 0)
     {
         long id = selectDesignation.DESIGNATION_ID;
         App.Current.Properties["Action"] = "Edit";
         HttpClient client = new HttpClient();
         client.BaseAddress = new Uri(GlobalData.gblApiAdress);
         client.DefaultRequestHeaders.Accept.Add(
             new MediaTypeWithQualityHeaderValue("application/json"));
         client.Timeout = new TimeSpan(500000000000);
         HttpResponseMessage response = client.GetAsync("api/DesignationListAPI/DesignationEdit?id=" + id + "").Result;
         if (response.IsSuccessStatusCode)
         {
             data = JsonConvert.DeserializeObject <DesignationModel[]>(await response.Content.ReadAsStringAsync());
             if (data.Length > 0)
             {
                 for (int i = 0; i < data.Length; i++)
                 {
                     selectDesignation.DESIGNATION_ID   = data[i].DESIGNATION_ID;
                     selectDesignation.DESIGNATION_NAME = data[i].DESIGNATION_NAME;
                     selectDesignation.CREATED_BY       = data[i].CREATED_BY;
                     selectDesignation.CREATED_DATE     = data[i].CREATED_DATE;
                     selectDesignation.IS_DELETE        = data[i].IS_DELETE;
                     selectDesignation.COMPANY_ID       = data[i].COMPANY_ID;
                     selectDesignation.SORT_INDEX       = data[i].SORT_INDEX;
                     selectDesignation.STATUS           = data[i].STATUS;
                 }
                 App.Current.Properties["DesignationEdit"] = selectDesignation;
                 DesignationAdd IA = new DesignationAdd();
                 IA.Show();
             }
         }
     }
     else
     {
         MessageBox.Show("Select Designation first", "Designation Selection", MessageBoxButton.OK, MessageBoxImage.Error);
         return;
     }
 }
Пример #2
0
        public void AddDesignation_Click()
        {
            DesignationAdd IA = new DesignationAdd();

            IA.Show();
        }