コード例 #1
0
        public ResultMsg GetIEVersionCount(string version = null, string pageNum = null, string rowCount = null, string TimeStamp = "", string Sign = "", string supposedData = null)
        {
            string retCode = "failure";
            string retMsg  = "提交失败";

            try
            {
                if (TimeStamp == Sign || carfs.CARFSecurer.Program.GetEncrytedMessage("QADHOAEBPEUISDTAPJOPNGOERINRVF", TimeStamp) != Sign)
                {
                    retMsg = "签名错误";
                    throw new FormatException(retMsg);
                }
                else
                {
                }
                String connectionStr         = "Data Source=192.10.200.5;  Initial Catalog=syslog; User ID=" + dbUserNames["192.10.200.5"]["User ID"] + "; Password="******"192.10.200.5"]["Password"] + ";";
                RF.GlobalClass.DB.ConnDB cdb = new RF.GlobalClass.DB.ConnDB(connectionStr);
                DataSet ds = new DataSet();
                pageNum  = String.IsNullOrEmpty(pageNum) ? "1" : pageNum;
                rowCount = String.IsNullOrEmpty(rowCount) ? "10" : rowCount;
                int startRowNum = (int.Parse(pageNum) - 1) * int.Parse(rowCount) + 1;
                int endRowNum   = startRowNum + int.Parse(rowCount);
                try
                {
                    ds           = cdb.ReturnDataSet(@"
	                      SELECT Count(1) as count
	                      FROM [dbo].[IEVersionRecords]
	                      WHERE branch_store_code not like '[9SB]%' 
	                      AND status in (1,3) AND ie_version_id in ("     + version + @")");
                    supposedData = RF.GlobalClass.Utils.Convert.ObjectToJSON(ds.Tables[0]);
                    retCode      = "success";
                    retMsg       = "查询成功";
                }
                catch (Exception ex)
                {
                    retMsg = "查询失败" + ex.Message;
                }
                finally
                {
                    cdb.Close();
                }
            }
            catch (Exception ex)
            {
            }
            ResultMsg rm = new ResultMsg();

            rm.Obj       = supposedData;
            rm.RetCode   = retCode;
            rm.RetMsg    = retMsg;
            supposedData = @"[{""retCode"":""" + retCode + @""",""retMsg"":""" + retMsg + @""",""obj"":""" + supposedData.Replace("\"", "\"\"") + @"""}]" ?? @"[{""retCode"":""failure"",""retMsg"":""提交失败"",""obj"":""""}]";

            return(rm);
        }
コード例 #2
0
        public ResultMsg PrepareForIE8Downloading(string Code = null, string TimeStamp = "", string Sign = "", string supposedData = null)
        {
            string retCode = "failure";
            string retMsg  = "提交失败";

            Code = String.IsNullOrEmpty(Code) ? "1" : Code;
            try
            {
                if (TimeStamp == Sign || carfs.CARFSecurer.Program.GetEncrytedMessage("QADHOAEBPEUISDTAPJOPNGOERINRVF", TimeStamp) != Sign)
                {
                    retMsg = "签名错误";
                    throw new FormatException(retMsg);
                }
                else
                {
                }
                String connectionStr         = "Data Source=192.10.200.5;  Initial Catalog=syslog; User ID=" + dbUserNames["192.10.200.5"]["User ID"] + "; Password="******"192.10.200.5"]["Password"] + ";";
                RF.GlobalClass.DB.ConnDB cdb = new RF.GlobalClass.DB.ConnDB(connectionStr);
                DataSet ds = new DataSet();
                try
                {
                    ds           = cdb.ReturnDataSet(@"  UPDATE [syslog].[dbo].[IEVersionRecords]
                           SET [status] = 2
                         WHERE [branch_store_code] = N'" + Code + @"'");
                    supposedData = RF.GlobalClass.Utils.Convert.ObjectToJSON(ds.Tables[0]);
                    retCode      = "success";
                    retMsg       = "设置成功";
                }
                catch (Exception ex)
                {
                    retMsg = "设置失败" + ex.Message;
                }
                finally
                {
                    cdb.Close();
                }
            }
            catch (Exception ex)
            {
            }
            ResultMsg rm = new ResultMsg();

            rm.Obj       = supposedData;
            rm.RetCode   = retCode;
            rm.RetMsg    = retMsg;
            supposedData = @"[{""retCode"":""" + retCode + @""",""retMsg"":""" + retMsg + @""",""obj"":""" + supposedData.Replace("\"", "\"\"") + @"""}]" ?? @"[{""retCode"":""failure"",""retMsg"":""提交失败"",""obj"":""""}]";

            return(rm);
        }
コード例 #3
0
        public ResultMsg GetIEVersionList(string versionLevelFrom = null, string versionLevelTo = null, string pageNum = null, string rowCount = null, string TimeStamp = "", string Sign = "", string supposedData = null)
        {
            string retCode = "failure";
            string retMsg  = "提交失败";

            versionLevelFrom = String.IsNullOrEmpty(versionLevelFrom) ? "1" : versionLevelFrom;
            versionLevelTo   = String.IsNullOrEmpty(versionLevelTo) ? "11" : versionLevelTo;
            try
            {
                if (TimeStamp == Sign || carfs.CARFSecurer.Program.GetEncrytedMessage("QADHOAEBPEUISDTAPJOPNGOERINRVF", TimeStamp) != Sign)
                {
                    retMsg = "签名错误";
                    throw new FormatException(retMsg);
                }
                else
                {
                }
                String connectionStr         = "Data Source=192.10.200.5;  Initial Catalog=syslog; User ID=" + dbUserNames["192.10.200.5"]["User ID"] + "; Password="******"192.10.200.5"]["Password"] + ";";
                RF.GlobalClass.DB.ConnDB cdb = new RF.GlobalClass.DB.ConnDB(connectionStr);
                DataSet ds = new DataSet();
                pageNum  = String.IsNullOrEmpty(pageNum) ? "1" : pageNum;
                rowCount = String.IsNullOrEmpty(rowCount) ? "10" : rowCount;
                int startRowNum = (int.Parse(pageNum) - 1) * int.Parse(rowCount) + 1;
                int endRowNum   = startRowNum + int.Parse(rowCount);
                try
                {
                    ds           = cdb.ReturnDataSet(@"SELECT * FROM
                                                (SELECT TOP " + versionLevelTo + @"
                                                        [id]
                                                        ,[name]
                                                        ,ROW_NUMBER() OVER (ORDER BY id ASC) as row_num
                                                    FROM [dbo].[IEVersion]
                                                    WHERE  id >= " + versionLevelFrom + @"
                                                        AND id <= " + versionLevelTo + @" )
                                                as tmpT
                                                WHERE row_num BETWEEN " + startRowNum + @"
                                                AND " + endRowNum + @"");
                    supposedData = RF.GlobalClass.Utils.Convert.ObjectToJSON(ds.Tables[0]);
                    retCode      = "success";
                    retMsg       = "查询成功";
                }
                catch (Exception ex)
                {
                    retMsg = "查询失败" + ex.Message;
                }
                finally
                {
                    cdb.Close();
                }
            }
            catch (Exception ex)
            {
            }
            ResultMsg rm = new ResultMsg();

            rm.Obj       = supposedData;
            rm.RetCode   = retCode;
            rm.RetMsg    = retMsg;
            supposedData = @"[{""retCode"":""" + retCode + @""",""retMsg"":""" + retMsg + @""",""obj"":""" + supposedData.Replace("\"", "\"\"") + @"""}]" ?? @"[{""retCode"":""failure"",""retMsg"":""提交失败"",""obj"":""""}]";

            return(rm);
        }
コード例 #4
0
        public ResultMsg GetOldIEInfoList(string versionLevelFrom = null, string versionLevelTo = null, string pageNum = null, string rowCount = null, string TimeStamp = "", string Sign = "", string supposedData = null)
        {
            string retCode = "failure";
            string retMsg  = "提交失败";

            versionLevelFrom = String.IsNullOrEmpty(versionLevelFrom) ? "1" : versionLevelFrom;
            versionLevelTo   = String.IsNullOrEmpty(versionLevelTo) ? "8" : versionLevelTo;
            int recordsCount = 0;

            try
            {
                if (TimeStamp == Sign || carfs.CARFSecurer.Program.GetEncrytedMessage("QADHOAEBPEUISDTAPJOPNGOERINRVF", TimeStamp) != Sign)
                {
                    retMsg = "签名错误";
                    throw new FormatException(retMsg);
                }
                else
                {
                }
                String connectionStr         = "Data Source=192.10.200.5;  Initial Catalog=syslog; User ID=" + dbUserNames["192.10.200.5"]["User ID"] + "; Password="******"192.10.200.5"]["Password"] + ";";
                RF.GlobalClass.DB.ConnDB cdb = new RF.GlobalClass.DB.ConnDB(connectionStr);
                DataSet ds = new DataSet();
                pageNum  = String.IsNullOrEmpty(pageNum) ? "1" : pageNum;
                rowCount = String.IsNullOrEmpty(rowCount) ? "10" : rowCount;
                int startRowNum = (int.Parse(pageNum) - 1) * int.Parse(rowCount) + 1;
                int endRowNum   = startRowNum + int.Parse(rowCount);
                try
                {
                    //SELECT * FROM ( SELECT *,ROW_NUMBER() OVER(ORDER BY id asc) AS row_num
                    //FROM [dbo].[IEVersion] AS tmpa ) AS tmpb
                    //    WHERE row_num BETWEEN 2 AND 5
                    //                    ds = cdb.ReturnDataSet(@"SELECT * FROM
                    //                                                (SELECT TOP " + endRowNum + @"
                    //                                                         [id]
                    //                                                        ,[branch_store_code]
                    //                                                        ,[ie_version_id]
                    //                                                        ,[record_date_time]
                    //                                                        ,[status]
                    //                                                        ,ROW_NUMBER() OVER (ORDER BY ie_version_id ASC, record_date_time ASC) as row_num
                    //                                                    FROM [dbo].[IEVersionRecords]
                    //                                                    WHERE  status = 1 AND ie_version_id >= " + versionLevelFrom + @"
                    //                                                        AND ie_version_id <= " + versionLevelTo + @")
                    //                                                    as tmpT
                    //                                                WHERE row_num BETWEEN " + startRowNum + @"
                    //                                                AND " + endRowNum + @";
                    //                                            SELECT COUNT(1) FROM tmpT;
                    //                              ");
                    ds           = cdb.ReturnDataSet(@"SELECT 
                                        [id]
                                    ,[branch_store_code]
                                    ,[ie_version_id]
                                    ,[record_date_time]
                                    ,[status]
                                    ,ROW_NUMBER() OVER (ORDER BY ie_version_id ASC, record_date_time ASC) as row_num
                                FROM [dbo].[IEVersionRecords]
                                WHERE  status <> 0 AND ie_version_id >= " + versionLevelFrom + @"
                                    AND ie_version_id <= " + versionLevelTo + @";
                              ");
                    recordsCount = ds.Tables[0].AsEnumerable().Count();
                    // DataRow dr = ds.Tables[0].NewRow();
                    // DataTable dtT = ds.Tables[0].AsEnumerable().Where(o=> o.Field<int>("row_num") >= startRowNum).Where(o=> o.Field<int>("row_num") < endRowNum).AsDataView<DataRow>().Table;
                    IEnumerable <DataRow> query =
                        from a in ds.Tables[0].AsEnumerable()
                        where int.Parse(a["row_num"].ToString()) >= startRowNum && int.Parse(a["row_num"].ToString()) < endRowNum
                        select a;
                    supposedData = RF.GlobalClass.Utils.Convert.ObjectToJSON(query.CopyToDataTable <DataRow>());

                    retCode = "success";
                    retMsg  = "查询成功";
                }
                catch (Exception ex)
                {
                    retMsg = "查询失败" + ex.Message;
                }
                finally
                {
                    cdb.Close();
                }
            }
            catch (Exception ex)
            {
                retMsg = ex.Message;
            }
            ResultMsg rm = new ResultMsg();

            rm.RetCode = retCode;
            rm.RetMsg  = retMsg;
            rm.Obj     = supposedData;
            rm.Obj     = @"{Obj:""[{\""recordcount\"":" + recordsCount + @",\""pagecount\"":" + (recordsCount / int.Parse(rowCount) + ((recordsCount % int.Parse(rowCount)) == 0 ? 0 : 1)) + @",\""currentpage\"":" + pageNum + @"}]"", Objj:""" + supposedData.Replace("\"", "\\\"") + @"""}";

            // obj [{"recordcount":"432","pagecount":"87","currentpage":"1"}]
            // objj [{"dptid":"001     ","dptdes":"001 解放北路分场","adr1":"成都市解放路一段96、98、100、102号","tel":"83312293","prtdptid":"金牛1","prtdptid1":"金牛1","prtdz":"姚丽","jl":"200       ","ROWSTAT":null},{"dptid":"011     ","dptdes":"011 新鸿路40号分场","adr1":"成都市新鸿路36号","tel":"84333741","prtdptid":"成华区3","prtdptid1":"成华区3","prtdz":"何立琴","jl":"200       ","ROWSTAT":null},{"dptid":"018     ","dptdes":"018 肖家河分场","adr1":"成都高新区肖家河街38号","tel":"85161152","prtdptid":"高新区1","prtdptid1":"高新区1","prtdz":"洪霞","jl":"200       ","ROWSTAT":null},{"dptid":"019     ","dptdes":"019 九里堤中路分场","adr1":"成都市九里堤中路93-95号","tel":"87613201","prtdptid":"金牛1","prtdptid1":"金牛1","prtdz":"姚丽","jl":"200       ","ROWSTAT":null},{"dptid":"020     ","dptdes":"020 石人北路红旗24","adr1":"成都市青羊区石人北路3-5号1楼","tel":"87317268","prtdptid":"青羊区4","prtdptid1":"青羊区4","prtdz":"邓祖彪","jl":"200       ","ROWSTAT":null}]

            supposedData = @"[{""retCode"":""" + retCode + @""",""retMsg"":""" + retMsg + @""",""obj"":""" + supposedData.Replace("\"", "\"\"") + @"""}]" ?? @"[{""retCode"":""failure"",""retMsg"":""提交失败"",""obj"":""""}]";
            return(rm);
        }