Beispiel #1
0
        public static List <BITestData> RetrieveProjectTestDataByWafer(string pjkey, string wafer)
        {
            var ret = new List <BITestData>();
            var sql = string.Empty;

            if (!string.IsNullOrEmpty(pjkey))
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and Wafer = '<Wafer>' order by ModuleSerialNum,TestTimeStamp DESC";
                sql = sql.Replace("<ProjectKey>", pjkey).Replace("<Wafer>", wafer);
            }
            else
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where Wafer = '<Wafer>' order by ModuleSerialNum,TestTimeStamp DESC";
                sql = sql.Replace("<Wafer>", wafer);
            }

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                var tempdata = new BITestData(Convert.ToString(item[0]), Convert.ToString(item[1]), Convert.ToString(item[2])
                                              , Convert.ToString(item[3]), Convert.ToString(item[4]), Convert.ToString(item[5])
                                              , Convert.ToString(item[6]), Convert.ToString(item[7]), Convert.ToString(item[8]), Convert.ToString(item[9]), Convert.ToString(item[10]));
                ret.Add(tempdata);
            }
            return(ret);
        }
Beispiel #2
0
        public static UserBlogVM RetrieveBlogDoc(string dockey, Controller ctrl)
        {
            var ret = new UserBlogVM();

            ret.CommentList = ProjectErrorViewModels.RetrieveErrorComments(dockey, ctrl);

            var sql = "select UserName,APVal1,APVal2,APVal3,APVal4,APVal5,APVal9 from UserBlog where APVal2='<APVal2>'";

            sql = sql.Replace("<APVal2>", dockey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                ret.UserName    = Convert.ToString(line[0]);
                ret.ContentType = Convert.ToString(line[1]);
                ret.DocKey      = Convert.ToString(line[2]);
                ret.dbTitle     = Convert.ToString(line[3]);
                ret.dbContent   = Convert.ToString(line[4]);
                ret.Tag         = Convert.ToString(line[5]);
                ret.CreateDate  = DateTime.Parse(Convert.ToString(line[6]));

                //if (string.Compare(ret.ContentType, UserBlogContentType.COMMENT) == 0)
                //{
                ret.DocURL = "/User/WebDoc?DocKey=" + ret.DocKey;
                //}

                //if (string.Compare(ret.ContentType, UserBlogContentType.ATTACH) == 0)
                //{
                //ret.DocURL = "/User/WebDoc?DocKey=" + ret.DocKey;
                //}
            }

            return(ret);
        }
Beispiel #3
0
        public static List <ShareDocVM> RetrieveAllSharedDocs(Controller ctrl)
        {
            var ret   = new List <ShareDocVM>();
            var sql   = "select DOCPJK,DOCType,DOCKey,DOCTag,DOCCreator,DOCDate,DOCFavorTimes,APVal1,BackLink from ShareDoc order by DOCDate";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                var tempvm = new ShareDocVM();
                tempvm.DOCPJK        = Convert.ToString(line[0]);
                tempvm.DOCType       = Convert.ToString(line[1]);
                tempvm.DOCKey        = Convert.ToString(line[2]);
                tempvm.DOCTag        = Convert.ToString(line[3]);
                tempvm.DOCCreator    = Convert.ToString(line[4]);
                tempvm.DOCDate       = DateTime.Parse(Convert.ToString(line[5]));
                tempvm.DOCFavorTimes = Convert.ToInt32(line[6]);
                tempvm.DocID         = Convert.ToString(line[7]);
                tempvm.BACKLink      = Convert.ToString(line[8]);

                if (string.Compare(tempvm.DOCType, ShareDocType.ISSUE, true) == 0)
                {
                    var issue = IssueViewModels.RetrieveIssueByIssueKey(tempvm.DOCKey, ctrl);
                    if (issue == null)
                    {
                        continue;
                    }

                    tempvm.Summary = issue.Summary;
                    tempvm.DocURL  = "/Issue/UpdateIssue?issuekey=" + tempvm.DOCKey;
                }
                else if (string.Compare(tempvm.DOCType, ShareDocType.DEBUG, true) == 0)
                {
                    var debugtree = ProjectErrorViewModels.RetrieveErrorByErrorKey(tempvm.DOCKey, ctrl);
                    tempvm.Summary = debugtree[0].ProjectKey + "-" + debugtree[0].OrignalCode;
                    tempvm.DocURL  = "/Project/UpdateProjectError?ErrorKey=" + tempvm.DOCKey;
                }
                else if (string.Compare(tempvm.DOCType, ShareDocType.BLOG, true) == 0)
                {
                    var blog = UserBlogVM.RetrieveBlogDoc(tempvm.DOCKey, ctrl);
                    if (string.IsNullOrEmpty(blog.DocKey))
                    {
                        continue;
                    }

                    tempvm.Summary = blog.Title;
                    tempvm.DocURL  = blog.DocURL;
                }
                else
                {
                    tempvm.Summary = tempvm.DOCKey;
                    //var tempstrs = tempvm.Summary.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
                    //var datestr = tempstrs[tempstrs.Length - 1].Substring(0, 8);
                    //tempvm.DocURL = "/userfiles/docs/" + datestr + "/" + tempvm.DOCKey;
                    tempvm.DocURL = "/User/WebDoc?DocKey=" + tempvm.DOCKey + "&Creator=" + tempvm.DOCCreator;
                }

                ret.Add(tempvm);
            }
            return(ret);
        }
Beispiel #4
0
        public static string ShareDoc(string DOCPJK, string DOCType, string DOCKey, string DOCTag, string DOCCreator, string DOCDate, string BackLink)
        {
            var sql = "select APVal1 from ShareDoc where DOCPJK='<DOCPJK>' and DOCKey=N'<DOCKey>'";

            sql = sql.Replace("<DOCPJK>", DOCPJK).Replace("<DOCKey>", DOCKey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                var docid1 = Convert.ToString(dbret[0][0]);
                if (string.IsNullOrEmpty(docid1))
                {
                    docid1 = UpdateDocID(DOCPJK, DOCKey);
                }
                return(docid1);
            }

            var docid = IssueViewModels.GetUniqKey();

            sql = "insert into ShareDoc(DOCPJK,DOCType,DOCKey,DOCTag,DOCCreator,DOCDate,APVal1,BackLink) values('<DOCPJK>','<DOCType>',N'<DOCKey>','<DOCTag>','<DOCCreator>','<DOCDate>','<DOCID>','<BackLink>')";
            sql = sql.Replace("<DOCPJK>", DOCPJK).Replace("<DOCType>", DOCType)
                  .Replace("<DOCKey>", DOCKey).Replace("<DOCTag>", DOCTag)
                  .Replace("<DOCCreator>", DOCCreator).Replace("<DOCDate>", DOCDate)
                  .Replace("<DOCID>", docid).Replace("<BackLink>", BackLink);
            DBUtility.ExeLocalSqlNoRes(sql);
            return(docid);
        }
Beispiel #5
0
        public static List <BITestData> RetrieveProjectTestData(string projectkey, string startdate, string enddate, bool firstyield)
        {
            var ret = new List <BITestData>();
            var sql = "";

            if (firstyield)
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp ASC";
            }
            else
            {
                sql = "select ProjectKey,DataID,ModuleSerialNum,WhichTest,ModuleType,ErrAbbr,TestTimeStamp,TestStation,PN,Wafer,Waferpn from BITestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp DESC";
            }

            sql = sql.Replace("<ProjectKey>", projectkey).Replace("<StartDate>", startdate).Replace("<EndDate>", enddate);

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                var tempdata = new BITestData(Convert.ToString(item[0]), Convert.ToString(item[1]), Convert.ToString(item[2])
                                              , Convert.ToString(item[3]), Convert.ToString(item[4]), Convert.ToString(item[5])
                                              , Convert.ToString(item[6]), Convert.ToString(item[7]), Convert.ToString(item[8]), Convert.ToString(item[9]), Convert.ToString(item[10]));
                ret.Add(tempdata);
            }
            return(ret);
        }
Beispiel #6
0
        public static List <ProjectTestData> RetrieveProjectTestData(string projectkey, string startdate, string enddate, bool firstyield, Cache mycache)
        {
            //ProjectTestData.PrePareLatestData(projectkey);

            var ret = new List <ProjectTestData>();
            var sql = "";

            if (firstyield)
            {
                sql = "select ModuleSerialNum,WhichTest,ErrAbbr,TestTimeStamp from ProjectTestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp ASC";
            }
            else
            {
                sql = "select ModuleSerialNum,WhichTest,ErrAbbr,TestTimeStamp from ProjectTestData where ProjectKey = '<ProjectKey>' and TestTimeStamp > '<StartDate>' and TestTimeStamp < '<EndDate>' order by ModuleSerialNum,TestTimeStamp DESC";
            }

            sql = sql.Replace("<ProjectKey>", projectkey).Replace("<StartDate>", startdate).Replace("<EndDate>", enddate);

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, mycache);

            foreach (var item in dbret)
            {
                //public ProjectTestData(string pk, string sn, string wtest, string err, string testtime)
                var tempdata = new ProjectTestData(projectkey, Convert.ToString(item[0]), Convert.ToString(item[1]), Convert.ToString(item[2])
                                                   , Convert.ToString(item[3]));
                ret.Add(tempdata);
            }
            return(ret);
        }
        public static ProjectViewModels RetrieveOneProject(string key)
        {
            var sql = "select ProjectKey,ProjectName,StartDate,FinishRate,Description,APVal1,APVal2,ProjectType from Project where ProjectKey = '<ProjectKey>' and validate = 1";

            sql = sql.Replace("<ProjectKey>", key);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                var ret = new ProjectViewModels(Convert.ToString(dbret[0][0])
                                                , Convert.ToString(dbret[0][1]), Convert.ToString(dbret[0][2])
                                                , Convert.ToDouble(dbret[0][3]), Convert.ToString(dbret[0][4])
                                                , Convert.ToString(dbret[0][5]), Convert.ToString(dbret[0][6])
                                                , Convert.ToString(dbret[0][7]));

                ret.MemberList     = RetrieveProjectMembers(key);
                ret.TabList        = RetrieveProjectMesTable(key);
                ret.PNList         = RetrieveProjectPn(key);
                ret.StationList    = RetrieveProjectStation(key);
                ret.MDIDList       = RetrieveProjectModelID(key);
                ret.SumDatasetList = RetrieveProjectSumDataSet(key);
                return(ret);
            }
            else
            {
                return(null);
            }
        }
Beispiel #8
0
        public static Dictionary <string, bool> RetrieveSNBeforeDateWithStation(string projectkey, string edate, Cache mycache)
        {
            var ret = new Dictionary <string, bool>();
            //var sql = "select ModuleSerialNum,WhichTest from ProjectTestData where ProjectKey = '<ProjectKey>' and TestTimeStamp < '<ENDDATE>'";
            var sql = "select ModuleSerialNum,WhichTest from ProjectTestData where ProjectKey = '<ProjectKey>' and TestTimeStamp < '<ENDDATE>' and TestTimeStamp > '" + DateTime.Parse(edate).AddMonths(-6).ToString() + "' order by TestTimeStamp DESC";

            sql = sql.Replace("<ProjectKey>", projectkey).Replace("<ENDDATE>", edate);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, mycache);

            foreach (var item in dbret)
            {
                var key  = Convert.ToString(item[0]);
                var key2 = Convert.ToString(item[1]);
                if (!ret.ContainsKey(key + "-" + key2))
                {
                    ret.Add(key + "-" + key2, true);
                }
            }

            dbret.Clear();
            dbret = null;
            GC.Collect();
            GC.WaitForPendingFinalizers();

            return(ret);
        }
Beispiel #9
0
        public static string RetreiveUserGroup(string username, string grouptag)
        {
            var ret = string.Empty;

            var sql = "select GroupMember from UserGroupVM where GroupMember like '%<username>%' and GroupTag = '<GroupTag>'";

            sql = sql.Replace("<GroupTag>", grouptag).Replace("<username>", username.ToUpper());
            var dbret    = DBUtility.ExeLocalSqlWithRes(sql, null);
            var tempdict = new Dictionary <string, bool>();

            foreach (var line in dbret)
            {
                var groupmembers = Convert.ToString(line[0]).Split(new string[] { ";", "," }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var g in groupmembers)
                {
                    if (!tempdict.ContainsKey(g.Trim()))
                    {
                        tempdict.Add(g.Trim(), true);
                    }
                } //end foreach
            }     //end foreach

            foreach (var kv in tempdict)
            {
                ret = ret + ";" + kv.Key;
            }//end foreach

            return(ret);
        }
Beispiel #10
0
        public static List <UserCacheVM> RetrieveCacheInfo(string username)
        {
            var ret = new List <UserCacheVM>();

            var sql = "select top 10 UserName,CacheInfo,UpdateTime from UserCacheInfo where UserName = '******' order by UpdateTime DESC";

            sql = sql.Replace("<UserName>", username.ToUpper());
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                var tempinfo = new UserCacheVM();
                tempinfo.UserName = Convert.ToString(line[0]);

                string dummyData = Convert.ToString(line[1]).Trim().Replace(" ", "+");
                if (dummyData.Length % 4 > 0)
                {
                    dummyData = dummyData.PadRight(dummyData.Length + 4 - dummyData.Length % 4, '=');
                }

                var infobytes = Convert.FromBase64String(dummyData);
                tempinfo.CacheInfo  = System.Text.Encoding.UTF8.GetString(infobytes);
                tempinfo.UpdateTime = DateTime.Parse(Convert.ToString(line[2]));
                ret.Add(tempinfo);
            }

            return(ret);
        }
Beispiel #11
0
        public static List <ShareDocVM> RetrieveYesterdayDocs(Controller ctrl)
        {
            var    ret       = new List <ShareDocVM>();
            string tempdate  = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            var    starttime = tempdate + " 00:00:01";
            var    endtime   = tempdate + " 23:59:59";

            var sql = "select DOCPJK,DOCType,DOCKey,DOCTag,DOCCreator,DOCDate,DOCFavorTimes,APVal1,BackLink from ShareDoc where DOCDate >= '<starttime>' and DOCDate <= '<endtime>'";

            sql = sql.Replace("<starttime>", starttime).Replace("<endtime>", endtime);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                var tempvm = new ShareDocVM();
                tempvm.DOCPJK        = Convert.ToString(line[0]);
                tempvm.DOCType       = Convert.ToString(line[1]);
                tempvm.DOCKey        = Convert.ToString(line[2]);
                tempvm.DOCTag        = Convert.ToString(line[3]);
                tempvm.DOCCreator    = Convert.ToString(line[4]);
                tempvm.DOCDate       = DateTime.Parse(Convert.ToString(line[5]));
                tempvm.DOCFavorTimes = Convert.ToInt32(line[6]);
                tempvm.DocID         = Convert.ToString(line[7]);
                tempvm.BACKLink      = Convert.ToString(line[8]);

                if (string.Compare(tempvm.DOCType, ShareDocType.ISSUE, true) == 0)
                {
                    var issue = IssueViewModels.RetrieveIssueByIssueKey(tempvm.DOCKey, ctrl);
                    if (issue == null)
                    {
                        continue;
                    }

                    tempvm.Summary = issue.Summary;
                    tempvm.DocURL  = "/Issue/UpdateIssue?issuekey=" + tempvm.DOCKey;
                }
                else if (string.Compare(tempvm.DOCType, ShareDocType.DEBUG, true) == 0)
                {
                    var debugtree = ProjectErrorViewModels.RetrieveErrorByErrorKey(tempvm.DOCKey, ctrl);
                    tempvm.Summary = debugtree[0].ProjectKey + "-" + debugtree[0].OrignalCode;
                    tempvm.DocURL  = "/Project/UpdateProjectError?ErrorKey=" + tempvm.DOCKey;
                }
                else
                {
                    tempvm.Summary = tempvm.DOCKey;
                    //var tempstrs = tempvm.Summary.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
                    //var datestr = tempstrs[tempstrs.Length - 1].Substring(0, 8);
                    //tempvm.DocURL = "/userfiles/docs/" + datestr + "/" + tempvm.DOCKey;
                    tempvm.DocURL = "/User/WebDoc?DocKey=" + tempvm.DOCKey + "&Creator=" + tempvm.DOCCreator;
                }

                ret.Add(tempvm);
            }
            return(ret);
        }
Beispiel #12
0
        public static List <string> RetrieveShareTags()
        {
            var ret   = new List <string>();
            var sql   = "select DOCTag from ShareTags order by DOCTag ASC";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                ret.Add(Convert.ToString(line[0]));
            }
            return(ret);
        }
        public static List <string> RetrieveAllProjectKey()
        {
            var sql   = "select ProjectKey from Project order by ProjectKey ASC";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);
            var ret   = new List <string>();

            foreach (var line in dbret)
            {
                ret.Add(Convert.ToString(line[0]));
            }
            return(ret);
        }
Beispiel #14
0
        public static List <string> RetrieveAllSNWithNoJO()
        {
            var ret   = new List <string>();
            var sql   = "select distinct ModuleSerialNum from ProjectTestData where APPV1 = ''";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                ret.Add(Convert.ToString(item[0]));
            }
            return(ret);
        }
Beispiel #15
0
        private static string RetrieveUserProjectKeyStr(string username)
        {
            var sql = "select APVal1 from UserTable where UserName = N'<UserName>'";

            sql = sql.Replace("<UserName>", username.ToUpper());
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                return(Convert.ToString(dbret[0][0]));
            }
            return(string.Empty);
        }
Beispiel #16
0
        public static string RetrieveUserTag(string username)
        {
            var ret = string.Empty;
            var sql = "select UserName,APVal1,APVal2 from UserBlog where UserName='******' and APVal1 = '<APVal1>'";

            sql = sql.Replace("<UserName>", username).Replace("<APVal1>", UserBlogContentType.TAG);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                ret = Convert.ToString(dbret[0][2]);
            }
            return(ret);
        }
        public static void DeleteAttachment(string errorkey, string cond)
        {
            var csql = "select Attachment from PJErrorAttachment where ErrorKey = '<ErrorKey>' and Attachment like N'%<cond>%'";

            csql = csql.Replace("<ErrorKey>", errorkey).Replace("<cond>", cond);
            var cdbret = DBUtility.ExeLocalSqlWithRes(csql, null);

            if (cdbret.Count > 0 && cdbret.Count < 3)
            {
                csql = "delete from PJErrorAttachment where ErrorKey = '<ErrorKey>' and Attachment like N'%<cond>%'";
                csql = csql.Replace("<ErrorKey>", errorkey).Replace("<cond>", cond);
                DBUtility.ExeLocalSqlNoRes(csql);
            }//end if
        }
Beispiel #18
0
        public static List <string> RetrieveAllUser()
        {
            var sql   = "select UserName from UserTable";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);
            var ret   = new List <string>();

            foreach (var line in dbret)
            {
                ret.Add(Convert.ToString(line[0]));
            }

            ret.Sort();
            return(ret);
        }
Beispiel #19
0
        public static void StoreSameAsIssue(string originalissuekey, string sameasissuekey, string sameassn)
        {
            var sql = "select top 1 ErrorKey,LinkTime from SameAsDBTVM where OriginalIssueKey = '<OriginalIssueKey>' order by LinkTime DESC";

            sql = sql.Replace("<OriginalIssueKey>", originalissuekey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                var errorkey = Convert.ToString(dbret[0][0]);
                var linktime = Convert.ToString(dbret[0][1]);
                StoreLinkDBTIssue(errorkey, linktime, originalissuekey, sameasissuekey, sameassn);
            }
        }
Beispiel #20
0
        public static void UpdateNeoMAPFile(string filename)
        {
            var sql = "select AppV_A from FileLoadedData where AppV_A = N'<AppV_A>' and AppV_B=N'<AppV_B>'";

            sql = sql.Replace("<AppV_A>", filename).Replace("<AppV_B>", SYSLOADFILETYPE.NEOMAP);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count == 0)
            {
                sql = "insert into FileLoadedData(AppV_A,AppV_B) values(N'<AppV_A>',N'<AppV_B>')";
                sql = sql.Replace("<AppV_A>", filename).Replace("<AppV_B>", SYSLOADFILETYPE.NEOMAP);
                DBUtility.ExeLocalSqlNoRes(sql);
            }//end if
        }
Beispiel #21
0
        public static List <string> RetrieveProjectFailedDataID(string projectkey)
        {
            var ret = new List <string>();
            var sql = "select DataID from ProjectTestData where ProjectKey = '<ProjectKey>' and ErrAbbr <> 'PASS' order by ErrAbbr,TestTimeStamp DESC";

            sql = sql.Replace("<ProjectKey>", projectkey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                ret.Add(Convert.ToString(item[0]));
            }
            return(ret);
        }
Beispiel #22
0
        public static string RetrieveBackLink(string Dockey)
        {
            var sql = "select BackLink from ShareDoc where DOCKey=N'<DOCKey>'";

            sql = sql.Replace("<DOCKey>", Dockey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                var backlink = Convert.ToString(dbret[0][0]);
                return(backlink);
            }
            return(string.Empty);
        }
Beispiel #23
0
        public static List <string> RetrieveAllWafer(string projectkey)
        {
            var ret = new List <string>();
            var sql = "select DISTINCT Wafer from BITestData where ProjectKey = '<ProjectKey>' order by Wafer";

            sql = sql.Replace("<ProjectKey>", projectkey);

            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var item in dbret)
            {
                ret.Add(Convert.ToString(item[0]));
            }
            return(ret);
        }
        public void RetrieveAttachment(string errorkey)
        {
            var ret  = new List <string>();
            var csql = "select Attachment from PJErrorAttachment where ErrorKey = '<ErrorKey>' order by UpdateTime ASC";

            csql = csql.Replace("<ErrorKey>", errorkey);

            var cdbret = DBUtility.ExeLocalSqlWithRes(csql, null);

            foreach (var r in cdbret)
            {
                ret.Add(Convert.ToString(r[0]));
            }
            AttachList = ret;
        }
        public bool CheckExistProject()
        {
            var sql = "select * from Project where ProjectKey = '<ProjectKey>'";

            sql = sql.Replace("<ProjectKey>", ProjectKey);
            var ret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (ret.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private static List <ProjectStation> RetrieveProjectSumDataSet(string key)
        {
            var ret = new List <ProjectStation>();

            var sql = "select SumDataSet from ProjectSumDataSet where ProjectKey = '<ProjectKey>'";

            sql = sql.Replace("<ProjectKey>", key);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                var m = new ProjectStation(key, Convert.ToString(line[0]));
                ret.Add(m);
            }
            return(ret);
        }
Beispiel #27
0
        public static string RetrieveLatestTimeOfLocalProject(string projectkey)
        {
            var sql = "select top 1 TestTimeStamp from ProjectTestData where ProjectKey = '<ProjectKey>' order by TestTimeStamp DESC";

            sql = sql.Replace("<ProjectKey>", projectkey);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                return(Convert.ToString(dbret[0][0]));
            }
            else
            {
                return(null);
            }
        }
        public static ProjectExcept RetrieveProjectExcept(string ProjectKey, string ExceptType)
        {
            var ret = new ProjectExcept();
            var sql = "select ProjectKey,Exception,ExceptionType from ProjectException where ExceptionType='<ExceptType>'";

            sql = sql.Replace("<ExceptType>", ExceptType);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                ret.ProjectKey = Convert.ToString(line[0]);
                ret.Except     = Convert.ToString(line[1]);
                ret.ExceptType = Convert.ToString(line[2]);
            }
            return(ret);
        }
Beispiel #29
0
        public static int SameAsIssueCount(string errorkey, string linktime)
        {
            var sql = "select count(*) from SameAsDBTVM where ErrorKey = '<ErrorKey>' and LinkTime = '<LinkTime>'";

            sql = sql.Replace("<ErrorKey>", errorkey).Replace("<LinkTime>", linktime);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            if (dbret.Count > 0)
            {
                return(Convert.ToInt32(dbret[0][0]));
            }
            else
            {
                return(0);
            }
        }
Beispiel #30
0
        public static List <UserGroupVM> RetreiveAllGroup()
        {
            var ret   = new List <UserGroupVM>();
            var sql   = "select GroupID,GroupTag,GroupMember from UserGroupVM order by TimeStamp DESC";
            var dbret = DBUtility.ExeLocalSqlWithRes(sql, null);

            foreach (var line in dbret)
            {
                var tempgp = new UserGroupVM();
                tempgp.GroupID     = Convert.ToString(line[0]);
                tempgp.GroupTag    = Convert.ToString(line[1]);
                tempgp.GroupMember = Convert.ToString(line[2]);
                ret.Add(tempgp);
            }
            return(ret);
        }