private void buttonX2_Click(object sender, EventArgs e)
        {
            List <ValuationForm> ValuationForm1 = ValuationForm.GetAllbyIdValuationname(Valuationname.Valuationnamelist[comboBoxEx2.SelectedIndex].id);
            XDocument            XDocument      = new XDocument(new XElement("Asset"));



            XDocument.Root.Add(new XElement("DateTime", DateTime.Now.ToShortDateString()));
            XDocument.Root.Add(new XElement("IdForm", Valuationname.Valuationnamelist[comboBoxEx2.SelectedIndex].id.ToString()));
            XElement Qustion   = new XElement("Qustion");
            XElement QustionId = new XElement("QustionId");
            XElement AllName   = new XElement("AllName");
            XElement AllNameId = new XElement("AllNameId");

            for (int i = 0; i < ValuationForm1.Count; i++)
            {
                Qustion.Add(new XElement("Q" + i.ToString(), Qustiones.Qustioneslist[ClassDataGridViewDo.RetunIndexByIdSech(ValuationForm1[i].id_qustion, Qustiones.Qustioneslist)].name));
                QustionId.Add(new XElement("Q" + i.ToString(), Qustiones.Qustioneslist[ClassDataGridViewDo.RetunIndexByIdSech(ValuationForm1[i].id_qustion, Qustiones.Qustioneslist)].id.ToString()));
            }
            for (int i = 0; i < dataGridViewX1.Rows.Count; i++)
            {
                AllNameId.Add(new XElement(
                                  "N" + i.ToString(), dataGridViewX1.Rows[i].Cells[0].Value.ToString()));
                AllName.Add(new XElement(

                                "N" + i.ToString(), dataGridViewX1.Rows[i].Cells[1].Value.ToString()));
            }
            XDocument.Root.Add(Qustion);
            XDocument.Root.Add(QustionId);
            XDocument.Root.Add(AllName);
            XDocument.Root.Add(AllNameId);
            XDocument.Root.Add(new XElement("idOprtion", "Deb"));
            DownloadDataFromWebCliend.RetXmlFile(DownloadDataFromWebCliend.EnumGetXML.MakeAssetGet, XDocument, UserNameGetWebSite1[comboBoxEx1.SelectedIndex].id);
        }
        public vitelAssingInformation(List <int> IdQustion, List <int> Resuit, int idInformation, int IdForm)
        {
            this.IdQustion     = IdQustion;
            this.Resuit        = Resuit;
            this.idInformation = idInformation;
            count       = IdQustion.Count;
            this.IdForm = IdForm;
            List <ValuationForm> ValuationFormall = ValuationForm.GetAllbyIdValuationname(IdForm);

            mark.Clear();
            foreach (ValuationForm item in ValuationFormall)
            {
                mark.Add(item.mark);
            }
        }
Exemplo n.º 3
0
        public float GetResut()
        {
            XElement             Resuit1 = Xml.Root.Element("Resuit");
            List <XElement>      Resuit  = Resuit1.Elements().ToList();
            List <ValuationForm> mark    = ValuationForm.GetAllbyIdValuationname(this.id_ValuationForm);
            float AllMark = 0;
            float Mark    = 0;

            for (int i = 0; i < Resuit.Count; i++)
            {
                AllMark += (Convert.ToSingle(Resuit[i].Value) * (mark[i].mark / 100f));
                Mark    += (mark[i].mark / 100f);
            }

            AllMark /= Mark;
            return(AllMark);
        }