Exemplo n.º 1
0
 private void Clear()
 {
     listPlane.Clear();
     ClearCurAttachPoints();
     selectedAttachPoint = null;
     frameImage.sprite   = null;
 }
Exemplo n.º 2
0
 private void LoadInit()
 {
     if (Id != "")
     {
         DataSet ds = new MW.BLL.B_tech_train_plan().GetList("ID='" + Id + "'");
         if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
         {
             DataView dv = ds.Tables[0].DefaultView;
             //DataTable tmptb = dv.ToTable(true, new string[] { "ID" });
             //DataRow rowdis = tmptb.Rows[0];
             DataRow row = ds.Tables[0].Rows[0];
             //dr["ID"] = row["ID"];
             txtPlanName.Text  = BaseUi.GetLang(row["NAME"].ToString());
             txtAddress.Text   = row["DAYS"].ToString();
             txtBeginTime.Text = row["YEAR_VALUE"] + " 第" + row["PLAN_WEEK"] + "周";
             rbltStatus.Text   = getstatus(row["STATUS"].ToString());
             dv.RowFilter      = " USER_TYPE='teacher' ";
             courseid          = row["TRAIN_ID"].ToString();
             var ts = dv.ToTable();
             {
                 var sb = new System.Text.StringBuilder();
                 foreach (DataRow item in ts.Rows) //因为所查询的名字可能有多行
                 {
                     sb.Append(item["UNAME"] + " ,");
                 }
                 txtTearcher.Text = sb.ToString().Trim(',');
             }
         }
     }
 }
Exemplo n.º 3
0
 public void ResetUiModelBackgroundDepth(BaseUi ui, int uiDepth)
 {
     if (ui != null && ui.modelBackground != null)
     {
         ui.modelBackground.depth = uiDepth - 1;
     }
 }
Exemplo n.º 4
0
    /// <summary>
    /// 通过名字显示ui
    /// </summary>
    /// <param name="typeName"></param>
    /// <param name="dataList"></param>
    /// <returns></returns>
    public BaseUi ShowByName(string typeName, params object[] dataList)
    {
        Type t = Type.GetType(typeName, false, true);

        // 检查cache
        BaseUi ui = UiCityPreloadManager.Instance.GetCacheUi(t);

        if (ui == null)
        {
            ui = UiRelations.Instance.GetUi(t);
        }
        else
        {
            // 在UiCityPreloadManager预加载的ui需要进行这一步
            ui.UiPanelName = typeName;
            InitUi(ui);
        }

        // 若没有cache, 根据名字load对应的prefab
        if (ui == null)
        {
            ui             = LoadUiPrefabByName(typeName);
            ui.UiPanelName = typeName;
            InitUi(ui);
        }

        return(Show(ui, ui.layer, dataList));
    }
Exemplo n.º 5
0
    /// <summary>
    /// 显示Ui, 以及关联Ui
    /// </summary>
    /// <param name="type"></param>
    /// <param name="layer"></param>
    /// <param name="dataList"></param>
    /// <returns></returns>
    private BaseUi Show(Type type, UiLayer layer = UiLayer.Normal, params object[] dataList)
    {
        HideMutex(type, layer);

        List <Type> linkedList = UiRelations.Instance.GetLinkedList(type);

        if (linkedList == null || linkedList.Count <= 0)
        {
            return(null);
        }
        BaseUi mainUi   = null;
        Type   tempType = linkedList[0];

        linkedList.RemoveAt(0);
        linkedList.Add(tempType);
        for (int i = 0; i < linkedList.Count; i++)
        {
            BaseUi ui = GetUiCreateWhenNotFind(linkedList[i]);
            if (ui != null)
            {
                if (ui.GetType() == type)
                {
                    if (layer != UiLayer.Normal)
                    {
                        ui.layer = layer;
                    }
                    mainUi = ui;
                }
                ui.Show(dataList);
            }
        }
        return(mainUi);
    }
Exemplo n.º 6
0
 public void AddCloseListener(string name, BaseUi panel, Action act)
 {
     m_PanelName = name;
     m_Panel     = panel;
     m_Action    = act;
     AddBtnListener();
 }
Exemplo n.º 7
0
 /// <summary>
 /// ui的销毁事件, 通过UiManager调用过来的
 /// </summary>
 /// <param name="ui"></param>
 public void OnDestroyUi(BaseUi ui)
 {
     if (ui != null)
     {
         autoDepth.Remove(autoDepth.GetUiPanel(ui));
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 销毁ui, 被BaseUi反向调用
 /// </summary>
 /// <param name="ui"></param>
 public void OnDestroyUi(BaseUi ui)
 {
     if (ui != null)
     {
         UiRelations.Instance.RemoveUi(ui);
         uiShell.OnDestroyUi(ui);
     }
 }
Exemplo n.º 9
0
 public UIPanel GetUiPanel(BaseUi ui)
 {
     if (ui != null)
     {
         return(ui.GetComponent <UIPanel>());
     }
     return(null);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 添加显示ui, 从BaseUi的显示方法里调用过来
 /// </summary>
 /// <param name="type"></param>
 /// <param name="ui"></param>
 public void AddShowingDic(Type type, BaseUi ui)
 {
     if (firstUiList.Contains(type) || showingUiDic.ContainsKey(type))
     {
         return;
     }
     showingList.Add(type);
     showingUiDic.Add(type, ui);
 }
Exemplo n.º 11
0
        private string loadTopMenu()
        {
            //Log.SetLog("BaseUi:" + BaseUi.roled + "=" + JSession.Get("roled") + " -uid:" + BaseUi.uid + "=" + JSession.Get("uid"));
            //Log.SetLog("loadLeft roled:" + BaseUi.roled);
            StringBuilder sb       = new StringBuilder();
            var           list     = MW.BLL.B_ecan_app.inance.GetMenus(BaseUi.roled.Split(','), BaseUi.homeurl);
            string        litmp    = "<li {0}><a href=\"{1}\">{2}</a></li>";
            var           pagename = MW.BLL.B_ecan_app.inance.GetlevelCode(LYRequest.GetPageName().ToLower());

            //Log.SetLog(pagename+"=="+LYRequest.GetPageName().ToLower());
            foreach (EcanMenus app in list)
            {
                //if(app.submenu==null||(app.submenu.Count==0&&app.menu.APP_CODE!="home")) continue;
                M_ecan_app mapp = null;
                if (app.menu.FUN_CODE != "")
                {
                    mapp = app.menu;
                }
                else
                {
                    foreach (var sub in app.submenu)
                    {
                        if (sub.submenus != null && sub.submenus.Count > 0)
                        {
                            mapp = sub;
                            break;
                        }
                        if (string.IsNullOrEmpty(sub.FUN_CODE))
                        {
                            continue;
                        }
                        mapp = sub;
                        break;
                    }
                }

                string url = GetAppUrl(mapp);
                if (pagename == "")
                {
                    pagename = levelCode;
                }
                else
                {
                    JCookie.WriteCookie("levelCode", pagename, 0.5);
                }

                string active = app.menu.LEVEL_CODE.Equals(pagename) ? "class=\"active\"" : "";
                if (url != "")
                {
                    sb.AppendFormat(litmp, active, url, BaseUi.GetLang(app.menu.APP_NAME));
                }
            }
            litTopMenu.Text = sb.ToString();
            //调用左边
            litLeftMenu.Text = loadLeftMenu(pagename);
            return("");
        }
Exemplo n.º 12
0
        private void BindData()
        {
            #region __________Where语句__________

            string strWhere = "  1=1";
            //strWhere += " and EndTime>='" + DateTime.Now + "' and BeginTime<='" + DateTime.Now + "'";
            if (typeid != "")
            {
                strWhere += " and PRO_TYPE='" + typeid + "'";
            }
            strWhere += " and ApplierID='" + (CurrentUser != null?CurrentUser.ID:"") + "' ";
            #endregion
            rpt_List.ShowPagenation = false;
            rpt_List.PageLink       = "";
            rpt_List.PageSize       = 100;
            rpt_List.CurrentPage    = LYRequest.GetInt("page", 1);

            /*SELECT p.`NAME`,p.DAYS,p.YEAR_VALUE,p.PLAN_WEEK,p.USER_TYPE,p.USER_ID,a.ApplyTime
             * FROM mw_applyplans AS a INNER JOIN mw_trainingplans AS p ON a.ApplyPlanID = p.ID
             * WHERE p.USER_TYPE = 'teacher'*/
            string table = "mw_applyplans AS a INNER JOIN mw_TrainingPlans AS p ON a.ApplyPlanID = p.ID";

            DataSet ds = MW.BLL.mw_getlistbypage.GetDataSet_NoCache(table, "p.ID,p.`NAME`,p.DAYS,p.YEAR_VALUE,p.PLAN_WEEK,p.USER_TYPE,p.UNAME,a.ApplyTime", strWhere, "", "ApplyTime DESC", "ID", rpt_List.CurrentPage, rpt_List.PageSize, 0);
            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                DataView dv = ds.Tables[0].DefaultView;
                dv.Sort = "ApplyTime desc";
                DataTable tmptb = dv.ToTable(true, new string[] { "ID", "NAME", "DAYS", "YEAR_VALUE", "PLAN_WEEK" });
                DataTable DT    = new DataTable();
                DT.Columns.Add("ID");
                DT.Columns.Add("PlanName");
                DT.Columns.Add("Teacher");
                DT.Columns.Add("BeginTime");
                DT.Columns.Add("days");
                foreach (DataRow row in tmptb.Rows)
                {
                    var dr = DT.NewRow();
                    dr["ID"]        = row["ID"];
                    dr["PlanName"]  = BaseUi.GetLang(row["NAME"].ToString());
                    dr["days"]      = row["DAYS"];
                    dr["BeginTime"] = row["YEAR_VALUE"] + " 第" + row["PLAN_WEEK"] + "周";
                    dv.RowFilter    = "(ID='" + row["ID"] + "' and USER_TYPE='teacher')";
                    var ts = dv.ToTable();
                    {
                        var sb = new System.Text.StringBuilder();
                        foreach (DataRow item in ts.Rows) //因为所查询的名字可能有多行
                        {
                            sb.Append(item["UNAME"] + " ,");
                        }
                        dr["Teacher"] = sb.ToString().Trim(',');
                    }
                    DT.Rows.Add(dr);
                }
                JBind.BindList(rpt_List, DT);
            }
            //rpt_List.RecordCount = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
        }
    public void DeactivateScreen <T>() where T : BaseUi
    {
        BaseUi screen = screens.Find(t => t.GetType().Name == typeof(T).Name);

        if (screen != null)
        {
            screen.DisableScreen();
        }
    }
Exemplo n.º 14
0
        protected string GetDmpurl()
        {
            string url = Configs.GetWebConfigSetting("dmpURL");

            if (url != "")
            {
                return("<li><a href=\"" + url + "?token=" + BaseUi.token + "\">" + BaseUi.GetLang("i18n.appname.dmp") + "</a></li>");
            }
            return("");
        }
Exemplo n.º 15
0
    public BaseUi Hide(Type type)
    {
        BaseUi ui = UiRelations.Instance.GetUi(type);

        if (ui != null)
        {
            ui.Hide();
        }
        return(ui);
    }
Exemplo n.º 16
0
    public bool GetIsShowing(string prefabName)
    {
        BaseUi ui = null;

        if (uiDic.TryGetValue(prefabName, out ui))
        {
            return(ui.IsShowing);
        }
        return(false);
    }
Exemplo n.º 17
0
        private string loadLeftMenu(string levescode)
        {
            StringBuilder sb   = new StringBuilder();
            var           list = MW.BLL.B_ecan_app.inance.GetMenus(BaseUi.roled.Split(','), BaseUi.homeurl).FirstOrDefault(e => e.menu.LEVEL_CODE == levescode);

            //Log.SetLog("list:" + (list == null) + " =" + levescode);
            if (list == null)
            {
                list = MW.BLL.B_ecan_app.inance.GetMenus(BaseUi.roled.Split(','), BaseUi.homeurl)[0];
            }
            if (list != null)
            {
                var sublist = list.submenu;
                //Log.SetSucLog("list.submenu:"+sublist.Count);
                var subCode = MW.BLL.B_ecan_app.inance.GetlevelCode(LYRequest.GetPageName(), 2);
                if (subCode == "")
                {
                    subCode = sublevelCode;
                }
                else
                {
                    JCookie.WriteCookie("sublevelCode", subCode, 0.5);
                }
                string litmp = "<li {0}><a href=\"{1}\">{2}</a></li>";
                foreach (M_ecan_app app in sublist)
                {
                    string active = app.LEVEL_CODE.Equals(subCode) ? "class=\"active\"" : "";
                    string url    = GetAppUrl(app);
                    //Log.SetSucLog("app.submenus:" + (app.submenus==null));
                    if (app.submenus != null && app.submenus.Count == 0)
                    {
                        //一级
                        sb.AppendFormat(litmp, active, url, BaseUi.GetLang(app.APP_NAME));
                    }
                    else
                    {
                        string        txt   = "<li class=\"subMenu\"><div>" + BaseUi.GetLang(app.APP_NAME) + "</div><ul class=\"listMenu\">";
                        StringBuilder sbsub = new StringBuilder();
                        foreach (M_ecan_app sub in app.submenus)
                        {
                            active = sub.LEVEL_CODE.Equals(subCode) ? "class=\"active\"" : "";
                            url    = BaseUi.CtxPath + "/techc/" + sub.APP_CODE + "/" + sub.FUN_CODE;
                            if (app.APP_NAME.Contains("mw."))
                            {
                                url = BaseUi.CtxPath + "/mw/" + sub.APP_CODE + "/" + sub.FUN_CODE;
                            }
                            sbsub.AppendFormat(litmp, active, url, BaseUi.GetLang(sub.APP_NAME));
                        }
                        sb.Append(txt).Append(sbsub.ToString()).Append("</ul></li>");
                    }
                }
                // Log.SetSucLog("left:"+sb.ToString());
            }
            return(sb.ToString());
        }
Exemplo n.º 18
0
 private Transform GetTheRoot(BaseUi baseUi)//获取ui的父节点
 {
     if (baseUi.uiType.UiRootType == E_UiRootType.KeepAbove)
     {
         return(keepAboveUIRot);
     }
     else
     {
         return(normalUIRoot);
     }
 }
Exemplo n.º 19
0
 /// <summary>
 /// ui prefab被创建后, 初始化
 /// </summary>
 /// <param name="ui"></param>
 private void InitUi(BaseUi ui)
 {
     if (ui != null)
     {
         UiRelations.Instance.AddUi(ui);
         ui.OnShow      = uiShell.OnShow;
         ui.OnHide      = uiShell.OnHide;
         ui.OnDestroyUi = OnDestroyUi;
         ui.RunInitialize();
     }
 }
Exemplo n.º 20
0
 /// <summary>
 /// 给UiPnlModelBackground添加点击事件
 /// </summary>
 /// <param name="ui"></param>
 private void AddClickEvent(BaseUi ui)
 {
     if (ui.model && ui.autoClickHide)
     {
         UiLayer layer                 = ui.layer;
         UiPnlModelBackground back     = ui.modelBackground.GetComponent <UiPnlModelBackground>();
         BoxCollider          collider = UiUtility.AddIfMissing <BoxCollider>(back.spriteBack.gameObject);
         collider.isTrigger = true;
         UIEventListener.Get(back.spriteBack.gameObject).onClick = go => ui.Hide();
         UiModelTool.ChangeTransformLayer(ui.modelBackground.gameObject, layer.ToString());
     }
 }
Exemplo n.º 21
0
 /// <summary>
 /// ui的隐藏事件, 通过BaseUi的隐藏方法调用过来的
 /// </summary>
 /// <param name="ui"></param>
 public void OnHide(BaseUi ui)
 {
     autoDepth.Remove(autoDepth.GetUiPanel(ui));
     if (ui.destroyOnClose)
     {
         ui.Destroy();
     }
     else
     {
         ui.gameObject.SetActive(false);
     }
 }
Exemplo n.º 22
0
    public bool NeedCache(BaseUi ui)
    {
        for (int i = 0; i < cityPreloadList.Count; i++)
        {
            if (ui == cityPreloadList[i].baseUi)
            {
                return(true);
            }
        }

        return(false);
    }
Exemplo n.º 23
0
    /// <summary>
    /// 跳转到目标界面
    /// </summary>
    /// <param name="uiRegisterName"></param>
    /// <param name="openArgs"></param>
    /// <param name="navArgs"></param>
    public static BaseUi Navigation2Ui(string uiRegisterName, List <string> openArgs, List <string> navArgs)
    {
        if (string.IsNullOrEmpty(uiRegisterName))
        {
            LoggerManager.Instance.Error("data error uiRegisterName is null");
            return(null);
        }

        Type t = Type.GetType(uiRegisterName, false, true);

#if UNITY_EDITOR
        if (t != null)
        {
            if (t.ToString() != uiRegisterName) // 防止大小写问题
            {
                LoggerManager.Instance.Info("try to get type for NavigationToUI, type : {0}", uiRegisterName);
                AssertHelper.Check(false, "can't get type of " + uiRegisterName);
                return(null);
            }
        }
        else
        {
            AssertHelper.AssertFalse(false, "数据配置错误", "跳转界面名=" + uiRegisterName + "不存在");
        }
#endif
        BaseUi ui = UiRelations.Instance.GetUi(t);
        if (ui == null || (!ui.IsShowing))
        {
            // 多人副本需要做更多的判断
            if (uiRegisterName.Equals(UiPrefabNames.UiPnlTeamDungeon))
            {
                if (DataModelManager.Instance.TeamDungeonInfo.IsInTeam)
                {
                    UiManager.Instance.ShowByName(UiPrefabNames.UiPnlTeamDungeonTeam);
                }
                else
                {
                    UiManager.Instance.ShowByName(UiPrefabNames.UiPnlTeamDungeon);
                }
            }
            else
            {
                ui = UiManager.Instance.ShowByName(uiRegisterName, openArgs.ToArray());
            }
        }

        if (ui != null && ui.IsShowing && navArgs != null && navArgs.Count > 0)
        {
            ui.MenuNavigation(navArgs);
        }

        return(ui);
    }
Exemplo n.º 24
0
 /// <summary>
 /// ui显示方法, 调用BaseUi的显示方法
 /// </summary>
 /// <param name="ui"></param>
 /// <param name="layer"></param>
 /// <param name="dataList"></param>
 /// <returns></returns>
 private BaseUi Show(BaseUi ui, UiLayer layer = UiLayer.Normal, params object[] dataList)
 {
     HideMutex(ui.GetType(), layer);
     if (ui != null)
     {
         if (layer != UiLayer.Normal)
         {
             ui.layer = layer;
         }
         ui.Show(dataList);
     }
     return(ui);
 }
Exemplo n.º 25
0
 /// <summary>
 /// 添加已创建的ui
 /// </summary>
 /// <param name="ui"></param>
 /// <returns></returns>
 public bool AddUi(BaseUi ui)
 {
     if (ui != null)
     {
         string key = ui.GetType().ToString();
         if (!uiDic.ContainsKey(key))
         {
             uiDic.Add(key, ui);
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 26
0
        private void StartCurGuidImp(int step)
        {
            if (step < 0)
            {
                return;
            }
            BaseUi          campsiteUI  = Global.gApp.gUiMgr.GetPanelCompent(Wndid.CampsiteUI);
            CampNewGuidBase campNewGuid = null;

            if (step == 0)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidOne>();
            }
            else if (step == 1)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidTwo>();
            }
            else if (step == 2)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidThree>();
            }
            else if (step == 3)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidFour>();
            }
            else if (step == 4)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidFive>();
            }
            else if (step == 5)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidSix>();
            }
            else if (step == 6)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidSeven>();
            }
            else if (step == 7)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidEight>();
            }
            else if (step == 8)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidNine>();
            }
            else if (step > 8 && step < 15)
            {
                campNewGuid = campsiteUI.gameObject.AddComponent <CampNewGuidTenToFifteen>();
            }
            campNewGuid.StartCampStep(step);
        }
Exemplo n.º 27
0
    /// <summary>
    /// 给Ui添加UiPnlModelBackground
    /// </summary>
    /// <param name="ui"></param>
    private void AddBackground(BaseUi ui)
    {
        if (ui.model && ui.modelBackground == null)
        {
            GameObject go = GameObjectUtility.CreateGameObject(UiPrefabNames.UiPnlModelBackground);
            go.SetActive(false);
            UiPnlModelBackground modelBackground = go.GetComponent <UiPnlModelBackground>();

            UiUtility.SetParent(modelBackground.gameObject, ui.gameObject);
            modelBackground.transform.SetAsFirstSibling();
            modelBackground.gameObject.SetActive(true);
            ui.modelBackground = modelBackground.GetComponent <UIPanel>();
        }
    }
Exemplo n.º 28
0
        private BaseUi JudgeShowUI(E_UIID uiid) //判断要显示的是哪个UI,返回现在显示的UI
        {
            //判断要显示的窗体是否正在显示,如果正在显示则不用处理
            if (dicShowUi.ContainsKey(uiid))
            {
                return(null);
            }
            BaseUi baseUi = GetGaseUI(uiid);

            if (baseUi == null)//判断需要显示的窗体是否加载过
            {
                //拿到UIID然后向UI路径字典取值
                string     path   = GameDefine.dicPath[uiid];
                GameObject loadUi = Resources.Load <GameObject>(path);
                if (loadUi != null)
                {
                    //路径正确,实例化窗体
                    GameObject willShowUI = Instantiate(loadUi);
                    baseUi = willShowUI.GetComponent <BaseUi>();
                    Type type = GameDefine.GetUiScriptType(uiid);
                    if (baseUi == null)
                    {
                        //说明窗体是没有挂载脚本,自动添加对应的UI脚本
                        baseUi = willShowUI.AddComponent(type) as BaseUi;
                    }
                    else
                    {
                        baseUi = willShowUI.GetComponent(type) as BaseUi;
                    }
                    Transform uiRoot = GetTheRoot(baseUi);
                    GameTool.AddChildToParent(uiRoot, willShowUI.transform);
                    //位置不正确,重设UI位置
                    willShowUI.GetComponent <RectTransform>().sizeDelta          = Vector2.zero;
                    willShowUI.GetComponent <RectTransform>().anchoredPosition3D = Vector3.zero;

                    //窗体第一次加载,把该窗体缓存到aicAllUi字典。
                    dicAllUi.Add(uiid, baseUi);
                }
                else
                {
                    Debug.Log("没有加载到" + uiid + "预制体");
                }
            }
            else
            {
                baseUi.ShowUI();
            }
            UpdateShowUiHedeUi(baseUi);
            return(baseUi);
        }
Exemplo n.º 29
0
        private void BindData()
        {
            #region __________Where语句__________

            string strWhere = "  1=1";
            //strWhere += " and EndTime>='" + DateTime.Now + "' and BeginTime<='" + DateTime.Now + "'";
            if (typeid != "")
            {
                strWhere += " and PRO_TYPE='" + typeid + "'";
            }
            #endregion
            rpt_List.ShowPagenation = false;
            rpt_List.PageLink       = "";
            rpt_List.PageSize       = 100;
            rpt_List.CurrentPage    = LYRequest.GetInt("page", 1);

            DataSet ds = MW.BLL.mw_getlistbypage.GetDataSet_NoCache("mw_TrainingPlans", "ID,NAME,DAYS,YEAR_VALUE,PLAN_WEEK,USER_TYPE,UNAME", strWhere, "", "YEAR_VALUE DESC,PLAN_WEEK DESC", "ID", rpt_List.CurrentPage, rpt_List.PageSize, 0);
            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                DataView  dv    = ds.Tables[0].DefaultView;
                DataTable tmptb = dv.ToTable(true, new string[] { "ID" });
                DataTable DT    = new DataTable();
                DT.Columns.Add("ID");
                DT.Columns.Add("PlanName");
                DT.Columns.Add("Teacher");
                DT.Columns.Add("BeginTime");
                DT.Columns.Add("days");
                foreach (DataRow rowt in tmptb.Rows)
                {
                    var     dr  = DT.NewRow();
                    DataRow row = ds.Tables[0].Select("ID='" + rowt["ID"] + "'")[0];
                    dr["ID"]        = row["ID"];
                    dr["PlanName"]  = BaseUi.GetLang(row["NAME"].ToString());
                    dr["days"]      = row["DAYS"];
                    dr["BeginTime"] = row["YEAR_VALUE"] + " 第" + row["PLAN_WEEK"] + "周";
                    dv.RowFilter    = "(ID='" + row["ID"] + "' and USER_TYPE='teacher')";
                    var ts = dv.ToTable();
                    {
                        var sb = new System.Text.StringBuilder();
                        foreach (DataRow item in ts.Rows) //因为所查询的名字可能有多行
                        {
                            sb.Append(item["UNAME"] + " ");
                        }
                        dr["Teacher"] = sb.ToString();
                    }
                    DT.Rows.Add(dr);
                }
                JBind.BindList(rpt_List, DT);
            }
        }
Exemplo n.º 30
0
    public BaseUi GetUiCreateWhenNotFind(Type type)
    {
        BaseUi ui = UiCityPreloadManager.Instance.GetCacheUi(type);

        if (ui != null)
        {
            return(ui);
        }
        ui = UiRelations.Instance.GetUi(type);
        if (ui == null)
        {
            return(Create(type));
        }
        return(ui);
    }