Esempio n. 1
0
        private void UpdateDataView()
        {
            dg.Visible = wBtDelete.Visible = wBtProcess.Visible = true;
            DataSet ds            = new DataSet();
            string  xmlDirContent = QDEUtils.wsTranslationObj.GetFilesToProcess(credential);

            if (xmlDirContent != String.Empty)
            {
                System.Xml.XmlDataDocument datadoc = new System.Xml.XmlDataDocument();
                datadoc.DataSet.ReadXml(new System.IO.StringReader(xmlDirContent));
                if (datadoc.DataSet.Tables.Count == 2)
                {
                    dg.DataSource = datadoc.DataSet.Tables[1];
                    dg.DataBind();
                    Utils.InitGridSort(ref dg, false);
                }
                else
                {
                    dg.Visible = false;
                }
            }
            else
            {
                dg.Visible        = false;
                wBtDelete.Visible = wBtProcess.Visible = false;
            }
            QDEUtils.wsTranslationObj.SignOff(credential);
            ds.Dispose();
        }
Esempio n. 2
0
        public static void SetValue(string AppKey, string AppValue)
        {
            System.Xml.XmlDataDocument xDoc = new System.Xml.XmlDataDocument();
            // xDoc.Load("../../App.config");
            string filePath = System.Windows.Forms.Application.ExecutablePath + ".config";

            xDoc.Load(filePath);//

            System.Xml.XmlNodeList nodeList = null;
            nodeList = xDoc.SelectSingleNode("//configuration//appSettings").ChildNodes;
            if (nodeList != null)
            {
                foreach (System.Xml.XmlNode xn in nodeList)
                {
                    System.Xml.XmlElement xe = xn as System.Xml.XmlElement;
                    if (xe != null)
                    {
                        if (xe.Name == "add")
                        {
                            string s = xe.GetAttribute("key");
                            string p = xe.GetAttribute("value");
                            if (s == AppKey)
                            {
                                xe.SetAttribute("value", AppValue);
                            }
                        }
                    }
                }
            }
            xDoc.Save(filePath);
        }
        private void buttonItem2_Click(object sender, EventArgs e)
        {
            for (int n = 0; dataGridViewX1.Rows.Count - 1 > 0; n++)
            {
                #region Adder
                int      id             = 0;
                string   first_name     = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[1].Value);
                string   Last_name      = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[2].Value);
                string   Father_name    = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[3].Value);
                string   Mather_name    = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[4].Value);
                Int64    natiol_id      = ClassConvert.Convint64(dataGridViewX1.Rows[n].Cells[8].Value);
                bool     Gender         = ClassConvert.ConvBool(dataGridViewX1.Rows[n].Cells[5].Value);
                string   where_birth    = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[6].Value);
                DateTime data_barthday  = ClassConvert.ConvDateTime(dataGridViewX1.Rows[n].Cells[7].Value);
                string   e_mail         = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[18].Value);
                int      Phone_Ground   = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[20].Value);
                int      Phone_Mobile1  = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[19].Value);
                string   study          = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[9].Value);
                int      yearstudy      = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[10].Value);
                int      Id_course      = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[0].Value);
                string   Id_course_Ware = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[21].Value);
                DateTime data_regs      = ClassConvert.ConvDateTime(dataGridViewX1.Rows[n].Cells[17].Value);
                int      bitd_id        = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[11].Value);
                string   nameEnglish    = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[12].Value);
                int      Z1             = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[13].Value);
                int      z2             = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[14].Value);
                int      z3             = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[15].Value);
                string   Hanei_whare    = "";
                string   Hanei_whare1   = "";
                string   adderas        = "";

                int    Stutes_Jtma3  = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[16].Value);
                int    Phone_Mobile2 = 0;
                string Facebook      = "";
                int    whatsApp      = 0;
                int    viper         = 0;
                string Twiter        = "";

                System.Drawing.Image Image_id_nationl1 = null;
                System.Drawing.Image Image_id_nationl2 = null;
                System.Drawing.Image image             = null;
                System.Drawing.Image Image_font        = null;

                string Nkname = "";


                System.Xml.XmlDataDocument XmlHobbies = null;;

                /*
                 * string[] liststring = System.IO.Directory.GetFiles(".\\", "Hobbis1.xml", System.IO.SearchOption.AllDirectories);
                 * XmlHobbies.Load(liststring[0]);*/
                #endregion
                Vitl vitltemp = new Vitl(id, first_name, Last_name, Father_name, Mather_name, natiol_id, Gender, where_birth, data_barthday, Hanei_whare, Hanei_whare1, adderas, e_mail, Stutes_Jtma3, Phone_Ground, Phone_Mobile1, Phone_Mobile2, Facebook, Twiter, whatsApp, viper, study, yearstudy, Id_course, Id_course_Ware, data_regs, Image_id_nationl1, Image_id_nationl2, image, Image_font, bitd_id, Nkname, nameEnglish, Z1, z2, z3, XmlHobbies);

                Sqldatabasethrding.SqlSaveVitl(vitltemp.adder());
            }
        }
Esempio n. 4
0
        private void SaveMyVitlNew(int i)
        {
            int j = 0;

            int      id             = 0;
            string   first_name     = dataGridViewX1.Rows[i].Cells[listStringNkname1[j]].Value.ToString();
            string   Last_name      = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   Father_name    = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   Mather_name    = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            Int64    natiol_id      = ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            bool?    Gender         = ClassConvert.ConvBoolMelaFemalNUll(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string   where_birth    = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            DateTime data_barthday  = ClassConvert.ConvDateTime(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string   Hanei_whare    = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   Hanei_whare1   = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   adderas        = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   e_mail         = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            int      Stutes_Jtma3   = ClassConvert.ConvToStatesF(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int      Phone_Ground   = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int      Phone_Mobile1  = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int      Phone_Mobile2  = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string   Facebook       = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            int      whatsApp       = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int      viper          = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string   Twiter         = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string   study          = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            int      yearstudy      = ClassConvert.ConvToStady(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);;
            int      Id_course      = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string   Id_course_Ware = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            DateTime data_regs      = ClassConvert.ConvDateTime(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);

            System.Drawing.Image Image_id_nationl1 = null;
            System.Drawing.Image Image_id_nationl2 = null;
            System.Drawing.Image image             = null;
            System.Drawing.Image Image_font        = null;

            int    bitd_id     = ClassConvert.ConvintBoloed(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            string Nkname      = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            string nameEnglish = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString();
            int    Z1          = ClassConvert.ConvSizeToint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int    z2          = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);
            int    z3          = ClassConvert.ConvSizeToint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);

            System.Xml.XmlDataDocument XmlHobbies = null;



            Vitl vitl1 = new Vitl(id, first_name, Last_name, Father_name, Mather_name, natiol_id, Gender, where_birth, data_barthday, Hanei_whare, Hanei_whare1, adderas, e_mail, Stutes_Jtma3, Phone_Ground, Phone_Mobile1, Phone_Mobile2, Facebook, Twiter, whatsApp, viper, study, yearstudy, Id_course, Id_course_Ware, data_regs, Image_id_nationl1, Image_id_nationl2, image, Image_font, bitd_id, Nkname, nameEnglish, Z1, z2, z3, XmlHobbies);

            Sqldatabasethrding.SqlSaveAdderAndBack(vitl1);
        }
Esempio n. 5
0
        public static System.Xml.XmlDataDocument ConvXml(object oBject)
        {
            ///يستوجب تعديل من أجل وضع صورة إفتراضية
            ///
            System.Xml.XmlDataDocument XmlDataDocument1 = new System.Xml.XmlDataDocument();

            try
            {
                System.Xml.XmlDataDocument XmlDataDocument = (System.Xml.XmlDataDocument)oBject;
                return(XmlDataDocument);
            }
            catch (Exception e)
            {
                ErrorClass.ErrorClassConvert(e);
            }
            return(XmlDataDocument1);
        }
        public static System.IO.Stream UpdateProjectFile(string projectFileName, string fileListXMLFileName, string directoryList)
        {
            System.Xml.XmlDataDocument prjXML = new System.Xml.XmlDataDocument();
            System.Xml.XmlNodeList     nodes;
            System.IO.MemoryStream     stream = new System.IO.MemoryStream();
            string[] reloadDirs;
            System.Xml.XmlDocument listXML = new System.Xml.XmlDocument();
            System.Xml.XmlNode     nodeInclude;
            reloadDirs = SplitToArray(directoryList);
            listXML.Load(fileListXMLFileName);
            prjXML.Load(projectFileName);
            nodeInclude = prjXML.SelectSingleNode("//Files/Include");
            nodes       = prjXML.SelectNodes("//Files/Include/*");

            // Delete files in reload dirs
            foreach (System.Xml.XmlNode node in nodes)
            {
                foreach (string dirName in reloadDirs)
                {
                    if (Utility.Tools.GetAttributeOrEmpty(node, "RelPath").StartsWith(dirName))
                    {
                        nodeInclude.RemoveChild(node);
                    }
                }
            }

            // Add back the files in these directories recursively
            // TODO: Test the following change
            foreach (string dirName in reloadDirs)
            {
                nodes = listXML.SelectNodes("//FileList//Dir[starts-with(@Name,'" + dirName + "' )]/*");
                foreach (System.Xml.XmlNode node in nodes)
                {
                    if (!(Utility.Tools.GetAttributeOrEmpty(node, "Exclude") == "true"))
                    {
                        LoadVBFiles(node, nodeInclude, Utility.Tools.GetAttributeOrEmpty(node.ParentNode, "Name") + "\\");
                    }
                }
            }

            prjXML.Save(stream);
            return(stream);
        }
Esempio n. 7
0
        private void SetIdleTime()
        {
            _idleTime = DateTime.Now;
            string path = Application.StartupPath + @"\Idle.xml";

            System.Xml.XmlDataDocument xmldoc = new System.Xml.XmlDataDocument();
            System.Xml.XmlNodeList     xmlnode;
            int i = 0;

            FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);

            xmldoc.Load(fs);
            xmlnode = xmldoc.GetElementsByTagName("Root");
            if (xmldoc.ChildNodes.Count > 0)
            {
                string name = PLABS.Utils.CnvToStr(xmlnode[i].ChildNodes.Item(0).InnerText);
                int    h    = PLABS.Utils.CnvToInt(xmlnode[i].ChildNodes.Item(0).InnerText.Trim());
                int    m    = PLABS.Utils.CnvToInt(xmlnode[i].ChildNodes.Item(1).InnerText.Trim());
                int    s    = PLABS.Utils.CnvToInt(xmlnode[i].ChildNodes.Item(2).InnerText.Trim());
                t2 = new TimeSpan(h, m, s);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 添加栏目函数
        /// </summary>
        /// <param name="xmlpath">XML栏目文件</param>
        /// <param name="XmlData">为空 "" </param>
        /// <![CDATA[调用方法 XmlFileAllNodes(Server.MapPath("treeout.xml"), "")]]>
        /// <returns></returns>
        public string XmlFileAllNodes(string xmlpath, String XmlData)
        {
            System.Xml.XmlDataDocument MyXml = new System.Xml.XmlDataDocument();
            if (XmlData == "")
            {
                MyXml.Load(xmlpath);//得到XML数据
            }
            else
            {
                MyXml.LoadXml(XmlData);
            }

            for (int i = 0; i < MyXml.DocumentElement.ChildNodes.Count; i++)
            {
                try
                {                                         //得到树状结构
                    if (XmlFileAllNodesCloumnLvTemp == 0) //一级节点
                    {
                        System.Web.HttpContext.Current.Response.Write(TextData.EStr(XmlFileAllNodesCloumnLvTemp, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + XmlFileAllNodesColumnsIDTemp + MyXml.DocumentElement.ChildNodes[i].Attributes.GetNamedItem("Cont").Value + XmlFileAllNodesCloumnLvTemp + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<br/>");
                    }
                    else
                    {
                        System.Web.HttpContext.Current.Response.Write(TextData.EStr(XmlFileAllNodesCloumnLvTemp, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + XmlFileAllNodesColumnsIDTemp + MyXml.DocumentElement.ChildNodes[i].Attributes.GetNamedItem("Cont").Value + XmlFileAllNodesCloumnLvTemp + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<br/>");
                        //如果是子节点
                    }
                    XmlFileAllNodesColumnsIDTemp += 1;
                    XmlFileAllNodesCloumnLvTemp++;
                    XmlFileAllNodes(xmlpath, MyXml.DocumentElement.ChildNodes[i].OuterXml);//得到这个XML文件下的所有子节点
                    XmlFileAllNodesCloumnLvTemp--;
                }
                catch (System.Xml.XmlException)//这里如是最下层就不进行下一次的调用自己了
                {
                }
            }
            return("");
        }
Esempio n. 9
0
        private void getRSSfeed()
        {
            string url = "http://maps.yahoo.com/traffic.rss?csz=98052&mag=5&minsev=1";

            if (_userZipCodeString != "")
            {
                url = _userZipCodeString;
            }
            WebRequest  req = WebRequest.Create(url);
            WebResponse res = req.GetResponse();

            Stream rsstream = res.GetResponseStream();

            System.Xml.XmlDataDocument rssdoc = new System.Xml.XmlDataDocument();

            rssdoc.Load(rsstream);

            System.Xml.XmlNodeList rssitems = rssdoc.SelectNodes("rss/channel/item");
            string title       = "";
            string description = "";
            string link        = "";
            string category    = "";
            string severity    = "";

            for (int i = 0; i < rssitems.Count; i++)
            {
                System.Xml.XmlNode rssdetail;

                rssdetail = rssitems.Item(i).SelectSingleNode("title");
                if (rssdetail != null)
                {
                    title = rssdetail.InnerText;

                    rssdetail   = rssitems.Item(i).SelectSingleNode("description");
                    description = rssdetail.InnerText;

                    rssdetail = rssitems.Item(i).SelectSingleNode("link");


                    link = (rssdetail != null) ? rssdetail.InnerText : "";

                    rssdetail = rssitems.Item(i).SelectSingleNode("category");
                    category  = (rssdetail != null) ?rssdetail.InnerText:"";

                    rssdetail = rssitems.Item(i).SelectSingleNode("severity");
                    severity  = (rssdetail != null) ?rssdetail.InnerText:"";

                    PopulateList(title, description, link, category, severity);
                }
                else
                {
                    title = "";
                }
            }

            try
            {
                rssitems = rssdoc.SelectNodes("rss/channel");
                System.Xml.XmlNode rssdetail1;
                rssdetail1 = rssitems.Item(0).SelectSingleNode("title");
                title      = rssdetail1.InnerText;
                int    index = title.IndexOf("--");
                string str   = (index > -1)?(title.Substring(index + 3)):"Wrong Zip Code";
                Location.Content = str;
            }
            catch (Exception)
            {
            }
        }
Esempio n. 10
0
        private async System.Threading.Tasks.Task SaveNewOrUpdate()
        {
            try
            {
                if (idvite == 0)
                {
                    #region تسجيل متطوع جديد

                    #region المتغيرات للكلاس المعلومات الأساسية
                    int                        id                = 0;
                    string                     first_name        = this.first_name.Text;
                    string                     Last_name         = this.Last_name.Text;
                    string                     Father_name       = this.Father_name.Text;
                    string                     Mather_name       = this.Mather_name.Text;
                    Int64                      natiol_id         = ClassConvert.Convint64(this.natiol_id.Text);
                    bool                       Gender            = ClassConvert.ConvBool(this.Gender.SelectedIndex);
                    string                     where_birth       = this.where_birth.Text;
                    DateTime                   data_barthday     = ClassConvert.ConvDateTime(this.data_barthday.Value);
                    string                     Hanei_whare       = this.Hanei_whare.Text;
                    string                     Hanei_whare1      = this.Hanei_whare1.Text;
                    string                     adderas           = this.adderas.Text;
                    string                     e_mail            = this.e_mail.Text;
                    int                        Stutes_Jtma3      = this.Stutes_Jtma3.SelectedIndex;
                    int                        Phone_Ground      = ClassConvert.Convint(this.Phone_Ground.Text);
                    int                        Phone_Mobile1     = ClassConvert.Convint(this.Phone_Mobile1.Text);
                    int                        Phone_Mobile2     = ClassConvert.Convint(this.Phone_Mobile2.Text);
                    string                     Facebook          = this.Facebook.Text;
                    int                        whatsApp          = ClassConvert.Convint(this.whatsApp.Text);
                    int                        viper             = ClassConvert.Convint(this.viper.Text);
                    string                     Twiter            = (this.Twiter.Text);
                    string                     study             = this.study.Text;
                    int                        yearstudy         = this.yearstudy.SelectedIndex;
                    int                        Id_course         = ClassConvert.Convint(this.Id_course.Text);
                    string                     Id_course_Ware    = this.Id_course_Ware.Text;
                    DateTime                   data_regs         = ClassConvert.ConvDateTime(this.data_regs.Value);
                    System.Drawing.Image       Image_id_nationl1 = ClassConvert.ConvImage(this.Image_id_nationl1.Image);
                    System.Drawing.Image       Image_id_nationl2 = ClassConvert.ConvImage(this.Image_id_nationl2.Image);
                    System.Drawing.Image       image             = ClassConvert.ConvImage(this.image.Image);
                    System.Drawing.Image       Image_font        = ClassConvert.ConvImage(this.Image_font.Image);
                    int                        bitd_id           = this.bitd_id.SelectedIndex;
                    string                     Nkname            = this.Nkname.Text;
                    string                     nameEnglish       = this.nameEnglish.Text;
                    int                        Z1                = this.Z1.SelectedIndex;
                    int                        z2                = ClassConvert.Convint(this.z2.Text);
                    int                        z3                = this.z3.SelectedIndex;
                    System.Xml.XmlDataDocument XmlHobbies        = null;



                    vitl1 = new Vitl(id, first_name, Last_name, Father_name, Mather_name, natiol_id, Gender, where_birth, data_barthday, Hanei_whare, Hanei_whare1, adderas, e_mail, Stutes_Jtma3, Phone_Ground, Phone_Mobile1, Phone_Mobile2, Facebook, Twiter, whatsApp, viper, study, yearstudy, Id_course, Id_course_Ware, data_regs, Image_id_nationl1, Image_id_nationl2, image, Image_font, bitd_id, Nkname, nameEnglish, Z1, z2, z3, XmlHobbies);

                    Sqldatabasethrding.SqlSaveAdderAndBack(vitl1);


                    idvite = vitl1.id;//تاكد من عمل الصحيح للبرنامج

                    #endregion

                    #region إضافة وتعديل الفرق
                    EditTame.CountOfNew = 0;
                    foreach (Team IdInfoAdder in TeamList)
                    {
                        IdInfoAdder.EdidInfoId(idvite);
                    }
                    await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(TeamList), IntAdderTeam, IntEditTeam, IntDeletTeam);

                    #endregion

                    #region إضافة وتعديل الدورات
                    CoresEditAdder.CountOfNew = 0;
                    foreach (Couress IdInfoAdder in CouressList)
                    {
                        IdInfoAdder.EdidInfoId(idvite);
                    }
                    await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(CouressList), IntAdderCoress, IntEditCoress, IntDeletCoress);

                    #endregion

                    #endregion
                }
                else
                {
                    #region تعديلات العلومات العامة

                    #region المتغيرات

                    string                     first_name        = this.first_name.Text;
                    string                     Last_name         = this.Last_name.Text;
                    string                     Father_name       = this.Father_name.Text;
                    string                     Mather_name       = this.Mather_name.Text;
                    Int64                      natiol_id         = ClassConvert.Convint64(this.natiol_id.Text);
                    bool                       Gender            = ClassConvert.ConvBool(this.Gender.SelectedIndex);
                    string                     where_birth       = this.where_birth.Text;
                    DateTime                   data_barthday     = ClassConvert.ConvDateTime(this.data_barthday.Value);
                    string                     Hanei_whare       = this.Hanei_whare.Text;
                    string                     Hanei_whare1      = this.Hanei_whare1.Text;
                    string                     adderas           = this.adderas.Text;
                    string                     e_mail            = this.e_mail.Text;
                    int                        Stutes_Jtma3      = this.Stutes_Jtma3.SelectedIndex;
                    int                        Phone_Ground      = ClassConvert.Convint(this.Phone_Ground.Text);
                    int                        Phone_Mobile1     = ClassConvert.Convint(this.Phone_Mobile1.Text);
                    int                        Phone_Mobile2     = ClassConvert.Convint(this.Phone_Mobile2.Text);
                    string                     Facebook          = this.Facebook.Text;
                    int                        whatsApp          = ClassConvert.Convint(this.whatsApp.Text);
                    int                        viper             = ClassConvert.Convint(this.viper.Text);
                    string                     Twiter            = (this.Twiter.Text);
                    string                     study             = this.study.Text;
                    int                        yearstudy         = this.yearstudy.SelectedIndex;
                    int                        Id_course         = ClassConvert.Convint(this.Id_course.Text);
                    string                     Id_course_Ware    = this.Id_course_Ware.Text;
                    DateTime                   data_regs         = ClassConvert.ConvDateTime(this.data_regs.Value);
                    System.Drawing.Image       Image_id_nationl1 = ClassConvert.ConvImage(this.Image_id_nationl1.Image);
                    System.Drawing.Image       Image_id_nationl2 = ClassConvert.ConvImage(this.Image_id_nationl2.Image);
                    System.Drawing.Image       image             = ClassConvert.ConvImage(this.image.Image);
                    System.Drawing.Image       Image_font        = ClassConvert.ConvImage(this.Image_font.Image);
                    int                        bitd_id           = this.bitd_id.SelectedIndex;
                    string                     Nkname            = this.Nkname.Text;
                    string                     nameEnglish       = this.nameEnglish.Text;
                    int                        Z1         = this.Z1.SelectedIndex;
                    int                        z2         = ClassConvert.Convint(this.z2.Text);
                    int                        z3         = this.z3.SelectedIndex;
                    System.Xml.XmlDataDocument XmlHobbies = null;

                    #endregion

                    vitl1.UpdateOUtid(first_name, Last_name, Father_name, Mather_name, natiol_id, Gender, where_birth, data_barthday, Hanei_whare, Hanei_whare1, adderas, e_mail, Stutes_Jtma3, Phone_Ground, Phone_Mobile1, Phone_Mobile2, Facebook, Twiter, whatsApp, viper, study, yearstudy, Id_course, Id_course_Ware, data_regs, Image_id_nationl1, Image_id_nationl2, image, Image_font, bitd_id, Nkname, nameEnglish, Z1, z2, z3, XmlHobbies);

                    await Sqldatabasethrding.SqlupdataVitl(vitl1.updata());

                    #endregion


                    #region إضافة وتعديل الفرق
                    await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(TeamList), IntAdderTeam, IntEditTeam, IntDeletTeam);

                    #endregion


                    #region إضافة وتعديل الدورات
                    await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(CouressList), IntAdderCoress, IntEditCoress, IntDeletCoress);

                    #endregion


                    #region إضافة وتعديل وحذف الأستلامات
                    await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(WereDeliveryList), IntAdderWere, IntEditWere, IntDeletWere);

                    #endregion
                }

                /////Loed Team Grid
                EditTame.CountOfNew = 0;
                TeamList            = await Team.GetByIdVil(idvite);

                ClassDataGridViewDo.DataGridEnterGridToWorkTeam(dataGridViewX1, TeamList);
                ////Loed Coures Grid
                CoresEditAdder.CountOfNew = 0;
                CouressList = Couress.GetByIdVil(idvite);
                ClassDataGridViewDo.DataGridEnterGridToWorkCorser(dataGridViewX2, CouressList);
                #region التقيم


                ValuationList = Valuation.GetByIdVil(idvite);
                ClassDataGridViewDo.DataGridEnterGridToWorkValuation(dataGridViewX4, ValuationList);

                #endregion



                MegBox.Show("تم التعديل", this);
            }
            catch (Exception xv)
            { MessageBox.Show(xv.ToString()); }
        }
        public void ConfigShouldBeTheSameWithOrWithoutPreProcessor()
        {
            const string projectName1 = "SpaceCheck";
            const string projectName2 = "SpaceCheckPreProcessor";
            const string projectName3 = "SpaceCheckPreProcessorNewLines";


            string IntegrationFolder = System.IO.Path.Combine("scenarioTests", projectName1);
            string CCNetConfigFile = System.IO.Path.Combine("IntegrationScenarios", "SpacesInBuildArgsOfTask.xml");

            string Project1StateFile = new System.IO.FileInfo(projectName1 + ".state").FullName;
            string Project2StateFile = new System.IO.FileInfo(projectName2 + ".state").FullName;
            string Project3StateFile = new System.IO.FileInfo(projectName3 + ".state").FullName;


            Log("Clear existing state file, to simulate first run : " + Project1StateFile);
            System.IO.File.Delete(Project1StateFile);

            Log("Clear existing state file, to simulate first run : " + Project2StateFile);
            System.IO.File.Delete(Project2StateFile);


            Log("Clear integration folder to simulate first run");
            if (System.IO.Directory.Exists(IntegrationFolder)) System.IO.Directory.Delete(IntegrationFolder, true);


            CCNet.Remote.Messages.ProjectRequest pr1 = new CCNet.Remote.Messages.ProjectRequest(null, projectName1);
            CCNet.Remote.Messages.ProjectRequest pr2 = new CCNet.Remote.Messages.ProjectRequest(null, projectName2);
            CCNet.Remote.Messages.ProjectRequest pr3 = new CCNet.Remote.Messages.ProjectRequest(null, projectName3);


            CCNet.Remote.Messages.DataResponse dr1;
            CCNet.Remote.Messages.DataResponse dr2;
            CCNet.Remote.Messages.DataResponse dr3;


            Log("Making CruiseServerFactory");
            CCNet.Core.CruiseServerFactory csf = new CCNet.Core.CruiseServerFactory();
            Log("Making cruiseServer with config from :" + CCNetConfigFile);
            using (var cruiseServer = csf.Create(true, CCNetConfigFile))
            {
                Log("Starting cruiseServer");
                try
                {
                    cruiseServer.Start();

                }
                catch (Exception e)
                {
                    Log(e.ToString());
                }

                dr1 = cruiseServer.GetProject(pr1);
                dr2 = cruiseServer.GetProject(pr2);
                dr3 = cruiseServer.GetProject(pr3);

                Log("Stopping cruiseServer");
                cruiseServer.Stop();

                System.Threading.Thread.Sleep(250); // give time to stop the build
            }

            var pr1config = dr1.Data;
            var pr2config = dr2.Data.Replace("<name>SpaceCheckPreProcessor</name>", "<name>SpaceCheck</name>"); // give project the same name
            var pr3config = dr3.Data.Replace("<name>SpaceCheckPreProcessorNewLines</name>", "<name>SpaceCheck</name>"); // give project the same name;

            // load back as xml to we can use a standard way to reformat it a known way back to string
            // makes it easier to compare
            var xd1 = new System.Xml.XmlDataDocument();
            xd1.LoadXml(pr1config);
            xd1.PreserveWhitespace = false;
            var r1 = xd1.InnerText;

            var xd2 = new System.Xml.XmlDataDocument();
            xd2.LoadXml(pr2config);
            xd2.PreserveWhitespace = false;
            var r2 = xd2.InnerText;


            var xd3 = new System.Xml.XmlDataDocument();
            xd3.LoadXml(pr3config);
            xd3.PreserveWhitespace = false;
            var r3 = xd3.InnerText;


            Assert.AreEqual(xd1, xd2);
            Assert.AreEqual(xd1, xd3); 



        }
        public void ConfigShouldBeTheSameWithOrWithoutPreProcessor()
        {
            const string projectName1 = "SpaceCheck";
            const string projectName2 = "SpaceCheckPreProcessor";
            const string projectName3 = "SpaceCheckPreProcessorNewLines";


            string IntegrationFolder = System.IO.Path.Combine("scenarioTests", projectName1);
            string CCNetConfigFile   = System.IO.Path.Combine("IntegrationScenarios", "SpacesInBuildArgsOfTask.xml");

            string Project1StateFile = new System.IO.FileInfo(projectName1 + ".state").FullName;
            string Project2StateFile = new System.IO.FileInfo(projectName2 + ".state").FullName;
            string Project3StateFile = new System.IO.FileInfo(projectName3 + ".state").FullName;


            Log("Clear existing state file, to simulate first run : " + Project1StateFile);
            System.IO.File.Delete(Project1StateFile);

            Log("Clear existing state file, to simulate first run : " + Project2StateFile);
            System.IO.File.Delete(Project2StateFile);


            Log("Clear integration folder to simulate first run");
            if (System.IO.Directory.Exists(IntegrationFolder))
            {
                System.IO.Directory.Delete(IntegrationFolder, true);
            }


            CCNet.Remote.Messages.ProjectRequest pr1 = new CCNet.Remote.Messages.ProjectRequest(null, projectName1);
            CCNet.Remote.Messages.ProjectRequest pr2 = new CCNet.Remote.Messages.ProjectRequest(null, projectName2);
            CCNet.Remote.Messages.ProjectRequest pr3 = new CCNet.Remote.Messages.ProjectRequest(null, projectName3);


            CCNet.Remote.Messages.DataResponse dr1;
            CCNet.Remote.Messages.DataResponse dr2;
            CCNet.Remote.Messages.DataResponse dr3;


            Log("Making CruiseServerFactory");
            CCNet.Core.CruiseServerFactory csf = new CCNet.Core.CruiseServerFactory();
            Log("Making cruiseServer with config from :" + CCNetConfigFile);
            using (var cruiseServer = csf.Create(true, CCNetConfigFile))
            {
                Log("Starting cruiseServer");
                try
                {
                    cruiseServer.Start();
                }
                catch (Exception e)
                {
                    Log(e.ToString());
                }

                dr1 = cruiseServer.GetProject(pr1);
                dr2 = cruiseServer.GetProject(pr2);
                dr3 = cruiseServer.GetProject(pr3);

                Log("Stopping cruiseServer");
                cruiseServer.Stop();

                System.Threading.Thread.Sleep(250); // give time to stop the build
            }

            var pr1config = dr1.Data;
            var pr2config = dr2.Data.Replace("<name>SpaceCheckPreProcessor</name>", "<name>SpaceCheck</name>");         // give project the same name
            var pr3config = dr3.Data.Replace("<name>SpaceCheckPreProcessorNewLines</name>", "<name>SpaceCheck</name>"); // give project the same name;

            // load back as xml to we can use a standard way to reformat it a known way back to string
            // makes it easier to compare
            var xd1 = new System.Xml.XmlDataDocument();

            xd1.LoadXml(pr1config);
            xd1.PreserveWhitespace = false;
            var r1 = xd1.InnerText;

            var xd2 = new System.Xml.XmlDataDocument();

            xd2.LoadXml(pr2config);
            xd2.PreserveWhitespace = false;
            var r2 = xd2.InnerText;


            var xd3 = new System.Xml.XmlDataDocument();

            xd3.LoadXml(pr3config);
            xd3.PreserveWhitespace = false;
            var r3 = xd3.InnerText;


            Assert.AreEqual(xd1, xd2);
            Assert.AreEqual(xd1, xd3);
        }
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg  = e.CommandArgument.ToString();
            var tabId = TabId;
            var param = new string[4];

            if (_uid != "")
            {
                param[0] = "uid=" + _uid;
            }
            var navigationData = new NavigationData(PortalId, "AdminOrders");
            var cmd            = e.CommandName.ToLower();
            var resxpath       = StoreSettings.NBrightBuyPath() + "/App_LocalResources/Notification.ascx.resx";
            var emailoption    = "";

            switch (cmd)
            {
            case "entrydetail":
                param[0] = "eid=" + cArg;
                if (_page != "")
                {
                    param[1] = "page=" + _page;
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "movetoorder":
                param[0] = "";
                if (Utils.IsNumeric(cArg))
                {
                    var obj = ModCtrl.Get(Convert.ToInt32(cArg));
                    obj.TypeCode = "ORDER";
                    ModCtrl.Update(obj);
                    var ordData = new OrderData(obj.ItemID);
                    ordData.OrderStatus = "010";
                    ordData.CreatedDate = DateTime.Now.ToString("O");
                    ordData.OrderNumber = obj.ItemID.ToString();
                    ordData.AddAuditMessage(DnnUtils.GetLocalizedString("movetoordermsg.Text", "/DesktopModules/NBright/NBrightBuyCartReview/Themes/config/resx", Utils.GetCurrentCulture()), "msg", UserInfo.Username, "False");
                    ordData.Save();
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "return":
                param[0] = "";
                if (_page != "")
                {
                    param[1] = "page=" + _page;
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "search":
                var strXml = GenXmlFunctions.GetGenXml(rpSearch, "", "");
                navigationData.Build(strXml, _templSearch);
                navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpSearch);
                navigationData.XmlData = GenXmlFunctions.GetGenXml(rpSearch);
                navigationData.Save();
                if (StoreSettings.Current.DebugModeFileOut)
                {
                    strXml = "<root><sql><![CDATA[" + navigationData.Criteria + "]]></sql>" + strXml + "</root>";
                    var xmlDoc = new System.Xml.XmlDataDocument();
                    xmlDoc.LoadXml(strXml);
                    xmlDoc.Save(PortalSettings.HomeDirectoryMapPath + "debug_search.xml");
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "resetsearch":
                // clear cookie info
                navigationData.Delete();
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "orderby":
                navigationData.OrderBy = GenXmlFunctions.GetSqlOrderBy(rpData);
                navigationData.Save();
                break;

            case "viewclient":
                param[1] = "ctrl=clients";
                if (Utils.IsNumeric(cArg))
                {
                    var cartData = new CartData(Convert.ToInt32(cArg));
                    param[0] = "uid=" + cartData.UserId.ToString("");
                }
                Response.Redirect(Globals.NavigateURL(TabId, "", param), true);
                break;

            case "delete":
                if (Utils.IsNumeric(cArg))
                {
                    ModCtrl.Delete(Convert.ToInt32(cArg));
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;
            }
        }
Esempio n. 14
0
        private void getRSSfeed()
        {
            string url = "http://maps.yahoo.com/traffic.rss?csz=98052&mag=5&minsev=1";
            if (_userZipCodeString != "")
            {
                url = _userZipCodeString;
            }
            WebRequest req = WebRequest.Create(url);
            WebResponse res = req.GetResponse();

            Stream rsstream = res.GetResponseStream();
            System.Xml.XmlDataDocument rssdoc = new System.Xml.XmlDataDocument();

            rssdoc.Load(rsstream);

            System.Xml.XmlNodeList rssitems = rssdoc.SelectNodes("rss/channel/item");
            string title = "";
            string description = "";
            string link = "";
            string category = "";
            string severity = "";

            for (int i = 0; i < rssitems.Count; i++)
            {
                System.Xml.XmlNode rssdetail;

                rssdetail = rssitems.Item(i).SelectSingleNode("title");
                if (rssdetail != null)
                {
                    title = rssdetail.InnerText;

                    rssdetail = rssitems.Item(i).SelectSingleNode("description");
                    description = rssdetail.InnerText;

                    rssdetail = rssitems.Item(i).SelectSingleNode("link");

                    link = (rssdetail != null) ? rssdetail.InnerText : "";

                    rssdetail = rssitems.Item(i).SelectSingleNode("category");
                    category = (rssdetail != null) ?rssdetail.InnerText:"";

                    rssdetail = rssitems.Item(i).SelectSingleNode("severity");
                    severity = (rssdetail != null) ?rssdetail.InnerText:"";

                    PopulateList(title, description, link, category, severity);
                }
                else
                {
                    title = "";
                }
            }

            try
            {
                rssitems = rssdoc.SelectNodes("rss/channel");
                System.Xml.XmlNode rssdetail1;
                rssdetail1 = rssitems.Item(0).SelectSingleNode("title");
                title = rssdetail1.InnerText;
                int index = title.IndexOf("--");
                string str = (index > -1)?(title.Substring(index +3)):"Wrong Zip Code";
                Location.Content = str;
            }
            catch (Exception)
            {
            }
        }