private void btnupdate_Click(object sender, EventArgs e)
        {
            if (!radiobPaid.Checked)
            {
                Paid = "שולם";
            }
            else
            {
                Paid = "לא שולם";
            }

            using (var myClient = new SRProjectCompanies.ProjectCompaniesServicesClient())
            {
                var projectCompany = new SRProjectCompanies.ProjectCompanies();
                projectCompany.IdCompany         = Convert.ToInt16(CompanyId);
                projectCompany.IdProject         = Convert.ToInt16(IdProject);
                projectCompany.PriceType         = PriceType;
                projectCompany.Discriptions      = Discriptions;
                projectCompany.DateStartProject  = StartDateProject;
                projectCompany.DateFinishProject = FinishDateProject;
                projectCompany.Paid        = Paid;
                projectCompany.Destination = Destination;
                myClient.Update(projectCompany);
                //  ProjectCompaniesServices.Instance.UpdateProjectToCompany(companyId, projectId, PriceType, Discriptions,
                //    StartDateProject, FinishDateProject, Paid, Destination);
                LogUtils.WriteToLog(" Update Manage Company To Project");
                LogUtils.SystemEventLogsInformation(" Update Manage Company To Project");
                new MessageBoxText("עודכן בהצלחה").OkMessaageBox();
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Esempio n. 2
0
        //public List<dynamic> InitializeListProjectCompany()
        //{

        //    return ProjectCompaniesServices.Instance.GetAllProjectToCompany();
        //}


        /*       private string SaveAttachment(byte[] objData, string strFileToSave)
         *     {     var objSfd = new SaveFileDialog();
         *           objSfd.FileName = strFileToSave;
         *           string[] getfiledate = strFileToSave.Split(new[] { '.' });
         *           string fileType = getfiledate[1];
         *
         *           switch (fileType)
         *           {
         *               case "docx":
         *                   objSfd.Filter = string.Format("Word Doc (*.{0})|*.{0}", fileType);
         *                   break;
         *               case "doc":
         *                   objSfd.Filter = string.Format("Word Doc (*.{0})|*.{0}", fileType);
         *                   break;
         *               case "mp3":
         *                   objSfd.Filter = string.Format("MP3 (*.{0})|*.{0}", fileType);
         *                   break;
         *               case "pdf":
         *                   objSfd.Filter = string.Format("PDF (*.{0})|*.{0}", fileType);
         *                   break;
         *           }
         *
         *           if (objSfd.ShowDialog() != DialogResult.Cancel)
         *           {
         *              string  strFileToSave1 = objSfd.FileName;
         *               var objFileStream = new FileStream(strFileToSave1, FileMode.Create, FileAccess.Write);
         *               objFileStream.Write(objData, 0, objData.Length);
         *               objFileStream.Close();
         *               return strFileToSave1;
         *           }
         *         return null;
         *     }*/

        public List <string> GetDestination()
        {
            using (var myprojectCompanies = new SRProjectCompanies.ProjectCompaniesServicesClient())
            {
                var      list = new List <string>();
                string[] str  = myprojectCompanies.GetDestination();
                list = str.ToList();
                return(list);
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (var myClient = new SRProjectCompanies.ProjectCompaniesServicesClient())
            {
                var projectCompany = new SRProjectCompanies.ProjectCompanies();
                projectCompany.IdCompany = Convert.ToInt16(CompanyId);
                projectCompany.IdProject = Convert.ToInt16(IdProject);

                if (myClient.CheckProjectToCompany(projectCompany))
                {
                    if (!radiobPaid.Checked)
                    {
                        Paid = "שולם";
                    }
                    else
                    {
                        Paid = "לא שולם";
                    }

                    /*  objRow = objTable.NewRow();
                     * objRow["fileName"] = strPath[strPath.Length - 1]; //clip the full path - we just want last part!
                     * objRow["fileSize"] = intLength / 1024; // KB instead of bytes
                     * objRow["attachment"] = objData;  //our file
                     * objTable.Rows.Add(objRow); //add our new record
                     * objAdapter.Update(objTable);  */

                    projectCompany.PriceType         = PriceType;
                    projectCompany.Discriptions      = Discriptions;
                    projectCompany.DateStartProject  = StartDateProject;
                    projectCompany.DateFinishProject = FinishDateProject;
                    projectCompany.Paid        = Paid;
                    projectCompany.Destination = Destination;
                    myClient.Insert(projectCompany);
                    // ProjectCompaniesServices.Instance.InsertProjectToCompany(companyId, projectId, PriceType,
                    //   Discriptions, StartDateProject, FinishDateProject, Paid, Destination);
                    LogUtils.WriteToLog(String.Format(" Manage Company To Project: {0} And {1}", CompanyName, ProjectName));
                    LogUtils.SystemEventLogsInformation(String.Format(" Manage Company To Project: {0} And {1}", CompanyName,
                                                                      ProjectName));
                    new MessageBoxText("נוסף בהצלחה").OkMessaageBox();
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }

                else
                {
                    LogUtils.WriteToLog(String.Format(
                                            " Error Company To Project the company and project exist: {0} And {1}", CompanyName, ProjectName));
                    LogUtils.SystemEventLogsInformation(
                        String.Format(" Error Company To Project the company and project exist: {0} And {1}", CompanyName,
                                      ProjectName));
                    new MessageBoxText("קיים במערכת אותו פרויקט לספק הנבחר").OkMessaageBox();
                }
            }
        }
Esempio n. 4
0
        public void DeleteProjectCompany(DataGridViewRow dr)
        {
            using (var myClient = new SRProjectCompanies.ProjectCompaniesServicesClient())
            {
                var projectCompany = new SRProjectCompanies.ProjectCompanies();
                projectCompany.IdCompany = Convert.ToInt16(dr.Cells["idCompany"].Value.ToString());
                projectCompany.IdProject = Convert.ToInt16(dr.Cells["ProjectId"].Value.ToString());
                myClient.Delete(projectCompany);
            }

            // ProjectCompaniesServices.Instance.DeleteProjectToCompany(projectId, companyId);
        }
        private void GetOldDestination(string companyId, string idProject)
        {
            using (var myClient = new SRProjectCompanies.ProjectCompaniesServicesClient())
            {
                var projectCompany = new SRProjectCompanies.ProjectCompanies();
                projectCompany.IdCompany = Convert.ToInt16(companyId);
                projectCompany.IdProject = Convert.ToInt16(idProject);

                this.OldDestination = myClient.GetOldDestination(projectCompany);
                // this.OldDestination = ProjectCompaniesServices.Instance.GetOldDestination(Convert.ToInt16(idProject),
                //   Convert.ToInt16(companyId));
            }
        }
Esempio n. 6
0
        public DataTable InitializeListProjectCompany()
        {
            using (var ds = new DataSet())
            {
                using (var myClient = new SRProjectCompanies.ProjectCompaniesServicesClient())
                {
                    myClient.Open();
                    string       stringValue = myClient.GetAllProjectToCompany();
                    StringReader reader      = new StringReader(stringValue);
                    ds.ReadXml(reader);
                    myClient.Close();
                }
                return(ds.Tables["ProjectCompanies"]);
            }

            //  return ProjectCompaniesServices.Instance.GetAllProjectToCompany();
        }