コード例 #1
0
        private void InitForm()
        {
            Tools.SetDateTimeControl(this.StartTime);
            Tools.SetDateTimeControl(this.EndTime);

            List <DictInfo> dicts = null;

            //绑定仓库
            List <Orgaization> whList = BLLFactory.CreateBLL <OrgaizationManageBLL>().GetAllList();

            dicts = whList.Select(p => new DictInfo {
                ID = p.OrganID, Des = p.OrganDESC
            }).ToList <DictInfo>();
            Tools.BindDataToDDL(this.OrganID, dicts, "");

            CommonDropdown commonDropdown = new CommonDropdown();

            Tools.BindDataToDDL(this.DeviceType, commonDropdown.getInspectDeviceType(), "");

            //绑定监测项目
            List <InspectItemEntity> itemList  = BLLFactory.CreateBLL <InspectItemBLL>().GetAllItemInfo(new InspectItemEntity());
            List <DictInfo>          dictsItem = itemList.Select(p => new DictInfo {
                ID = p.ItemCode, Des = p.ItemName
            }).ToList <DictInfo>();

            Tools.BindDataToDDL(this.ItemCode, dictsItem, "");

            //绑定监测设备
            List <InspectDeviceEntity> deviceList  = BLLFactory.CreateBLL <InspectDeviceBLL>().GetAllItemInfo(new InspectDeviceEntity());
            List <DictInfo>            dictsDevice = deviceList.Select(p => new DictInfo {
                ID = p.DeviceCode, Des = p.DeviceName
            }).ToList <DictInfo>();

            Tools.BindDataToDDL(this.DeviceCode, dictsDevice, "");
        }
コード例 #2
0
        public ActionResult GetDnBAPIList(string Parameters)
        {
            int    credId  = 0;
            string apiType = string.Empty;

            if (Parameters != null)
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                apiType    = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 0, 1);
                credId     = Convert.ToInt32(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 1, 1));
            }
            SettingFacade fac = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
            List <ThirdPartyAPICredentialsEntity> lst = new List <ThirdPartyAPICredentialsEntity>();
            List <DnbAPIEntity> lstAPI = new List <DnbAPIEntity>();

            if (credId == 0)
            {
                lst = CommonDropdown.GetCredentials(this.CurrentClient.ApplicationDBConnectionString, ThirdPartyProvider.DNB.ToString(), apiType);
            }
            else
            {
                lstAPI = fac.GetDnBAPIList(apiType, credId);
            }
            if (lst.Count > 1)
            {
                lst.RemoveAt(0);
                lstAPI = fac.GetDnBAPIList(apiType, lst[0].CredentialId);
            }
            var result = new { data = lstAPI, data2 = lst };

            return(new JsonResult {
                Data = result
            });
        }
コード例 #3
0
        public ActionResult GetThirdPartyAPIType(string newAPIValue)
        {
            SelectList lst = CommonDropdown.GetAPITypeForThirdPartyAPICredentialsForEnrichment(this.CurrentClient.ApplicationDBConnectionString, newAPIValue);

            return(new JsonResult {
                Data = lst.Items
            });
        }
コード例 #4
0
        private void BindData()
        {
            InspectStatisticsBLL bll       = null;
            DataPage             dp        = new DataPage();
            InspectResultEntity  condition = new InspectResultEntity();

            try
            {
                bll = BLLFactory.CreateBLL <InspectStatisticsBLL>();
                condition.ItemCode   = this.ItemCode.Text;
                condition.DeviceCode = this.DeviceCode.Text;
                condition.StartTime  = this.StartTime.Text;
                condition.EndTime    = this.EndTime.Text;
                condition.OrganID    = this.OrganID.Text;
                condition.DeviceType = this.DeviceType.Text;
                condition.ResultType = this.ResultType.Text;

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <InspectResultEntity> list = dp.Result as List <InspectResultEntity>;

                CommonDropdown  resultTypeDropdown = new CommonDropdown();
                List <DictInfo> resultTypeList     = resultTypeDropdown.getInspectResultType();

                foreach (InspectResultEntity ide in list)
                {
                    foreach (DictInfo di in resultTypeList)
                    {
                        if (di.ID.Equals(ide.ResultType))
                        {
                            ide.ResultType = di.Des;
                            break;
                        }
                    }
                }

                this.GvList.DataSource = list;
                this.GvList.DataBind();

                //for (int i = 0; i < this.GvList.Rows.Count; i++)
                //{
                //    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["Id"].ToString());

                //    (this.GvList.Rows[i].Cells[6].Controls[0] as WebControl).Attributes.Add("onclick", click);
                //}
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        private void BindData()
        {
            InspectDeviceBLL    bll       = null;
            DataPage            dp        = new DataPage();
            InspectDeviceEntity condition = new InspectDeviceEntity();

            try
            {
                bll = BLLFactory.CreateBLL <InspectDeviceBLL>();
                condition.DeviceCode = this.DeviceCode.Text;
                condition.DeviceName = this.DeviceName.Text;
                condition.OrganID    = this.OrganID.Text;

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <InspectDeviceEntity> list = dp.Result as List <InspectDeviceEntity>;

                CommonDropdown  commonDropdown = new CommonDropdown();
                List <DictInfo> typeList       = commonDropdown.getInspectDeviceType();
                foreach (InspectDeviceEntity ide in list)
                {
                    var temp = typeList.Find(p => p.ID == ide.DeviceType);
                    if (temp != null && temp.Des != null)
                    {
                        ide.DeviceTypeName = temp.Des;
                    }
                }

                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["Id"].ToString());

                    (this.GvList.Rows[i].Cells[14].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        public ActionResult GetFieldsForThirdPartyEnrichment(string Parameters)
        {
            int Provider = 0;

            if (!string.IsNullOrEmpty(Parameters))
            {
                Provider = Convert.ToInt32(StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase));
            }
            SelectList            selectLists = CommonDropdown.GetFieldsForThirdPartyEnrichment(this.CurrentClient.ApplicationDBConnectionString, Provider.ToString());
            List <DropDownReturn> dropDown    = new List <DropDownReturn>();

            foreach (var item in selectLists)
            {
                dropDown.Add(new DropDownReturn {
                    Value = item.Value, Text = item.Text
                });
            }
            return(Json(dropDown, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        private void InitForm()
        {
            Tools.SetDateTimeControlFull(this.LastLoginTime);
            Tools.SetDateTimeControlFull(this.LastRegisterTime);

            List <DictInfo> dicts = null;

            //绑定仓库
            List <Orgaization> whList = BLLFactory.CreateBLL <OrgaizationManageBLL>().GetAllList();

            dicts = whList.Select(p => new DictInfo {
                ID = p.OrganID, Des = p.OrganDESC
            }).ToList <DictInfo>();
            Tools.BindDataToDDL(this.OrganID, dicts, "");


            CommonDropdown commonDropdown = new CommonDropdown();

            Tools.BindDataToDDL(this.DeviceType, commonDropdown.getInspectDeviceType(), "");
        }
コード例 #8
0
        private void InitForm()
        {
            //绑定仓设备类型
            CommonDropdown commonDropdown = new CommonDropdown();

            Tools.BindDataToDDL(this.DeviceType, commonDropdown.getInspectDeviceType(), "");

            //绑定监测项目
            List <InspectItemEntity> itemList  = new InspectItemBLL().GetAllItemInfo(new InspectItemEntity());
            List <DictInfo>          dictsItem = itemList.Select(p => new DictInfo {
                ID = p.ItemCode, Des = p.ItemName
            }).ToList <DictInfo>();

            Tools.BindDataToDDL(this.ItemCode, dictsItem, "");

            this.StartDate.Value     = DateTime.Now.ToString("yyyy-MM-01");
            this.EndDate.Value       = DateTime.Now.ToString("yyyy-MM-dd");
            this.StartDateShow.Value = DateTime.Now.ToString("yyyy年MM月01日");
            this.EndDateShow.Value   = DateTime.Now.ToString("yyyy年MM月dd日");
        }
コード例 #9
0
        public ActionResult ThirdPartyEnrichmentsIndex()
        {
            List <ThirdPartyEnrichmentsEntity> lstEnrichments = new List <ThirdPartyEnrichmentsEntity>();
            List <CVRefEntity> lstProviders = new List <CVRefEntity>();

            lstProviders = CommonDropdown.GetThirdPartyProviders(0, this.CurrentClient.ApplicationDBConnectionString);
            ViewBag.IsThirdPartyProvidersAvailable = lstProviders.Any();
            if (lstProviders.Any())
            {
                ThirdPartyEnrichmentsFacade fac = new ThirdPartyEnrichmentsFacade(this.CurrentClient.ApplicationDBConnectionString);
                lstEnrichments = fac.GetThirdPartyEnrichments();
            }
            // MP-1046 Create Individual URL redirection for all Tabs to make better format for URL
            if (Request.Headers["X-PJAX"] == "true")
            {
                return(PartialView(lstEnrichments));
            }
            else
            {
                ViewBag.SelectedTab           = "Data Enrichment";
                ViewBag.SelectedIndividualTab = "Third Party Enrichment";
                return(View("~/Views/DandB/Index.cshtml", lstEnrichments));
            }
        }
コード例 #10
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.ContentType     = "application/json";
            string ItemCode   = context.Request.QueryString["ItemCode"];
            string DeviceCode = context.Request.QueryString["DeviceCode"];
            string OrganID    = context.Request.QueryString["OrganID"];
            string DeviceType = context.Request.QueryString["DeviceType"];
            string ResultType = context.Request.QueryString["ResultType"];
            string StartTime  = context.Request.QueryString["StartTime"];

            InspectStatisticsEChartBLL bll         = BLLFactory.CreateBLL <InspectStatisticsEChartBLL>();
            InspectResultEntity        paramEntity = new InspectResultEntity();

            paramEntity.ResultType = ResultType;
            paramEntity.StartTime  = StartTime;
            paramEntity.ItemCode   = ItemCode;
            paramEntity.DeviceCode = DeviceCode;
            paramEntity.OrganID    = OrganID;
            paramEntity.DeviceType = DeviceType;

            List <InspectResultEntity> list = bll.GetList(paramEntity);

            CommonDropdown  deviceTypeDropdown = new CommonDropdown();
            List <DictInfo> deviceTypeList     = deviceTypeDropdown.getInspectDeviceType();

            CommonDropdown  resultTypeDropdown = new CommonDropdown();
            List <DictInfo> resultTypeList     = resultTypeDropdown.getInspectResultType();

            StringBuilder sb = new StringBuilder();

            if (list != null && list.Count > 0)
            {
                //记录项目种类列表
                List <string> legendList = new List <string>();
                legendList.Add("最大值");
                legendList.Add("最小值");
                legendList.Add("平均值");
                List <string> xList = new List <string>();
                foreach (InspectResultEntity ire in list)
                {
                    //统计X轴的时间列表
                    bool exist1 = false;
                    foreach (string ll in xList)
                    {
                        string temp = getStrByResultType(ire.InspectTime, ResultType);

                        if (temp == ll)
                        {
                            exist1 = true;
                            break;
                        }
                    }
                    if (!exist1)
                    {
                        xList.Add(getStrByResultType(ire.InspectTime, ResultType));
                    }
                }


                string echartTitle = "采集数据";
                echartTitle += resultTypeList.Find(p => p.ID == ResultType).Des;
                echartTitle += "变化";

                ///子标题
                string subText = StartTime;

                sb.Append(" {      ");
                sb.Append(" \"title\" : {     ");
                sb.Append("     \"text\": \"" + echartTitle + "\",     ");
                sb.Append("     \"subtext\": \"" + subText + "\"     ");
                sb.Append(" },     ");
                sb.Append(" \"tooltip\" : {     ");
                sb.Append("     \"trigger\": \"axis\"     ");
                sb.Append(" },     ");
                sb.Append(" \"legend\": {     ");
                string data  = "";
                int    index = 0;
                foreach (string d in legendList)
                {
                    data += ("\"" + d + "\"");
                    if (index < legendList.Count - 1)
                    {
                        data += ",";
                    }
                    index++;
                }
                sb.Append("     \"data\":[" + data + "]     ");
                sb.Append(" },     ");
                sb.Append(" \"toolbox\": {     ");
                sb.Append("     \"show\" : true,     ");
                sb.Append("     \"feature\" : {     ");
                sb.Append("        \"mark\" : {\"show\": true},     ");
                sb.Append("         \"magicType\" : {\"show\": true, \"type\": [\"line\", \"bar\"]},     ");
                sb.Append("         \"saveAsImage\" : {\"show\": true}     ");
                sb.Append("     }     ");
                sb.Append(" },     ");
                sb.Append(" \"calculable\" : \"true\",     ");
                sb.Append(" \"xAxis\" : [     ");
                sb.Append("     {     ");
                sb.Append("         \"type\" : \"category\",     ");
                sb.Append("         \"boundaryGap\" : \"false\",     ");

                string xdata  = "";
                int    xindex = 0;
                foreach (string d in xList)
                {
                    xdata += ("\"" + d + "\"");
                    if (xindex < xList.Count - 1)
                    {
                        xdata += ",";
                    }
                    xindex++;
                }

                sb.Append("         \"data\" : [" + xdata + "]     ");
                sb.Append("    }     ");
                sb.Append(" ],     ");
                sb.Append(" \"yAxis\" : [     ");
                sb.Append("     {     ");
                sb.Append("         \"type\" : \"value\"     ");
                sb.Append("     }     ");
                sb.Append(" ],     ");
                sb.Append(" \"series\" : [     ");

                int aa = 0;
                foreach (string d in legendList)
                {
                    string values = "";
                    int    kk     = 0;
                    foreach (InspectResultEntity ire in list)
                    {
                        if (d == "最大值")
                        {
                            values += ("\"" + ire.MaxDataValue + "\"");
                        }
                        else if (d == "最小值")
                        {
                            values += ("\"" + ire.MinDataValue + "\"");
                        }
                        else
                        {
                            values += ("\"" + ire.AvgValue + "\"");
                        }

                        if (kk < list.Count - 1)
                        {
                            values += ",";
                        }
                        kk++;
                    }

                    sb.Append(" {     ");
                    sb.Append("     \"name\":\"" + d + "\",     ");
                    sb.Append("     \"type\":\"line\",     ");
                    sb.Append("     \"data\":[" + values + "]     ");
                    //sb.Append("     \"markPoint\" : {     ");
                    //sb.Append("         \"data\" : [     ");
                    //sb.Append("             {\"type\" : \"max\", \"name\": \"最大值\"},     ");
                    //sb.Append("             {\"type\" : \"min\", \"name\": \"最小值\"}     ");
                    //sb.Append("         ]     ");
                    //sb.Append("    }       ");
                    sb.Append(" }     ");
                    if (aa < legendList.Count - 1)
                    {
                        sb.Append(",");
                    }
                    aa++;
                }


                //sb.Append(" {    ");
                //sb.Append(" \"name\":\"最低气温\",    ");
                //sb.Append(" \"type\":\"line\",    ");
                //sb.Append(" \"data\":[1, -2, 2, 5, 3, 2, 0],    ");
                //sb.Append(" \"markPoint\" : {    ");
                //sb.Append("     \"data\" : [    ");
                //sb.Append("         {\"name\" : \"周最低\", \"value\" : -2, \"xAxis\": 1, \"yAxis\": -1.5}    ");
                //sb.Append("     ]    ");
                //sb.Append(" },    ");
                //sb.Append(" \"markLine\" : {    ");
                //sb.Append("     \"data\" : [    ");
                //sb.Append("         {\"type\" : \"average\", \"name\" : \"平均值\"}    ");
                //sb.Append("     ]    ");
                //sb.Append(" }    ");
                //sb.Append(" }    ");
                sb.Append(" ]     ");
                sb.Append(" }     ");
            }

            context.Response.Write(sb.ToString());
        }