private void btnUpdate_Click(object sender, EventArgs e)
 {
     using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
     {
         try
         {
             var service = new ServiceManager.Service();
             service.Method             = "Update";
             service.ServiceName        = txtbServiceName.Text;
             service.serviceDescription = txtbServiceDescription.Text;
             service.IdService          = Convert.ToInt32(FormViewingServices.Id);
             serviceService.MangeServices(service);
             MessageUtils.LogUtils.WriteToLog(" Update Service: " + txtbServiceName.Text + "Description: " + this.ServiceDescription);
             MessageUtils.LogUtils.SystemEventLogsInformation(" Update Service: " + txtbServiceName.Text + "Description: " + this.ServiceDescription);
             new MessageUtils.MessageBoxText(string.Format(" שרות עודכן בהצלחה: {0}", txtbServiceName.Text)).OkMessaageBox();
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
         catch (FaultException ex)
         {
             MessageUtils.LogUtils.WriteToLog(" Update Service Faild dosn't Exist!!!!: " + txtbServiceName.Text + " Exception: " + ex.Message);
             MessageUtils.LogUtils.SystemEventLogsError("Update Service Faild dosn't Exist!!!!: " + txtbServiceName.Text + " Exception: " + ex.Message);
             new MessageUtils.MessageBoxText(string.Format(" Update Service Faild dosn't Exist!!!!: {0}", txtbServiceName.Text)).ErrorMessageBox();
             this.DialogResult = DialogResult.OK;
             this.Close();
         }
     }
 }
 public DataTable InitServicedatagrid()
 {
     using (var ds = new DataSet())
     {
         using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
         {
             try
             {
                 var service = new ServiceManager.Service();
                 // service.Method = "GetAllService";
                 service.Method = "GetAllServiceDataSet";
                 service        = serviceService.MangeServices(service);
                 // StringReader reader = new StringReader(service.ServiceData);
                 //ds.ReadXml(reader);
                 // return ds.Tables["Service"];
                 return(service.ServiceDataSet.Tables[0]);
             }
             catch (FaultException ex)
             {
                 LogUtils.WriteToLog(string.Format(" Error Viewing All Services. Exception: {0} ", ex.Message));
                 LogUtils.SystemEventLogsError(string.Format(" Error Viewing All Services. Exception: {0} ", ex.Message));
                 return(null);
             }
         }
     }
 }
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
     {
         var service = new ServiceManager.Service();
         service.Method             = "Insert";
         service.ServiceName        = txtbServiceName.Text;
         service.serviceDescription = txtbServiceDescription.Text;
         serviceService.MangeServices(service);
     }
     MessageUtils.LogUtils.WriteToLog(" Add Service: " + txtbServiceName.Text);
     MessageUtils.LogUtils.SystemEventLogsInformation(" Add Service:" + txtbServiceName.Text);
     new MessageUtils.MessageBoxText(string.Format(" שרות נוסף בהצלחה: {0}", txtbServiceName.Text)).OkMessaageBox();
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
 public void DeleteService(DataGridViewRow dr)
 {
     Id = dr.Cells["idService_Services"].Value.ToString();
     try
     {
         using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
         {
             var service = new ServiceManager.Service();
             service.Method    = "Delete";
             service.IdService = Convert.ToInt32(Id);
             serviceService.MangeServices(service);
             MessageUtils.LogUtils.WriteToLog(" Delete Row Viewing All Services: " +
                                              dr.Cells["servicesName"].Value);
             MessageUtils.LogUtils.SystemEventLogsInformation(string.Format(" Delete Row Viewing All Services: {0}", dr.Cells["servicesName"].Value));
         }
     }
     catch (FaultException e)
     {
         MessageUtils.LogUtils.WriteToLog(string.Format(" Service Name: {0}  Exception: {1}  ", dr.Cells["servicesName"].Value, e.Message));
         MessageUtils.LogUtils.SystemEventLogsError(string.Format(" Service Name: {0} Exception: {1} ", dr.Cells["servicesName"].Value, e.Message));
     }
 }
 public void InitcombListServices()
 {
     if (IsForSpecificCustomer)
     {
         combListServices.Items.Clear();
         IDToName service = new IDToName(this._serviceName, this.ServiceId);
         combListServices.Items.Add(service);
     }
     else
     {
         using (var serviceService = new ServiceManager.ServiceSystemCompaniesClient())
         {
             try
             {
                 var service = new ServiceManager.Service();
                 service.Method = "GetAllServiceToDropDown";
                 service        = serviceService.MangeServices(service);
                 foreach (var listService in service.list)
                 {
                     string   serviceName   = listService.Item2;
                     string   idService     = Convert.ToString(listService.Item1);
                     IDToName serviceToDrop = new IDToName(serviceName, idService);
                     combListServices.Items.Add(serviceToDrop);
                 }
             }
             catch (FaultException ex)
             {
                 MessageUtils.LogUtils.WriteToLog(String.Format(" Error Get All Service To DropDown: {0}", ex.Message));
                 MessageUtils.LogUtils.SystemEventLogsError(String.Format(" Error Get All Service To DropDown: {0}", ex.Message));
             }
         }
     }
     if (combListServices.Items.Count > 0)
     {
         combListServices.SelectedIndex = 0;
     }
 }