public void InitcombListProject()
 {
     if (IsForSpecificCompany)
     {
         combListProject.Items.Clear();
         IDToName project = new IDToName(this._projectName, this.IdProject);
         combListProject.Items.Add(project);
     }
     else
     {
         using (var projectService = new ServiceManager.ServiceSystemCompaniesClient())
         {
             var project = new ServiceManager.Project();
             project.Method = "GetAllProjectsToDropDown";
             project        = projectService.ManageProject(project);
             foreach (var listProject in project.list)
             {
                 string   projectName = listProject.Item1;
                 string   idProject   = listProject.Item2.ToString();
                 IDToName service     = new IDToName(projectName, idProject);
                 combListProject.Items.Add(service);
             }
         }
     }
     if (combListProject.Items.Count > 0)
     {
         combListProject.SelectedIndex = 0;
     }
 }
Beispiel #2
0
 public DataTable InitializeProject()
 {
     using (var ds = new DataSet())
     {
         using (var myClient = new ServiceManager.ServiceSystemCompaniesClient())
         {
             try
             {
                 var project = new ServiceManager.Project();
                 // project.Method = "GetAllProjects";
                 project.Method = "GetAllProjectsDataSet";
                 project        = myClient.ManageProject(project);
                 // string stringValue = project.DataProject;
                 // StringReader reader = new StringReader(stringValue);
                 // ds.ReadXml(reader);
                 // return ds.Tables["Project"];
                 return(project.DataProjectDataSet.Tables[0]);
             }
             catch (FaultException ex)
             {
                 LogUtils.WriteToLog(string.Format(" Error Viewing Project. Exception: {0} ", ex.Message));
                 LogUtils.SystemEventLogsError(string.Format(" Error Viewing Project. Exception: {0} ", ex.Message));
                 return(null);
             }
         }
     }
 }
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     using (var myClient = new ServiceManager.ServiceSystemCompaniesClient())
     {
         try
         {
             var project = new ServiceManager.Project();
             project.Method             = "Update";
             project.projectName        = txtbProjectName.Text;
             project.projectDescription = txtProjectDiscriptions.Text;
             project.idProject          = this.IdProject;
             myClient.ManageProject(project);
             LogUtils.WriteToLog(" Update Project: " + txtbProjectName.Text);
             LogUtils.SystemEventLogsInformation(" Update Project: " + txtbProjectName.Text);
             new MessageBoxText(string.Format(" פרויקט עודכן בהצלחה: {0}", txtbProjectName.Text)).OkMessaageBox();
             this.DialogResult = DialogResult.OK;
         }
         catch (FaultException ex)
         {
             LogUtils.WriteToLog(string.Format(" Faild Update Project: {0}. Exception: {1} ", txtbProjectName.Text, ex.Message));
             LogUtils.SystemEventLogsError(string.Format(" Faild Update Project: {0}. Exception: {1} ", txtbProjectName.Text, ex.Message));
         }
     }
     this.Close();
 }
Beispiel #4
0
 public void DeleteProject(DataGridViewRow dr)
 {
     Id = dr.Cells["idProject"].Value.ToString();
     using (var myClient = new ServiceManager.ServiceSystemCompaniesClient())
     {
         try
         {
             var project = new ServiceManager.Project();
             project.idProject = Convert.ToInt32(Id);
             project.Method    = "Delete";
             myClient.ManageProject(project);
             LogUtils.WriteToLog(" Delete Row Viewing All Project: " + dr.Cells["projectName"].Value.ToString());
             LogUtils.SystemEventLogsInformation(" Delete Row Viewing All Project: " + dr.Cells["projectName"].Value.ToString());
         }
         catch (FaultException ex)
         {
             LogUtils.WriteToLog(string.Format(" Faild Delete Project: {0}. Exception: {1} ", dr.Cells["projectName"].Value.ToString(), ex.Message));
             LogUtils.SystemEventLogsError(string.Format(" Faild Delete Project: {0}. Exception: {1} ", dr.Cells["projectName"].Value.ToString(), ex.Message));
         }
     }
 }