コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            thisBookMark  = new IndexBLL().GetSingBook(Request.Url.LocalPath, LoginUserId);
            refreshMin    = Request.QueryString["refreshMin"];
            allTicketList = ticBll.GetAllTicket();
            countDic      = ticBll.GetServiceDeskCount();
            if (allTicketList != null && allTicketList.Count > 0)
            {
                classTickDic = allTicketList.GroupBy(_ =>
                {
                    long classId = 0; var acc = comBll.GetCompany(_.account_id);
                    if (acc != null)
                    {
                        classId = acc.classification_id ?? 0;
                    }
                    return(classId);
                }).OrderBy(_ => _.Key).ToDictionary(_ => _.Key, _ => _.ToList());
                productTickDic = allTicketList.GroupBy(_ =>
                {
                    long productId = 0;
                    if (_.installed_product_id != null)
                    {
                        var insPro = insProBll.GetById((long)_.installed_product_id);
                        if (insPro != null)
                        {
                            productId = insPro.product_id;
                        }
                    }
                    return(productId);
                }).OrderBy(_ => _.Key).ToDictionary(_ => _.Key, _ => _.ToList());
            }
            // {"row":8,"t1":"t","col1":"71,72","col2":"71,72,73"}
            var ticketLimtJson = "{\"row\":\"8\",\"t1\":\"t\",\"col1\":\"71,72\",\"col2\":\"71,72,73\"}";
            var ticketLimitSql = Convert.ToString(new DAL.sdk_task_dal().GetSingle($"select f_rpt_getsql_limit('{ticketLimtJson}',{LoginUserId.ToString()})"));
            var limitTicket    = new DAL.v_ticket_dal().FindListBySql("SELECT * from v_ticket t where t.type_id = 1809 " + ticketLimitSql);
            var resIdList      = ticBll.ReturnResIdsByTicket(limitTicket);

            if (resIdList != null && resIdList.Count > 0 && resList != null && resList.Count > 0)
            {
                limitResList = new List <sys_resource>();
                resIdList.ForEach(_ =>
                {
                    var thisRes = resList.FirstOrDefault(r => r.id.ToString() == _);
                    if (thisRes != null)
                    {
                        limitResList.Add(thisRes);
                    }
                });
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var  insProId = Request.QueryString["insProId"];
            long id       = 0;

            if (!string.IsNullOrEmpty(insProId) && long.TryParse(insProId, out id))
            {
                thisInsPro = insProBll.GetById(id);
            }
            if (thisInsPro == null)
            {
                Response.Write("<script>alert('未获取到相关配置项!');window.close();</script>");
                return;
            }
            noCloseTicket = new DAL.sdk_task_dal().GetNoDoneByInsPro(thisInsPro.id);
            thisProduct   = new ProductBLL().GetProduct(thisInsPro.product_id);
            wareList      = new DAL.ivt_warehouse_dal().GetAllWareList();
            if (thisInsPro.account_id != null)
            {
                thisAccount = new CompanyBLL().GetCompany((long)thisInsPro.account_id);
                contactList = new ContactBLL().GetContactByCompany((long)thisInsPro.account_id);
            }
            if (thisInsPro.contract_id != null)
            {
                thisContract = new ContractBLL().GetContract((long)thisInsPro.contract_id);
            }
            var thisSubAllList = new DAL.crm_subscription_dal().GetSubByInsProId(thisInsPro.id);

            thisSubList = new InstalledProductBLL().ReturnSubIds(thisSubAllList);
            if (thisSubList != null && thisSubList.Count > 0)
            {
                thisSubList.ForEach(_ => {
                    subNames += _.name + ',';
                });
                if (!string.IsNullOrEmpty(subNames))
                {
                    subNames = subNames.Substring(0, subNames.Length - 1);
                }
            }

            if (IsPostBack)
            {
                var result = new InstalledProductBLL().SwapConfigItem(GetParam(), LoginUserId);
                Response.Write($"<script>self.opener.location.reload();alert('替换{(result?"成功":"失败")}!');window.close();</script>");
            }
        }