Esempio n. 1
0
 /// <summary>
 /// 发送事件请求
 /// </summary>
 /// <param name="method">请求的方法</param>
 /// <param name="url">请求的url</param>
 /// <param name="context">请求的参数上下文</param>
 /// <param name="header">请求的header资料</param>
 /// <param name="postdata">请求的post资料</param>
 /// <returns></returns>
 public string Send(string method, string url, EventsCallContext context = null, FrameDLRObject header = null, FrameDLRObject postdata = null)
 {
     if (header != null)
     {
         foreach (var key in header.Keys)
         {
             if (ComFunc.nvl(header.GetValue(key)).StartsWith("$") && context.ContainsKey(ComFunc.nvl(header.GetValue(key))))
             {
                 header.SetValue(key, context[ComFunc.nvl(header.GetValue(key))]);
             }
         }
     }
     if (postdata != null)
     {
         foreach (var key in postdata.Keys)
         {
             if (ComFunc.nvl(postdata.GetValue(key)).StartsWith("$") && context.ContainsKey(ComFunc.nvl(postdata.GetValue(key))))
             {
                 postdata.SetValue(key, context[ComFunc.nvl(postdata.GetValue(key))]);
             }
         }
     }
     if (method.ToLower() == "get")
     {
         return(Get(url, header));
     }
     else
     {
         return(base.Send(url, postdata, header, method));
     }
 }
        /// <summary>
        /// 处理Response中的cookie信息
        /// </summary>
        /// <param name="p"></param>
        /// <param name="d"></param>
        protected virtual void ProcessResponseCookie(TParameter p, TData d)
        {
            //处理cookie
            var cookies = (FrameDLRObject)p.ExtentionObj.cookie;

            if (cookies != null)
            {
                var addcookies    = p.ExtentionObj.cookie.add == null ? (FrameDLRObject)FrameDLRObject.CreateInstance() : (FrameDLRObject)p.ExtentionObj.cookie.add;
                var removecookies = p.ExtentionObj.cookie.remove == null ? (FrameDLRObject)FrameDLRObject.CreateInstance() : (FrameDLRObject)p.ExtentionObj.cookie.remove;
                foreach (var key in addcookies.Keys)
                {
                    var item   = (FrameDLRObject)addcookies.GetValue(key);
                    var name   = ComFunc.nvl(item.GetValue("name"));
                    var value  = ComFunc.nvl(item.GetValue("value"));
                    var domain = ComFunc.nvl(item.GetValue("domain"));
                    var expire = (DateTime)item.GetValue("expire");

                    CurrentContext.Response.Cookies.Append(name, value, new CookieOptions()
                    {
                        Expires = expire, Domain = domain
                    });
                }

                foreach (var key in removecookies.Keys)
                {
                    var item = (FrameDLRObject)removecookies.GetValue(key);
                    var name = ComFunc.nvl(item.GetValue("name"));
                    CurrentContext.Response.Cookies.Delete(name);
                }
            }
        }
Esempio n. 3
0
        protected override void ProcessRequestPath(WebParameter p, GoData d)
        {
            var context = p.CurrentHttpContext;

            //抓取请求资源
            p.RequestResourcePath = ComFunc.nvl(context.Request.Path).Replace("\\", "/").Replace(weixinroothome.Replace("~", ""), "");
            if (p.RequestResourceName == "" && p.RequestResourcePath == "/")
            {
                p.RequestResourcePath = p.RequestResourcePath + weixinhome;
            }

            var ext = Path.GetExtension(p.RequestResourcePath);

            if (ext != "")
            {
                string   reqpath = Path.GetFileNameWithoutExtension(p.RequestResourcePath);
                string[] ss      = reqpath.Split('.');
                p.Action = ss.Length > 1 ? ss[1] : "";
                p.RequestResourceName = ss.Length > 0 ? ss[0] : "";
                p.RequestResources    = ss;
            }
            else
            {
                var turl = p.RequestResourcePath.Replace("~", "");
                turl = turl.StartsWith("/") ? turl.Substring(1) : turl;
                string[] ss = turl.Split('/');
                p.Action = ss.Length > 1 ? ss[1] : "";
                p.RequestResourceName = ss.Length > 0 ? ss[0] : "";
                p.RequestResources    = ss;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 执行sp
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="connstr"></param>
        /// <param name="spname"></param>
        /// <param name="isreturnds"></param>
        /// <param name="dbp"></param>
        /// <returns></returns>
        protected virtual UnitDataCollection ExcuteSP <T>(string connstr, string spname, bool isreturnds, DBOParameterCollection dbp) where T : ADBAccess, IResourceEntity
        {
            T dao = GetDao <T>(connstr, null);

            try
            {
                UnitDataCollection rtn   = new UnitDataCollection();
                DBDataCollection   dbrtn = dao.ExcuteProcedure(ComFunc.nvl(spname), isreturnds, ref dbp);
                if (dbrtn.IsSuccess)
                {
                    foreach (string s in dbrtn.Keys)
                    {
                        if (dbrtn[s] is DataSetStd)
                        {
                            rtn.QueryDatas = dbrtn.ReturnDataSet;
                        }
                        else
                        {
                            rtn.SetValue(s, dbrtn[s]);
                        }
                    }
                }
                return(rtn);
            }
            finally
            {
                dao.Close();
            }
        }
Esempio n. 5
0
        public virtual object QueryByPage(Dictionary <string, object> sqlobj, int topage, int count_per_page, Dictionary <string, object> data)
        {
            if (sqlobj == null)
            {
                sqlobj = new Dictionary <string, object>();
            }
            var dsql = FrameDLRObject.CreateInstance(sqlobj);


            _up.SetValue("___host_sql___", ComFunc.nvl(dsql.sql));
            _up.SetValue("___host_orderby___", ComFunc.nvl(dsql.orderby));
            _up.SetValue("___host_pre___", ComFunc.nvl(dsql.presql));
            _up.SetValue("___host_after___", ComFunc.nvl(dsql.aftersql));
            if (data != null)
            {
                foreach (var item in data)
                {
                    _up.SetValue(item.Key, item.Value);
                }
            }
            _up.Count_Of_OnePage = count_per_page;
            _up.ToPage           = topage;
            var udc  = _logic.DB.QueryByPage <HostQueryByPageUnit>(_up, "");
            var list = udc.QueryData <FrameDLRObject>();

            list = list == null ? new List <FrameDLRObject>() : list;
            var rtn = FrameDLRObject.CreateInstance(FrameDLRFlags.SensitiveCase);

            rtn.data             = list;
            rtn.TotalPage        = udc.TotalPage;
            rtn.TotalRow         = udc.TotalRow;
            rtn.Count_Of_OnePage = udc.Count_Of_OnePage;
            rtn.CurrentPage      = udc.CurrentPage;
            return(((FrameDLRObject)rtn).ToDictionary());
        }
Esempio n. 6
0
        protected virtual object IfNotNullThen(object[] args)
        {
            if (args == null || args.Length <= 0)
            {
                return(null);
            }
            //第一个参数为一个值
            var value1 = args[0];

            //第二个参数为LinqDLR2SqlWhereOperator
            if (args.Length < 2)
            {
                return(null);
            }
            if (args[1] is LinqDLR2SqlWhereOperator)
            {
                if (value1 != null && ComFunc.nvl(value1) != "")
                {
                    return((LinqDLR2SqlWhereOperator)args[1]);
                }
                else
                {
                    return(new LinqDLR2SqlWhereOperator("", null));
                }
            }
            else
            {
                return(new LinqDLR2SqlWhereOperator("", null));
            }
        }
 /// <summary>
 /// 将Logic的数据写入到UnitParameter
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="up"></param>
 public void SetUnitParameter(FlowLogicData ld, UnitParameter up, string domain)
 {
     foreach (var v in ld.Domain(domain))
     {
         up.SetValue(v.Key, ComFunc.nvl(v.Value));
     }
 }
Esempio n. 8
0
        public static void Main(string[] args)
        {
            Console.WriteLine(ComFunc.GetApplicationRoot());
            //准备框架环境参数
            GlobalCommon.Logger             = new Log4Net();
            GlobalCommon.ExceptionProcessor = new EWRAExceptionProcessor();
            Console.OutputEncoding          = Encoding.UTF8;

            //设定服务端参数
            //设定监听端口
            if (!String.IsNullOrEmpty(MyConfig.GetConfiguration("Server", "Port")))
            {
                defaultport = MyConfig.GetConfiguration("Server", "Port");
            }
            else if (args != null)
            {
                if (args.Length > 0 && IntStd.IsInt(args[0]))
                {
                    defaultport = args[0];
                }
            }
            Console.WriteLine($"服务器启动监听端口为{defaultport},如果要调整,请在启动应用时,后面接端口参数,或者在appsettings.json中的Server下设定Port参数(配置档优先)");
            var host = new WebHostBuilder()
                       .UseKestrel()
                       .UseContentRoot(Directory.GetCurrentDirectory())
                       .UseUrls("http://*:" + defaultport)
                       .UseIISIntegration()
                       .UseStartup <Startup>()
                       .UseApplicationInsights()
                       .Build();

            host.Run();
        }
        /// <summary>
        /// 根据属性名称获取对应的值
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static string Map(string name)
        {
            lock (lockobj)
            {
                if (_dic == null)
                {
                    _dic = new Dictionary <string, string>();

                    var obj = new ResponseHeader_ContentType();
                    var fs  = obj.GetType().GetFields();
                    foreach (var f in fs)
                    {
                        _dic.Add(f.Name, ComFunc.nvl(f.GetValue(obj)));
                    }
                }
            }

            if (_dic.ContainsKey(name))
            {
                return(_dic[name]);
            }
            else
            {
                return("");
            }
        }
 /// <summary>
 /// 将Logic的数据写入到UnitParameter
 /// </summary>
 /// <param name="ld"></param>
 /// <param name="up"></param>
 public void SetUnitParameter(FlowLogicData ld, UnitParameter up)
 {
     foreach (var v in ld)
     {
         up.SetValue(v.Key, ComFunc.nvl(v.Value));
     }
 }
Esempio n. 11
0
        object SendMsg(LogicData arg)
        {
            var touser  = ComFunc.nvl(arg.GetValue("to"));
            var content = ComFunc.IsBase64Then(ComFunc.nvl(arg.GetValue("content")).Replace(" ", "+"));

            return(Weixin.SendTextCardMsg(touser, "", "", "本月薪资", $"{DateTime.Now.ToString("yyyy年MM月")}工作单", "http://www.baidu.com"));
        }
Esempio n. 12
0
        public async void OnClickBtnStart(object sender, RoutedEventArgs e)
        {
            pictureBoxAfter.Source = null;

            btnFileSelect.IsEnabled = false;
            btnAllClear.IsEnabled   = false;
            btnStart.IsEnabled      = false;

            bool bLoadImageResult = await LoadImage();

            if (bLoadImageResult)
            {
                bool bTaskResult = await TaskWorkImageProcessing();

                if (bTaskResult)
                {
                    m_strCurImgName        = ComFunc.GetStringApplicationDataContainer(ComInfo.IMG_TYPE_SELECT_NAME);
                    pictureBoxAfter.Source = await ComFunc.ConvertToSoftwareBitmapSource(SelectGetBitmap(m_strCurImgName));
                }
            }
            btnFileSelect.IsEnabled = true;
            btnAllClear.IsEnabled   = true;
            btnStart.IsEnabled      = true;

            return;
        }
Esempio n. 13
0
        /// <summary>
        /// 根据参数采用MD5算法生成数字签名
        /// </summary>
        /// <param name="obj">参数集,该参数集不可包含数字签名的栏位</param>
        /// <param name="mch_key">微信商户支付秘钥</param>
        /// <returns></returns>
        public static string GenMD5SignString(FrameDLRObject obj, string mch_key)
        {
            SortedDictionary <string, object> p = new SortedDictionary <string, object>();

            foreach (var k in obj.Keys)
            {
                p.Add(k, obj.GetValue(k));
            }
            string buff = "";

            foreach (KeyValuePair <string, object> pair in p)
            {
                if (pair.Key != "sign" && ComFunc.nvl(pair.Value) != "")
                {
                    buff += pair.Key + "=" + pair.Value + "&";
                }
            }
            buff  = buff.Trim('&');
            buff += "&key=" + mch_key;

            //MD5加密
            var md5 = MD5.Create();
            var bs  = md5.ComputeHash(Encoding.UTF8.GetBytes(buff));
            var sb  = new StringBuilder();

            foreach (byte b in bs)
            {
                sb.Append(b.ToString("x2"));
            }
            return(sb.ToString().ToUpper());
        }
Esempio n. 14
0
        protected virtual void LoadConfig(WebParameter p, GoData d)
        {
            foreach (var item in MyConfig.GetConfigurationList("ConnectionStrings"))
            {
                p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value);
            }
            p.DBConnectionString = ComFunc.nvl(p[DomainKey.CONFIG, "DefaultConnection"]);
            bool bvalue = true;

            foreach (var item in MyConfig.GetConfigurationList("EFFC"))
            {
                if (bool.TryParse(ComFunc.nvl(item.Value), out bvalue))
                {
                    p[DomainKey.CONFIG, item.Key] = bool.Parse(ComFunc.nvl(item.Value));
                }
                else if (DateTimeStd.IsDateTime(item.Value))
                {
                    p[DomainKey.CONFIG, item.Key] = DateTimeStd.ParseStd(item.Value).Value;
                }
                else
                {
                    p[DomainKey.CONFIG, item.Key] = ComFunc.nvl(item.Value);
                }
            }
        }
        /// <summary>
        /// 獲取临时新增行的数据
        /// </summary>
        /// <param name="columnIndex"></param>
        /// <returns></returns>
        public object GetNewRowValue(int columnIndex)
        {
            if (this._new_row == null)
            {
                return(null);
            }
            if (columnIndex >= this.schema.Count)
            {
                return(null);
            }
            var dc = this.schema[columnIndex];

            if (this._new_row.GetValue(dc.ColumnName) != null && this._new_row.GetValue(dc.ColumnName) != DBNull.Value)
            {
                if (dc.DataType == typeof(string))
                {
                    return(ComFunc.nvl(this._new_row.GetValue(dc.ColumnName)));
                }
                else
                {
                    return(this._new_row.GetValue(dc.ColumnName));
                }
            }
            else
            {
                return(null);
            }
        }
        private dynamic Load(UnitParameter arg)
        {
            var rtn  = FrameDLRObject.CreateInstance();
            var json = arg.GetValue("__json__");

            if (json != null && json is DBExpress)
            {
                var            express = (DBExpress)json;
                var            re      = express.ToExpress();
                var            sql     = ComFunc.nvl(re.GetValue("sql"));
                FrameDLRObject data    = re.GetValue("data") != null ? (FrameDLRObject)re.GetValue("data") : FrameDLRObject.CreateInstance();
                var            orderby = ComFunc.nvl(re.GetValue("orderby"));
                foreach (var k in data.Keys)
                {
                    arg.SetValue(k, data.GetValue(k));
                }
                if (express.CurrentAct == DBExpress.ActType.QueryByPage)
                {
                    rtn.sql     = sql;
                    rtn.orderby = orderby;
                }
                else
                {
                    rtn.sql = sql;
                }
            }
            return(rtn);
        }
Esempio n. 17
0
        protected override string DoProcess(dynamic args, string content)
        {
            string action = ComFunc.nvl(args.action);
            Dictionary <string, string> actioncontent = null;
            List <string> actions = null;

            if (CurrentContext.GetParsedContent(this.TagName, action) != null)
            {
                actioncontent = (Dictionary <string, string>)CurrentContext.GetParsedContent(this.TagName, action);
            }
            else
            {
                actioncontent = new Dictionary <string, string>();
                this.CurrentContext.SetParsedContent(this, action, actioncontent);
            }
            if (CurrentContext.GetParsedContent(this.TagName, "actionlist") != null)
            {
                actions = (List <string>)CurrentContext.GetParsedContent(this.TagName, "actionlist");
            }
            else
            {
                actions = new List <string>();
                CurrentContext.SetParsedContent(this, "actionlist", actions);
            }
            if (!actions.Contains(action))
            {
                actions.Add(action);
            }

            var uid = Guid.NewGuid().ToString();
            var key = "#" + uid + "#";

            actioncontent.Add(key, content);
            return(key);
        }
Esempio n. 18
0
            /// <summary>
            /// 创建一个EBS的DB访问参数
            /// </summary>
            /// <returns></returns>
            public UnitParameter NewDBUnitParameter4EBS()
            {
                var rtn = base.NewDBUnitParameter <OracleAccess>();

                rtn.Dao.Open(ComFunc.nvl(_logic.Configs["EBSConnection"]));
                return(rtn);
            }
Esempio n. 19
0
            /// <summary>
            /// 创建一个默认的DB访问参数
            /// </summary>
            /// <returns></returns>
            public override UnitParameter NewDBUnitParameter()
            {
                var           dbtype = ComFunc.nvl(_logic.Configs["DB_Type"]);
                UnitParameter rtn    = null;

                if (dbtype.ToLower() == "sqlserver")
                {
                    rtn = base.NewDBUnitParameter <SQLServerAccess>();
                }
                else if (dbtype.ToLower() == "mysql")
                {
                    rtn = base.NewDBUnitParameter <MySQLAccess>();
                }
                else if (dbtype.ToLower() == "oracle")
                {
                    rtn = base.NewDBUnitParameter <OracleAccess>();
                }
                else if (dbtype.ToLower() == "sqlite")
                {
                    rtn = base.NewDBUnitParameter <SqliteAccess>();
                }
                InitUPPage(rtn);
                rtn.Dao.Open(_logic.CallContext_Parameter.DBConnectionString);
                return(rtn);
            }
Esempio n. 20
0
        public static void Test()
        {
            var log_path    = @"E:\Debug-20180628.txt;E:\Debug-20180629.txt;E:\Debug-20180630.txt;E:\Debug-20180701.txt;E:\Debug-20180702.txt;E:\Debug-20180703.txt;";
            var list_source = new List <string>();

            foreach (var path in log_path.Split(';', StringSplitOptions.RemoveEmptyEntries))
            {
                if (File.Exists(path))
                {
                    foreach (var s in File.ReadAllLines(path))
                    {
                        var index = s.IndexOf("request content:orders=");
                        if (index > 0)
                        {
                            list_source.Add(s.Substring(index).Replace("request content:orders=", ""));
                        }
                    }
                }
            }

            var sb = new StringBuilder();

            foreach (var s in list_source)
            {
                sb.AppendLine(formatXml(ComFunc.Base64DeCode(ComFunc.UrlDecode(s))));
            }

            File.WriteAllText("e:/hongxun.txt", sb.ToString());
        }
        /// <summary>
        /// 根據columnName和rowIndex獲取值
        /// </summary>
        /// <param name="columnName"></param>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        public object GetValue(string columnName, int rowIndex)
        {
            if (this == null)
            {
                return(null);
            }
            if (rowIndex >= this.data.Count)
            {
                return(null);
            }
            if (this.schema.Where(w => w.ColumnName.ToLower() == columnName.ToLower()).Count() <= 0)
            {
                return(null);
            }
            var dc = this.schema.Where(w => w.ColumnName.ToLower() == columnName.ToLower()).First();

            if (this.data[rowIndex].GetValue(columnName) != null && this.data[rowIndex].GetValue(columnName) != DBNull.Value)
            {
                if (dc.DataType == typeof(string))
                {
                    return(ComFunc.nvl(this.data[rowIndex].GetValue(columnName)));
                }
                else
                {
                    return(this.data[rowIndex].GetValue(columnName));
                }
            }
            else
            {
                return(null);
            }
        }
Esempio n. 22
0
        private dynamic GetSql(UnitParameter arg)
        {
            var rtn = FrameDLRObject.CreateInstance();

            rtn.sql = ComFunc.nvl(arg["___host_sql___"]);
            return(rtn);
        }
        /// <summary>
        /// 獲取临时新增行的数据
        /// </summary>
        /// <param name="columnName"></param>
        /// <returns></returns>
        public object GetNewRowValue(string columnName)
        {
            if (this._new_row == null)
            {
                return(null);
            }
            var dc = this.schema.Where(w => w.ColumnName.ToLower() == columnName.ToLower());

            if (dc.Count() <= 0)
            {
                return(null);
            }

            if (this._new_row.GetValue(dc.First().ColumnName) != null && this._new_row.GetValue(dc.First().ColumnName) != DBNull.Value)
            {
                if (dc.First().DataType == typeof(string))
                {
                    return(ComFunc.nvl(this._new_row.GetValue(dc.First().ColumnName)));
                }
                else
                {
                    return(this._new_row.GetValue(dc.First().ColumnName));
                }
            }
            else
            {
                return(null);
            }
        }
Esempio n. 24
0
        /// <summary>
        /// 获取部门列表
        /// </summary>
        /// <param name="deptid">部门id。获取指定部门及其下的子部门。 如果不填,默认获取全量组织架构</param>
        /// <returns></returns>
        public List <object> GetDeptList(string deptid = "")
        {
            var rtn = new List <object>();
            var url = string.Format(GetDeptListUrl, Access_Token);

            if (deptid != "")
            {
                url += "&id=" + deptid;
            }
            dynamic obj = CallWeixinServer(url, "GET");

            if (obj != null)
            {
                if (ComFunc.nvl(obj.errcode) == "0")
                {
                    if (obj.department is object[])
                    {
                        rtn = ((object[])obj.department).ToList();
                    }
                    else
                    {
                        rtn = obj.department;
                    }
                }
            }

            return(rtn);
        }
        /// <summary>
        /// 根據columns搜索与values中相同的数据,判断是否存在
        /// </summary>
        /// <param name="values"></param>
        /// <returns></returns>
        public bool IsExist(Dictionary <string, object> values)
        {
            bool rtn = true;

            if (this.data.Count <= 0)
            {
                rtn = false;
            }
            else
            {
                for (int i = 0; i < this.data.Count; i++)
                {
                    bool tmp = true;
                    foreach (KeyValuePair <string, object> kvp in values)
                    {
                        tmp = tmp & (ComFunc.nvl(GetValue(kvp.Key, i)) == ComFunc.nvl(kvp.Value));
                    }
                    //如果為true,則表示有完全與values相同的資料存在,否則當前這行資料與values不相同,則瀏覽下一行資料
                    if (tmp)
                    {
                        rtn = true;
                        break;
                    }
                    else
                    {
                        rtn = rtn & tmp;
                    }
                }
            }

            return(rtn);
        }
Esempio n. 26
0
        static void Main(string[] args)
        {
            var dt = DateTime.Now;

            DllLoadTest.Test();
            //JSEngineTest.Test();
            //ReflectTest.Test();
            //FrameArrayTest.Test();
            //WebGoTest.Test();
            //SqliteTest.Test();
            //ReflectVersionTest.Test();

            //LinqTest.Test();
            //InvokeTest.Test();
            //DaoLinqSqlTest.test();
            //MobileAPITest.Test();
            //RazorTest.Test();
            //JWTTest.Test();
            //JiangsuTest.Test();
            //HWAPITest.Test();
            //PostgreSqlTest.Test();
            //OracleTest.Test();
            //MiniTools.Test();
            //BaiduTest.test();
            //NPoiTest.Test();
            Console.WriteLine("当前应用路径:" + ComFunc.GetApplicationRoot());
            Console.WriteLine($"cast time:{(DateTime.Now - dt).TotalMilliseconds}ms");
            Console.Read();
        }
Esempio n. 27
0
        public async Task <bool> LoadImage()
        {
            bool bRst = true;

            try
            {
                var openFile = await m_storageFile.OpenReadAsync();

                m_bitmap = new BitmapImage();
                m_bitmap.SetSource(openFile);
                pictureBoxOriginal.Source = m_bitmap;

                m_softwareBitmap = await ComFunc.CreateSoftwareBitmap(m_storageFile, m_bitmap);

                m_strCurImgName = ComFunc.GetStringApplicationDataContainer(ComInfo.IMG_TYPE_SELECT_NAME);
                SelectLoadImage(m_strCurImgName);
            }
            catch (Exception)
            {
                bRst = false;
                return(bRst);
            }

            return(bRst);
        }
Esempio n. 28
0
        private string DoAfterProcess(string content)
        {
            var text   = content;
            var jstext = new StringBuilder();
            var reg    = new Regex(@"(?isx)\#hjs[A-Za-z0-9\-]*\#");
            var arrstr = reg.Split(text);
            var m      = reg.Matches(text);

            for (int i = 0; i < arrstr.Length; i++)
            {
                if (arrstr[i].Replace("\r", "").Replace("\n", "").Trim() != "")
                {
                    jstext.AppendLine(@"viewdoc.write('" + ComFunc.HTMLEncode(arrstr[i]).Replace("\r", "\\r").Replace("\n", "\\n").Replace("&", "@@@") + "');");
                    //jstext.AppendLine(@"viewdoc.write('" + arrstr[i].Replace("\r", "\\r").Replace("\n", "\\n") + "');");
                }
                if (i < m.Count)
                {
                    var key = m[i].Value;
                    key = key.Replace("#hjs", "").Replace("#", "");
                    jstext.AppendLine(ComFunc.nvl(ModuleData.Context.GetParsedContent("hjs", key)));
                }
            }
            var rtn = jstext.ToString().Replace("@space@", " ");

            return(rtn);
        }
Esempio n. 29
0
        protected override string DoProcess(dynamic args, string content)
        {
            string bindname = ComFunc.nvl(args.key);

            if (bindname == "")
            {
                return("");
            }

            var    keys  = bindname.Split('.');
            object value = CurrentContext.GetBindObject(keys[0]);

            for (var i = 1; i < keys.Length; i++)
            {
                var k = keys[i];
                if (value == null)
                {
                    value = "";
                    break;
                }
                if (value is FrameDLRObject)
                {
                    value = ((FrameDLRObject)value).GetValue(k);
                }
            }
            return(ComFunc.nvl(value));
        }
Esempio n. 30
0
 /// <summary>
 /// 构造新增分类
 /// </summary>
 /// <param name="type"></param>
 /// <param name="name"></param>
 /// <param name="memo"></param>
 public CustomerType(CustomerTypeEnum type, string name, string memo)
 {
     Id   = ComFunc.NewCombGuid();
     Type = type;
     Name = name;
     Memo = memo;
 }
Esempio n. 31
0
 private void Query(string strw)
 {
     DataSet ds = new DataSet();
     ds = bll.GetList(strw);
     //grid
     gridControl1.DataSource = ds.Tables[0];
     gridView1.Columns.Clear();
     ComFunc comfun = new ComFunc();
     comfun.dgvstyle(gridView1, 0, "ID", "序号", 5, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 1, "DEPT_CODE", "科室编码", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 2, "DEPT_NAME", "科室名称", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 3, "HELP_CODE", "助记符", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 4, "DEPT_TYPE", "科室类型", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 5, "HOSPITAl_CODE", "所属医院", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 6, "CREATE_DATE", "创建时间", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     comfun.dgvstyle(gridView1, 7, "CREATE_BY", "创建人", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
 }
Esempio n. 32
0
 private void Query(string strw)
 {
     try
     {
         DataSet ds = new DataSet();
         ds = bll.GetList(strw);
         //grid
         gridControl1.Dock = DockStyle.Fill;
         gridControl1.DataSource = ds.Tables[0];
         gridView1.Columns.Clear();
         ComFunc comfun = new ComFunc();
         comfun.dgvstyle(gridView1, 0, "ID", "序号", 5, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
         comfun.dgvstyle(gridView1, 1, "TYPE_CODE", "编码", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
         comfun.dgvstyle(gridView1, 2, "TYPE_NAME", "名称", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
         comfun.dgvstyle(gridView1, 3, "HELP_CODE", "助记符", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
         comfun.dgvstyle(gridView1, 4, "CREATE_DATE", "创建时间", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
         comfun.dgvstyle(gridView1, 5, "CREATE_BY", "创建人", 15, true, true, DevExpress.Utils.HorzAlignment.Center, DevExpress.XtraGrid.Columns.FixedStyle.Left, true);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.ToString());
     }
 }