Esempio n. 1
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(',');
             }
         }
     }
 }
Esempio n. 2
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("");
        }
Esempio n. 3
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]);
        }
Esempio n. 4
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("");
        }
Esempio n. 5
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());
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
        private void Baoming()
        {
            var name     = MW.Common.LYRequest.GetString("name");
            var mobile   = MW.Common.LYRequest.GetString("mobile");
            var email    = MW.Common.LYRequest.GetString("email");
            var area     = MW.Common.LYRequest.GetString("area");
            var code     = MW.Common.LYRequest.GetString("code");
            var planid   = MW.Common.LYRequest.GetString("planid");
            var courseid = MW.Common.LYRequest.GetString("courseid");
            //认证码检测
            bool flag = MW.BLL.B_tech_train_plan.VaildCardNumber(courseid, code);

            if (!flag)
            {
                base.Output(WapBase.MessageStatus.failure, "verification", "");
            }
            else
            {
                if (MW.BLL.B_mw_Applyplans.ExitPlan(base.CurrentUser.ID, planid))
                {
                    base.Output(WapBase.MessageStatus.failure, "exists", "");
                    return;
                }
                var model = new MW.Model.M_Mw_applyplans();
                model.ApplierID            = base.CurrentUser.ID;
                model.ApplyPlanID          = planid;
                model.ApplyCourseAetiology = code;
                model.ApplyTime            = DateTime.Now;
                model.Deleted       = 0;
                model.LastWriteTime = DateTime.Now;
                flag = new MW.BLL.B_mw_Applyplans().Add(model);
                if (flag)
                {
                    //报名成功提醒
                    if (mobile != "" && MW.Common.JValidate.IsMobileNum(mobile))
                    {
                        string smscontent = MW.BLL.B_Sendsms.GetTemplate("applyplan");
                        var    planmodel  = new B_tech_train_plan().GetModel(planid);
                        if (planmodel != null)
                        {
                            var courlmodel = new B_tech_train_course().GetModel(planmodel.TRAIN_ID);
                            smscontent = smscontent.Replace("{planname}", BaseUi.GetLang(courlmodel.NAME));
                            smscontent = smscontent.Replace("{begintime}", planmodel.YEAR_VALUE + " 第" + planmodel.PLAN_WEEK + "周");
                            smscontent = smscontent.Replace("{days}", courlmodel.DAYS);
                        }
                        else
                        {
                            smscontent = smscontent.Replace("{planname}", "");
                            smscontent = smscontent.Replace("{begintime}", "");
                            smscontent = smscontent.Replace("{days}", "");
                        }

                        smscontent = smscontent.Replace("{from}", MW.Common.Configs.GetConfigValue("sitename"));

                        MW.BLL.B_Sendsms.SendSMS(12, mobile, smscontent);
                    }
                    base.Output(WapBase.MessageStatus.success, "", "");
                }
                else
                {
                    base.Output(WapBase.MessageStatus.failure, "", "");
                }
            }
        }