Ejemplo n.º 1
0
 private static ResWord GetSearchWord(IList<object> r)
 {
     var resfile = new ResFile {FileID = (int)r[1], FileName = (string)r[3], ModuleName = (string)r[4], ProjectName = (string)r[5]};
     return new ResWord {Title = (string)r[0], ResFile = resfile, ValueFrom = (string)r[2]};
 }
Ejemplo n.º 2
0
        public static List<ResWord> GetListResWords(ResFile resFile, string to, string search)
        {
            using (var dbManager = new DbManager("tmresource"))
            {
                var sql = new SqlQuery("res_data")
                    .Select("title", "fileid", "textValue", "description", "flag", "link")
                    .InnerJoin("res_files", Exp.EqColumns("res_files.ID", "res_data.fileID"))
                    .Where("moduleName", resFile.ModuleName)
                    .Where("projectName", resFile.ProjectName)
                    .Where("cultureTitle", to)
                    .Where("flag != 4")
                    .Where("resourceType", "text")
                    .OrderBy("res_data.id", true);

                if (!String.IsNullOrEmpty(resFile.FileName))
                    sql.Where("resName", resFile.FileName);

                if (!String.IsNullOrEmpty(search))
                    sql.Where(Exp.Like("textvalue", search));

                return dbManager.ExecuteList(sql).ConvertAll(r => GetWord(r));
            }
        }