private void BindDataSource()
        {
            string    sPath = FileManage.getApplicatonPath() + "cropcode.xml";
            DataTable dt    = XmlManage.getCropCodeFromXml(sPath);

            gridControl1.DataSource = dt;
        }
Beispiel #2
0
 protected void BtnFinal_Click(object sender, EventArgs e)
 {
     try
     {
         try
         {
             new XmlDocument().LoadXml(this.TxtTemplate.Text);
         }
         catch (XmlException)
         {
             ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, base.GetType(), "click", "alert('标签模板中存在错误,请检查后再保存!')", true);
             return;
         }
         if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelTemplate", this.TxtTemplate.Text))
         {
             File.Copy(this.xmlfilepath, HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.m_LabelName + ".config", true);
             BasePage.ResponseRedirect("LabelManage.aspx");
         }
         else
         {
             AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
         }
     }
     catch (IOException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
     catch (UnauthorizedAccessException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
 }
Beispiel #3
0
        public static bool Delete(string fieldName, int modelId)
        {
            fieldName = fieldName.ToLower();
            FieldInfo fieldInfoByFieldName = GetFieldInfoByFieldName(modelId, fieldName);

            if (fieldInfoByFieldName != null)
            {
                if (fieldInfoByFieldName.FieldLevel == 0)
                {
                    return(false);
                }
                if (((fieldInfoByFieldName.FieldType == FieldType.FileType) && !DataConverter.CBoolean(fieldInfoByFieldName.Settings[3])) && !string.IsNullOrEmpty(fieldInfoByFieldName.Settings[4]))
                {
                    Delete(fieldInfoByFieldName.Settings[4], modelId);
                }
            }
            ModelInfo modelInfoById = ModelManager.GetModelInfoById(modelId);
            XmlManage manage        = XmlManage.Instance(modelInfoById.Field, XmlType.Content);
            string    nodeName      = "/ArrayOfFieldInfo/FieldInfo[@Id=\"" + fieldName + "\"]";

            manage.Remove(nodeName);
            if (!UpdateField(modelId, manage.Xml))
            {
                return(false);
            }
            return(((fieldInfoByFieldName != null) && (fieldInfoByFieldName.FieldType == FieldType.Property)) || ModelManager.DeleteTableField(fieldName, modelInfoById.TableName));
        }
Beispiel #4
0
        public static bool Delete(int surveyId, int questionId)
        {
            SurveyFieldInfo fieldInfoById = new SurveyFieldInfo();

            fieldInfoById = GetFieldInfoById(surveyId, questionId);
            XmlManage manage = XmlManage.Instance(GetXmlFieldBySurveyId(surveyId), XmlType.Content);

            manage.Remove(GetNodePath(questionId));
            bool flag = dal.Delete(surveyId, manage.Xml);

            if (flag)
            {
                SurveyVote.Delete(surveyId, questionId);
                DeleteColumn(questionId, surveyId);
                if ((fieldInfoById.QuestionType != 2) && (fieldInfoById.QuestionType != 3))
                {
                    return(flag);
                }
                if (fieldInfoById.InputType != 0)
                {
                    DeleteInputColumn(questionId, surveyId);
                }
            }
            return(flag);
        }
Beispiel #5
0
        public static bool BatchDelete(int surveyId, string questionIds)
        {
            bool flag = false;

            if (!string.IsNullOrEmpty(questionIds))
            {
                XmlManage manage   = XmlManage.Instance(GetXmlFieldBySurveyId(surveyId), XmlType.Content);
                string[]  strArray = questionIds.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    SurveyFieldInfo fieldInfoById = new SurveyFieldInfo();
                    fieldInfoById = GetFieldInfoById(surveyId, DataConverter.CLng(strArray[i]));
                    manage.Remove(GetNodePath(DataConverter.CLng(strArray[i])));
                    DeleteColumn(DataConverter.CLng(strArray[i]), surveyId);
                    if (((fieldInfoById.QuestionType == 2) || (fieldInfoById.QuestionType == 3)) && (fieldInfoById.InputType != 0))
                    {
                        DeleteInputColumn(DataConverter.CLng(strArray[i]), surveyId);
                    }
                }
                flag = dal.Update(surveyId, manage.Xml);
                if (flag)
                {
                    SurveyVote.Delete(surveyId, questionIds);
                }
            }
            return(flag);
        }
 protected void BtnShowTemplate_Click(object sender, EventArgs e)
 {
     if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelTemplate", this.TxtTemplate.Text))
     {
         File.Copy(this.xmlfilepath, HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.labelname + ".config", true);
     }
     SiteCache.Remove("pe_labdefing_" + this.labelname);
     if (!string.IsNullOrEmpty(this.TxtTemplateTest.Text))
     {
         TemplateInfo        templateInfo = new TemplateInfo();
         NameValueCollection values       = new NameValueCollection();
         values.Add("id", "1");
         templateInfo.QueryList       = values;
         templateInfo.TemplateContent = this.TxtTemplateTest.Text;
         templateInfo.CurrentPage     = 1;
         templateInfo.RootPath        = HttpContext.Current.Request.PhysicalApplicationPath;
         templateInfo.PageName        = string.Empty;
         templateInfo      = TemplateTransform.GetHtml(templateInfo);
         this.LabShow.Text = templateInfo.TemplateContent;
     }
     else
     {
         this.LabShow.Text = "请输入测试标签";
     }
 }
Beispiel #7
0
 protected void BtnShowTemplate_Click(object sender, EventArgs e)
 {
     if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelTemplate", this.TxtTemplate.Text))
     {
         File.Copy(this.xmlfilepath, HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.m_LabelName + ".config", true);
     }
     SiteCache.Remove("pe_labdefing_" + this.m_LabelName);
     if (!string.IsNullOrEmpty(this.TxtTemplateTest.Text))
     {
         TemplateInfo        templateInfo = new TemplateInfo();
         NameValueCollection values       = new NameValueCollection();
         values.Add("id", "1");
         templateInfo.QueryList       = values;
         templateInfo.TemplateContent = this.TxtTemplateTest.Text;
         templateInfo.CurrentPage     = DataConverter.CLng(this.TxtTempPage.Text);
         templateInfo.RootPath        = HttpContext.Current.Request.PhysicalApplicationPath;
         templateInfo.PageName        = this.TxtTempPageName.Text;
         templateInfo      = TemplateTransform.GetHtml(templateInfo);
         this.LabShow.Text = templateInfo.TemplateContent;
         if (templateInfo.TotalPub > 0)
         {
             this.LabShow.Text = this.LabShow.Text + "<br/>本页取得的总数据输出量为:" + templateInfo.TotalPub.ToString();
         }
         if (templateInfo.PageNum > 0)
         {
             this.LabShow.Text = this.LabShow.Text + "<br/>本页分页数为:" + templateInfo.PageNum.ToString();
         }
     }
 }
Beispiel #8
0
        public static bool TestOutSideDatabase(string dbtype, string dbconn)
        {
            if (!string.IsNullOrEmpty(dbconn))
            {
                switch (dbtype)
                {
                case "sql_outquery":
                    return(dal.TestOutSql(dbconn));

                case "sql_outstoredquery":
                    return(dal.TestOutSql(dbconn));

                case "ole_read":
                    return(dal.TestOle(dbconn));

                case "xml_read":
                    return(XmlManage.CheckXmlDataSource(dbconn));

                case "odbc_read":
                    return(dal.TestOdbc(dbconn));

                case "orc_read":
                    return(dal.TestOracle(dbconn));
                }
            }
            return(false);
        }
Beispiel #9
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     this.labelname = BasePage.RequestString("name");
     if (!string.IsNullOrEmpty(this.labelname))
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.labelname + ".config";
         this.Dbtype      = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");
         string      presstr  = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataSource");
         string      str3     = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelSqlString");
         string      istr     = string.Empty;
         XmlDocument document = new XmlDocument();
         document.Load(this.xmlfilepath);
         XmlNodeList attriblist = document.SelectNodes("root/attributes");
         presstr = this.ParaProc(attriblist, presstr);
         str3    = this.ParaProc(attriblist, str3).Replace("@pagesize", "10").Replace("@startrow", "0");
         if ((string.Compare(this.Dbtype, "xml_read", StringComparison.OrdinalIgnoreCase) != 0) && string.IsNullOrEmpty(str3))
         {
             base.Response.Write("查询语句为空!");
         }
         else
         {
             istr = LabelManage.GetDBQuery(this.Dbtype, presstr, str3, attriblist);
             this.XmlProc(this.Dbtype, presstr, istr);
         }
     }
     else
     {
         base.Response.Write("标签名称为空!");
     }
 }
Beispiel #10
0
        protected void BtnStopCreate_Click(object sender, EventArgs e)
        {
            string nodeValue = XmlManage.Instance("Config/CreateCollectionWork.config", XmlType.File).GetNodeValue("CollectionWork/WorkId");

            if (base.Application[nodeValue] != null)
            {
                CollectionProgress progress = base.Application[nodeValue] as CollectionProgress;
                progress.CreateThread.Abort();
                base.Application.Remove(nodeValue);
                if (DataConverter.CBoolean(this.HdnIsCreateHtml.Value))
                {
                    string nodeIds = "";
                    string str3    = BasePage.RequestString("ItemIds");
                    if (!string.IsNullOrEmpty(str3))
                    {
                        if (str3.Contains(","))
                        {
                            foreach (string str4 in str3.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                            {
                                nodeIds = GetNodeIs(nodeIds, str4);
                            }
                        }
                        else
                        {
                            nodeIds = GetNodeIs(nodeIds, str3);
                        }
                    }
                    HtmlContent content = new HtmlContent();
                    content.CreateMethod = CreateContentType.CreateByNotCreate;
                    content.NodeIdArray  = nodeIds;
                    content.CommonCreateHtml();
                }
            }
        }
        /// <summary>
        /// 分页标签解析
        /// </summary>
        /// <param name="templateInfo"></param>
        private void FiltPage(TemplateInfo templateInfo)
        {
            XmlDocument document = new XmlDocument();
            string      pattern  = @"{PE\.Page([\s\S](?!{PE))*?\/}";

            foreach (Match match in Regex.Matches(templateInfo.TemplateContent, pattern, RegexOptions.IgnoreCase))
            {
                try
                {
                    document.LoadXml(FormatLabel(match.Value));
                }
                catch (XmlException exception)
                {
                    templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match.ToString(), "[err:分页标签" + match.Value.Replace("{", string.Empty).Replace("/}", string.Empty) + "错,原因:" + exception.Message + "]");
                    continue;
                }
                XmlElement firstChild = (XmlElement)document.FirstChild;
                foreach (PageInfo info in this.tempLabelPageList)
                {
                    string str2;
                    if (string.Compare(info.SpanName, XmlManage.GetAttributesValue(firstChild, "datasource"), StringComparison.OrdinalIgnoreCase) != 0)
                    {
                        continue;
                    }
                    if (templateInfo.PageType == 1)
                    {
                        str2 = LabelTransform.GetListPage(XmlManage.GetAttributesValue(firstChild, "id"), info, XmlManage.GetAttributesValue(firstChild, "unitname"));
                    }
                    else
                    {
                        str2 = LabelTransform.GetPage(XmlManage.GetAttributesValue(firstChild, "id"), info, XmlManage.GetAttributesValue(firstChild, "unitname"));
                    }
                    string attributesValue = XmlManage.GetAttributesValue(firstChild, "span");
                    string str4            = XmlManage.GetAttributesValue(firstChild, "class");
                    if (string.IsNullOrEmpty(attributesValue))
                    {
                        attributesValue = "span";
                    }
                    if (string.IsNullOrEmpty(str4))
                    {
                        str4 = "pagecss";
                    }
                    string str5 = "<" + attributesValue + " id=\"pe100_page_" + info.SpanName + "\"";
                    if (!string.IsNullOrEmpty(str4))
                    {
                        str5 = str5 + " class=\"" + str4 + "\"";
                    }
                    str5 = str5 + ">";
                    str2 = str5 + str2 + "</" + attributesValue + ">";
                    templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match.Value, str2);
                    if ((info.PageNum > 0) && info.IsMainPage)
                    {
                        templateInfo.PageNum  = info.PageNum;
                        templateInfo.TotalPub = info.TotalPub;
                    }
                }
                templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match.Value, string.Empty);
            }
        }
        /// <summary>
        /// 内容分页标签解析
        /// </summary>
        /// <param name="templateInfo"></param>
        private void FiltPageContent(TemplateInfo templateInfo)
        {
            string pattern = @"{PE\.ContentPage(.*)}(([\s\S](?!{PE\.ContentPage))*?){\/PE.ContentPage}";

            foreach (Match match in Regex.Matches(templateInfo.TemplateContent, pattern, RegexOptions.IgnoreCase))
            {
                XmlElement  firstChild;
                XmlDocument document = new XmlDocument();
                try
                {
                    document.LoadXml("<root " + match.Groups[1].Value + " />");
                    firstChild = (XmlElement)document.FirstChild;
                }
                catch (XmlException exception)
                {
                    templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match.ToString(), "[err:内容分页标签参数" + match.Groups[1].Value + "错,原因:" + exception.Message + "]");
                    continue;
                }
                string attributesValue = XmlManage.GetAttributesValue(firstChild, "id");
                bool   flag            = DataConverter.CBoolean(XmlManage.GetAttributesValue(firstChild, "urlpage"));
                if (!string.IsNullOrEmpty(attributesValue))
                {
                    attributesValue = attributesValue.ToLower().Trim();
                    ContentPageInfo contentPageInfo = new ContentPageInfo();
                    contentPageInfo.Parameter = "<root " + match.Groups[1].Value + " />";
                    contentPageInfo.Content   = match.Groups[2].Value;
                    contentPageInfo.PageName  = templateInfo.PageName;
                    if (flag)
                    {
                        contentPageInfo.CurrentPage = templateInfo.CurrentPage;
                    }
                    else
                    {
                        contentPageInfo.CurrentPage = 1;
                    }
                    contentPageInfo.IsDynamicPage = templateInfo.IsDynamicPage;
                    LabelTransform.TransContentPageLabel(contentPageInfo);
                    templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match.Value, contentPageInfo.Content);
                    PageInfo item = new PageInfo();
                    item.PageName      = templateInfo.PageName;
                    item.SpanName      = attributesValue;
                    item.IsDynamicPage = templateInfo.IsDynamicPage;
                    item.CurrentPage   = contentPageInfo.CurrentPage;
                    if (flag)
                    {
                        item.IsMainPage = true;
                    }
                    item.PageNum  = contentPageInfo.PageNum;
                    item.TotalPub = contentPageInfo.Content.Length;
                    string str3 = @"\[PageSet\]([\s\S]*?)\[\/PageSet\]";
                    foreach (Match match2 in Regex.Matches(match.Groups[2].Value, str3, RegexOptions.IgnoreCase))
                    {
                        item.PageOtherSet            = match2.ToString().Replace("&lt;", "<").Replace("&gt;", ">").Replace("&apos;", "'").Replace("&quot;", "\"");
                        templateInfo.TemplateContent = templateInfo.TemplateContent.Replace(match2.Value, string.Empty);
                    }
                    this.tempLabelPageList.Add(item);
                }
            }
        }
Beispiel #13
0
        public static bool SetOrderId(string fieldName, int modelId, int orderId)
        {
            XmlManage manage   = XmlManage.Instance(GetXmlFieldList(modelId), XmlType.Content);
            string    nodeName = "/ArrayOfFieldInfo/FieldInfo[@Id=\"" + fieldName.ToLower() + "\"]";

            manage.SetAttributesValue(nodeName, "OrderId", orderId.ToString());
            return(UpdateField(modelId, manage.Xml));
        }
Beispiel #14
0
        /// <summary>
        /// 输出类型数据绑定,从XML文件中获取
        /// </summary>
        public void ComBoxDataBind()
        {
            string sPath = FileManage.getApplicatonPath();

            //string sPath = Application.StartupPath;
            sPath = sPath + "ImageFormatType.xml";
            List <string> list = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "OutPutType", "Name");

            this.cbx_FormatType.DataSource = list;
        }
Beispiel #15
0
        public static bool SetOrderId(IList <FieldInfo> fieldInfoList, int modelId)
        {
            XmlManage manage = XmlManage.Instance(GetXmlFieldList(modelId), XmlType.Content);

            foreach (FieldInfo info in fieldInfoList)
            {
                string nodeName = "/ArrayOfFieldInfo/FieldInfo[@Id=\"" + info.Id.ToLower() + "\"]";
                manage.SetAttributesValue(nodeName, "OrderId", info.OrderId.ToString());
            }
            return(UpdateField(modelId, manage.Xml));
        }
Beispiel #16
0
        public static bool Delete(string fieldName, int templateId)
        {
            if (GetFieldInfoByFieldName(templateId, fieldName).FieldLevel == 0)
            {
                return(false);
            }
            XmlManage manage   = XmlManage.Instance(ModelTemplate.GetField(templateId), XmlType.Content);
            string    nodeName = "/ArrayOfFieldInfo/FieldInfo[@Id=\"" + fieldName.ToLower() + "\"]";

            manage.Remove(nodeName);
            return(ModelTemplate.UpdateField(templateId, manage.Xml));
        }
Beispiel #17
0
        public static bool FieldExists(int modelId, string fieldName)
        {
            string xmlFieldList = GetXmlFieldList(modelId);

            if (string.IsNullOrEmpty(xmlFieldList))
            {
                return(false);
            }
            string nodeName = "/ArrayOfFieldInfo/FieldInfo[@Id='" + fieldName.ToLower() + "']";

            return(XmlManage.Instance(xmlFieldList, XmlType.Content).ExistsNode(nodeName));
        }
        protected void SetInit(string xmlpath)
        {
            this.TxtLabelType.Text  = XmlManage.ReadFileNode(xmlpath, "root/LabelType");
            this.TxtLabelIntro.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelIntro");
            string strB = XmlManage.ReadFileNode(xmlpath, "root/LabelDataType");
            string str2 = XmlManage.ReadFileNode(xmlpath, "root/OutType");

            for (int i = 0; i < this.RbtDataType.Items.Count; i++)
            {
                if ((string.Compare(this.RbtDataType.Items[i].Value, strB, StringComparison.OrdinalIgnoreCase) == 0) && !this.RbtDataType.Items[i].Selected)
                {
                    this.RbtDataType.Items[i].Selected = true;
                    break;
                }
            }
            for (int j = 0; j < this.RBLOutType.Items.Count; j++)
            {
                if ((string.Compare(this.RBLOutType.Items[j].Value, str2, StringComparison.OrdinalIgnoreCase) == 0) && !this.RBLOutType.Items[j].Selected)
                {
                    this.RBLOutType.Items[j].Selected = true;
                    break;
                }
            }
            if ((string.Compare(strB, "static", StringComparison.Ordinal) == 0) || (string.Compare(strB, "sql_sysquery", StringComparison.Ordinal) == 0))
            {
                this.PanelOutSide.Visible = false;
            }
            else if (this.PanelOutSide.Visible)
            {
                if (string.Compare(strB, "ole_read", StringComparison.Ordinal) == 0)
                {
                    string str3 = XmlManage.ReadFileNode(xmlpath, "root/LabelDbPath");
                    if (string.IsNullOrEmpty(str3))
                    {
                        this.TxtDataSource.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelDataSource");
                    }
                    else
                    {
                        this.TxtDataSource.Text = str3;
                    }
                }
                else if (string.Compare(strB, "sql_sysstoredquery", StringComparison.Ordinal) == 0)
                {
                    this.TxtDataSource.Text        = XmlManage.ReadFileNode(xmlpath, "root/LabelSqlString");
                    this.BtnTestDataSource.Visible = false;
                }
                else
                {
                    this.TxtDataSource.Text = XmlManage.ReadFileNode(xmlpath, "root/LabelDataSource");
                }
            }
        }
Beispiel #19
0
 protected void BtnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(this.TxtSqlstr.Text) && (this.TxtSqlstr.Text != "请先建立SQL语句"))
         {
             bool flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlString", this.TxtSqlstr.Text);
             if (this.ChkPage.Checked)
             {
                 if (!string.IsNullOrEmpty(this.TxtSqlCount.Text) && (this.TxtSqlCount.Text != "请先建立SQL统计语句"))
                 {
                     flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlCount", this.TxtSqlCount.Text);
                 }
                 else
                 {
                     flag = false;
                     this.TxtSqlCount.Text = "请先建立SQL统计语句";
                 }
                 if ((string.Compare(this.Dbtype.Split(new char[] { '_' })[0], "sql", StringComparison.Ordinal) != 0) && flag)
                 {
                     if (!string.IsNullOrEmpty(this.TxtSqlPage.Text) && (this.TxtSqlPage.Text != "请先建立SQL分页语句"))
                     {
                         flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlPage", this.TxtSqlPage.Text);
                     }
                     else
                     {
                         flag = false;
                         this.TxtSqlPage.Text = "请先建立SQL分页语句";
                     }
                     flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlPage", this.TxtSqlPage.Text);
                 }
             }
             if (flag)
             {
                 File.Copy(this.xmlfilepath, HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.m_LabelName + ".config", true);
                 BasePage.ResponseRedirect("LabelManage.aspx");
             }
         }
         else
         {
             this.TxtSqlstr.Text = "请先建立SQL语句";
         }
     }
     catch (IOException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
     catch (UnauthorizedAccessException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
 }
Beispiel #20
0
        public static FieldInfo GetFieldInfoByFieldName(int templateId, string fieldName)
        {
            string    str2 = XmlManage.Instance(ModelTemplate.GetField(templateId), XmlType.Content).SelectNode("/ArrayOfFieldInfo/FieldInfo[@Id=\"" + fieldName.ToLower() + "\"]");
            FieldInfo info = null;

            if (!string.IsNullOrEmpty(str2))
            {
                TextReader    textReader = new StringReader(str2);
                XmlSerializer serializer = new XmlSerializer(typeof(FieldInfo));
                info = (FieldInfo)serializer.Deserialize(textReader);
                textReader.Close();
            }
            return(info);
        }
Beispiel #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RolePermissions.BusinessAccessCheck(OperateCode.CreateHtmlManage);
            this.HdnIsCreateHtml.Value = BasePage.RequestString("isCreateHtml");
            string nodeValue = XmlManage.Instance("Config/CreateCollectionWork.config", XmlType.File).GetNodeValue("CollectionWork/WorkId");

            this.m_UrlReferrer = base.Request.UrlReferrer.ToString();
            if (base.Application[nodeValue] != null)
            {
                this.BtnStopCreate.Visible = true;
            }
            else
            {
                this.BtnStopCreate.Visible = false;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.action         = BasePage.RequestString("action");
     this.labelname      = BasePage.RequestString("name");
     this.m_LabelLibPath = "~/" + SiteConfig.SiteOption.LabelDir;
     if (string.IsNullOrEmpty(this.labelname))
     {
         BasePage.ResponseRedirect("Label.aspx");
     }
     else
     {
         string path = WebConfigurationManager.AppSettings["EasyOne:LabelXsltPath"];
         this.xmlfilepath = HttpContext.Current.Server.MapPath(path) + @"\" + this.labelname + ".config";
         if (!base.IsPostBack)
         {
             if (LabelManage.GetAttributeList(this.xmlfilepath).Count == 0)
             {
                 this.attlist.Text = "您尚未建立属性!<a href=\"LabelProperty.aspx?action=" + this.action + "&name=" + this.labelname + "\">建立属性</a>";
             }
             else
             {
                 foreach (LabelAttributeInfo info in LabelManage.GetAttributeList(this.xmlfilepath))
                 {
                     string text = this.attlist.Text;
                     this.attlist.Text = text + "<div onclick=\"cit()\" outype=\"2\" class=\"spanfixdiv\" alt=\"" + info.Intro + "&#10默认值:" + info.DefaultValue + "\">" + info.AttributeName + "</div>";
                 }
             }
             if (!string.IsNullOrEmpty(XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate")))
             {
                 this.TxtTemplate.Text = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelTemplate");
             }
             ListItem item = new ListItem();
             item.Text = "全部分类";
             this.DropLabelList.DataSource     = LabelManage.GetLabelTypeList();
             this.DropLabelList.DataTextField  = "Name";
             this.DropLabelList.DataValueField = "Name";
             this.DropLabelList.DataBind();
             this.DropLabelList.Items.Insert(0, item);
             this.BuildLabelList(string.Empty);
             this.TxtTemplateTest.Text = "{PE.Label id=\"" + this.labelname + "\" /}";
         }
         this.TxtTemplate.Attributes.Add("onmouseup", "dragend(this)");
         this.TxtTemplate.Attributes.Add("onClick", "savePos(this)");
         this.TxtTemplate.Attributes.Add("onmousemove", "DragPos(this)");
     }
     this.SmpNavigator.AdditionalNode = this.labelname;
 }
Beispiel #23
0
 protected void ChkPage_CheckedChanged(object sender, EventArgs e)
 {
     if (this.ChkPage.Checked)
     {
         if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "UsePage", "True"))
         {
             this.CountShow.Visible = true;
             if ((string.Compare(this.Dbtype.Split(new char[] { '_' })[0], "sql", StringComparison.OrdinalIgnoreCase) != 0) && (string.Compare(this.Dbtype, "orc_read", StringComparison.OrdinalIgnoreCase) != 0))
             {
                 this.PageShow.Visible = true;
             }
         }
     }
     else if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "UsePage", ""))
     {
         this.CountShow.Visible = false;
         this.PageShow.Visible  = false;
     }
 }
        /// <summary>
        /// 输出类型数据绑定,从XML文件中获取
        /// </summary>
        public void ComBoxDataBind()
        {
            string sPath = FileManage.getApplicatonPath();

            sPath = sPath + "ImageFormatType.xml";
            List <string> listHJSensorType = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "HJSensorType", "Name");

            this.cbx_SensorType.DataSource = listHJSensorType;
            List <string> listHJBandType = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "HJBandType", "Name");

            string[] sBandBlue = listHJBandType.ToArray();
            this.cbx_BandBlue.DataSource = sBandBlue;
            string[] sBandGreen = listHJBandType.ToArray();
            this.cbx_BandGreen.DataSource = sBandGreen;
            string[] sBandRed = listHJBandType.ToArray();
            this.cbx_BandRed.DataSource = sBandRed;
            string[] sBandNInfrared = listHJBandType.ToArray();
            this.cbx_BandNInfrared.DataSource = sBandNInfrared;
        }
 protected void BtnFinal_Click(object sender, EventArgs e)
 {
     try
     {
         if (XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelTemplate", this.TxtTemplate.Text))
         {
             File.Copy(this.xmlfilepath, HttpContext.Current.Server.MapPath(this.m_LabelLibPath) + @"\" + this.labelname + ".config", true);
             BasePage.ResponseRedirect("LabelManage.aspx");
         }
     }
     catch (IOException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
     catch (UnauthorizedAccessException)
     {
         AdminPage.WriteErrMsg("没有标签目录或临时目录或标签文件的访问权限!", "LabelManage.aspx");
     }
 }
Beispiel #26
0
        protected static DataTable GetDataBaseSchema(string dtype, string xpath, string tablename)
        {
            switch (dtype)
            {
            case "sql_sysquery":
                return(LabelManage.GetSchemaTable(tablename, string.Empty, DataSourceType.None));

            case "sql_outquery":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Sql));

            case "ole_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Ole));

            case "odbc_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Odbc));

            case "orc_read":
                return(LabelManage.GetSchemaTable(tablename, XmlManage.ReadFileNode(xpath, "root/LabelDataSource"), DataSourceType.Oracle));
            }
            return(null);
        }
Beispiel #27
0
        //XmlHandler xmlH = new XmlHandler();


        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="DatabaseConnectionString">数据库连接串</param>
        public Database()
        {
            //获取程序的基目录。
            string str = XmlManage.ReadXml("IDLPath");
            //System.Windows.Forms.MessageBox.Show(str);

            string sProPath = Application.StartupPath;
            //string sXmlPath = sProPath.Substring(0, sProPath.LastIndexOf("bin"));
            string sConfigFullPath = sProPath + "\\Config.xml";
            //System.Windows.Forms.MessageBox.Show(sConfigFullPath);
            string sMachine  = XmlManage.ReadXmlByNodesName(sConfigFullPath, "SystemConfig", "OracleDBConfig", "ServerName");
            string sInstance = XmlManage.ReadXmlByNodesName(sConfigFullPath, "SystemConfig", "OracleDBConfig", "Instance");
            string sDatabase = XmlManage.ReadXmlByNodesName(sConfigFullPath, "SystemConfig", "OracleDBConfig", "DatabaseName");
            string sUserName = XmlManage.ReadXmlByNodesName(sConfigFullPath, "SystemConfig", "OracleDBConfig", "UserName");
            string sPassword = XmlManage.ReadXmlByNodesName(sConfigFullPath, "SystemConfig", "OracleDBConfig", "Password");

            //string sConn = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.200.252)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = orcl))) ;User Id=crop;Password=crop";
            string sConn = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =" + sMachine + ")(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = " + sInstance + "))) ;User Id=" + sUserName + ";Password="******"";

            System.Windows.Forms.MessageBox.Show(sConn);
            ConnectionString = sConn;
        }
Beispiel #28
0
        /// <summary>
        /// InputFileselect,mutiply
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_InPutFile_Click(object sender, EventArgs e)
        {
            this.listViewImage.GridLines = true;
            OpenFileDialog dlg   = new OpenFileDialog();  //创建一个OpenFileDialog
            string         sPath = FileManage.getApplicatonPath();

            sPath = sPath + "ImageFormatType.xml";
            List <string> list = XmlManage.getXmlListByNodesName(sPath, "ImageFormatType", "InputType", "Name");
            string        strs = "";
            string        str1 = "";
            string        str2 = "";

            for (int i = 0; i < list.Count; i++)
            {
                var item = list[i].ToString();
                str1 += item + ";";
                str2 += item + ";";
                strs += "(" + item + ")|" + item + "|";
            }
            //MessageBox.Show("str1=" + str1 + "\n" + " str2=" + str2);
            string str3 = "(" + str1 + ")|" + str2 + "|";

            strs            = strs + "(*.*)|*.*";
            dlg.Filter      = str3 + strs;
            dlg.Multiselect = true;//设置属性为多选
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                string str = " ";
                for (int i = 0; i < dlg.FileNames.Length; i++)  //根据数组长度定义循环次数
                {
                    str = dlg.FileNames.GetValue(i).ToString(); //获取文件文件名
                    ListViewItem item = new ListViewItem()
                    {
                        Text = "  " + str
                    };
                    this.listViewImage.Items.Add(item);
                }
            }
        }
Beispiel #29
0
 protected void BtnNext_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(this.TxtSqlstr.Text) && (this.TxtSqlstr.Text != "请先建立SQL语句"))
     {
         bool flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlString", this.TxtSqlstr.Text);
         if (this.ChkPage.Checked)
         {
             if (!string.IsNullOrEmpty(this.TxtSqlCount.Text) && (this.TxtSqlCount.Text != "请先建立SQL统计语句"))
             {
                 flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlCount", this.TxtSqlCount.Text);
             }
             else
             {
                 flag = false;
                 this.TxtSqlCount.Text = "请先建立SQL统计语句";
             }
             if ((string.Compare(this.Dbtype.Split(new char[] { '_' })[0], "sql", StringComparison.Ordinal) != 0) && flag)
             {
                 if (!string.IsNullOrEmpty(this.TxtSqlPage.Text) && (this.TxtSqlPage.Text != "请先建立SQL分页语句"))
                 {
                     flag = XmlManage.SaveFileNode(this.xmlfilepath, "root", "LabelSqlPage", this.TxtSqlPage.Text);
                 }
                 else
                 {
                     flag = false;
                     this.TxtSqlPage.Text = "请先建立SQL分页语句";
                 }
             }
         }
         if (flag)
         {
             BasePage.ResponseRedirect("LabelTemplate.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
         }
     }
     else
     {
         this.TxtSqlstr.Text = "请先建立SQL语句";
     }
 }
        protected void BtnNext_Click(object sender, EventArgs e)
        {
            string str  = XmlManage.ReadFileNode(this.xmlfilepath, "root/OutType");
            string str2 = XmlManage.ReadFileNode(this.xmlfilepath, "root/LabelDataType");

            if (str2 != null)
            {
                if (!(str2 == "static"))
                {
                    if (str2 == "sql_sysstoredquery")
                    {
                        BasePage.ResponseRedirect("LabelTemplate.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                    if (str2 == "xml_read")
                    {
                        BasePage.ResponseRedirect("LabelTemplate.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                }
                else
                {
                    switch (str)
                    {
                    case "txt":
                    case "xml":
                        BasePage.ResponseRedirect("LabelTemplateStatic.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;

                    default:
                        BasePage.ResponseRedirect("LabelTemplateStatic.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
                        return;
                    }
                }
            }
            BasePage.ResponseRedirect("LabelSqlBuild.aspx?action=" + this.action + "&name=" + base.Server.UrlEncode(this.m_LabelName));
        }