コード例 #1
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="entity">业务实体</param>
 public void Add(Accessory entity)
 {
     entity.As_CrtTime = DateTime.Now;
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     if (org != null)
     {
         entity.Org_ID   = org.Org_ID;
         entity.Org_Name = org.Org_Name;
     }
     //如果没有填写扩展名,则自动加上
     if (string.IsNullOrWhiteSpace(entity.As_Extension))
     {
         string extension = System.IO.Path.GetExtension(entity.As_FileName);
         if (entity.As_FileName.IndexOf(".") > -1)
         {
             extension = extension.Replace(".", "");
         }
         entity.As_Extension = extension;
     }
     Gateway.Default.Save <Accessory>(entity);
 }
コード例 #2
0
        public int Add(Task entity)
        {
            //添加对象,并设置排序号
            object obj = Gateway.Default.Max <Task>(Task._.Task_Tax, Task._.Task_Tax > -1);
            int    tax = 0;

            if (obj is int)
            {
                tax = (int)obj;
            }
            entity.Task_Tax   = tax + 1;
            entity.Task_State = "2";
            entity            = setEmployeeValue(entity);
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            if (org != null)
            {
                entity.Org_ID   = org.Org_ID;
                entity.Org_Name = org.Org_Name;
            }
            return(Gateway.Default.Save <Task>(entity));
        }
コード例 #3
0
ファイル: List.aspx.cs プロジェクト: zzti/LearningSystem
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            //所属教师
            Song.Entities.Teacher th = Extend.LoginState.Accounts.Teacher;
            //所属机构
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            //当前教师负责的课程
            List <Song.Entities.Course> cous = Business.Do <ICourse>().CourseAll(org.Org_ID, -1, th.Th_ID, null);

            foreach (Song.Entities.Course c in cous)
            {
                //课程图片
                if (!string.IsNullOrEmpty(c.Cou_LogoSmall) && c.Cou_LogoSmall.Trim() != "")
                {
                    c.Cou_LogoSmall = Upload.Get[_uppath].Virtual + c.Cou_LogoSmall;
                    c.Cou_Logo      = Upload.Get[_uppath].Virtual + c.Cou_Logo;
                }
            }
            rptCourse.DataSource = cous;
            rptCourse.DataBind();
        }
コード例 #4
0
        protected void ExcelInput1_OnInput(object sender, EventArgs e)
        {
            org = Business.Do <IOrganization>().OrganCurrent();
            //工作簿中的数据
            DataTable dt = ExcelInput1.SheetDataTable;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                try
                {
                    //throw new Exception();
                    //将数据逐行导入数据库
                    _inputData(dt.Rows[i]);
                }
                catch
                {
                    //如果出错,将错误行返回给控件
                    ExcelInput1.AddError(dt.Rows[i]);
                }
            }
        }
コード例 #5
0
        protected void btnSeo_Click(object sender, EventArgs e)
        {
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            if (org == null)
            {
                throw new WeiSha.Common.ExceptionForAlert("当前机构不存在");
            }
            org.Org_Keywords    = Org_Keywords.Text.Trim();
            org.Org_Description = Org_Description.Text.Trim();
            org.Org_Extracode   = Org_Extracode.Text.Trim();
            try
            {
                Business.Do <IOrganization>().OrganSave(org);

                this.Alert("操作成功!");
            }
            catch (Exception ex)
            {
                this.Alert(ex.Message);
            }
        }
コード例 #6
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(site))
            {
                return;
            }

            Song.Entities.Organization org = null;
            org = Business.Do <IOrganization>().OrganCurrent();
            Song.Entities.ShowPicture[] shows = Business.Do <IStyle>().ShowPicAll(null, site, org.Org_ID);
            string path = Upload.Get[_uppath].Virtual;

            foreach (Song.Entities.ShowPicture n in shows)
            {
                n.Shp_File = path + n.Shp_File;
            }
            //绑定
            GridView1.DataSource   = shows;
            GridView1.DataKeyNames = new string[] { "Shp_ID" };
            GridView1.DataBind();
        }
コード例 #7
0
 //下移
 protected void lbDown_Click(object sender, EventArgs e)
 {
     try
     {
         GridViewRow gr = (GridViewRow)((LinkButton)sender).Parent.Parent;
         int         id = Convert.ToInt32(this.GridView1.DataKeys[gr.RowIndex].Value);
         Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
         if (Business.Do <IContents>().DownloadOSDown(org.Org_ID, id))
         {
             BindData(null, null);
         }
         else
         {
             Alert("该项已经处于其所属分类的最底端,无法下移!");
         }
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
コード例 #8
0
        /// <summary>
        /// 添加章节
        /// </summary>
        /// <param name="entity">业务实体</param>
        public void OutlineAdd(Outline entity)
        {
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            if (org != null)
            {
                entity.Org_ID = org.Org_ID;
            }

            //计算排序号
            object obj = Gateway.Default.Max <Outline>(Outline._.Ol_Tax, Outline._.Cou_ID == entity.Cou_ID && Outline._.Ol_PID == entity.Ol_PID);

            entity.Ol_Tax = obj is int?(int)obj + 1 : 1;
            if (string.IsNullOrWhiteSpace(entity.Ol_UID))
            {
                entity.Ol_UID = WeiSha.Common.Request.UniqueID();
            }
            //层级
            entity.Ol_Level = _ClacLevel(entity);
            entity.Ol_XPath = _ClacXPath(entity);
            Gateway.Default.Save <Outline>(entity);
        }
コード例 #9
0
        //获取当前学科下的所有试卷
        protected void Page_Load(object sender, EventArgs e)
        {
            Song.Entities.Organization org  = Business.Do <IOrganization>().OrganCurrent();
            Song.Entities.Questions[]  ques = Business.Do <IQuestions>().QuesRandom(org.Org_ID, sbjid, -1, -1, type, diff, diff, true, 1);
            string tm = "";

            if (ques.Length > 0)
            {
                Song.Entities.Questions q = ques[0];
                q  = replaceText(q);
                tm = q.ToJson();
                //如果是单选题,或多选题
                if (q.Qus_Type == 1 || q.Qus_Type == 2 || q.Qus_Type == 5)
                {
                    tm = getAnserJson(q, tm);
                }
            }

            Response.Write(tm);
            Response.End();
        }
コード例 #10
0
ファイル: AlipayWeb.aspx.cs プロジェクト: zzti/LearningSystem
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEnter_Click(object sender, EventArgs e)
        {
            Song.Entities.PayInterface pi = id <= 0 ? new Song.Entities.PayInterface() : Business.Do <IPayInterface>().PaySingle(id);
            pi = this.EntityFill(pi) as Song.Entities.PayInterface;
            //支付方式
            pi.Pai_Pattern = Pai_Pattern.DdlInterFace.SelectedItem.Text;
            //自定义配置项
            WeiSha.Common.CustomConfig config = CustomConfig.Load(pi.Pai_Config);
            string privateKey = Regex.Replace(tbPrivatekey.Text.Trim(), @"\r|\n|\s", "", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace);

            config["Privatekey"].Text = privateKey;
            pi.Pai_Config             = config.XmlString;
            //所用的平台
            pi.Pai_Platform = "web";
            //支付的应用场景
            pi.Pai_Scene = scene;
            //只能根机构才可以设置支付接口(也就是说,钱全到根机构账上)
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganRoot();
            if (org != null)
            {
                pi.Org_ID = org.Org_ID;
            }
            try
            {
                if (id <= 0)
                {
                    Business.Do <IPayInterface>().PayAdd(pi);
                }
                else
                {
                    Business.Do <IPayInterface>().PaySave(pi);
                }

                Master.AlertCloseAndRefresh("操作成功!");
            }
            catch (Exception ex)
            {
                Master.Alert(ex.Message);
            }
        }
コード例 #11
0
        /// <summary>
        /// 生成js调用相关数据
        /// </summary>
        public string JsApiPayPage()
        {
            //检测是否给当前页面传递了相关参数
            if (total_fee <= 0)
            {
                Response.Write("<span style='color:#FF0000;font-size:20px'>" + "页面传参出错,请返回重试" + "</span>");
                WxPayAPI.Log.Error(this.GetType().ToString(), "交易资金小于等于0");
                return(null);
            }
            //若传递了相关参数,则调统一下单接口,获得后续相关接口的入口参数
            JsApiPay jsApiPay = new JsApiPay(this);

            jsApiPay.openid    = openid;
            jsApiPay.total_fee = total_fee;
            //JSAPI支付预处理
            try
            {
                //付款方信息
                string buyer = string.Empty;
                Song.Entities.Accounts acc = Extend.LoginState.Accounts.CurrentUser;
                if (acc != null)
                {
                    buyer = string.IsNullOrWhiteSpace(acc.Ac_MobiTel1) ? acc.Ac_AccName : acc.Ac_MobiTel1;
                }
                Song.Entities.Organization org = Business.Do <IOrganization>().OrganSingle(orgid);
                WxPayAPI.Log.Debug(this.GetType().ToString(), "回调域:" + notify_url);
                //统一下单
                WxPayData unifiedOrderResult = jsApiPay.GetUnifiedOrderResult("JSAPI", org.Org_PlatformName, serial, appid, mchid, paykey, notify_url, buyer);
                //获取H5调起JS API参数
                string wxJsApiParam = jsApiPay.GetJsApiParameters(paykey);// 用于前端js调用
                WxPayAPI.Log.Debug(this.GetType().ToString(), "获取H5调起JS API参数:" + wxJsApiParam);
                return(wxJsApiParam);
            }
            catch (Exception ex)
            {
                WxPayAPI.Log.Error(this.GetType().ToString(), "支付下单失败 : " + ex.Message);
                WxPayAPI.Log.Error(this.GetType().ToString(), "支付下单失败 : " + ex.StackTrace);
                return(null);
            }
        }
コード例 #12
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            //总记录数
            int count = 0;
            //学科,课程,章节
            int olid = 0;

            int.TryParse(ddlOutline.SelectedValue, out olid);
            //难易度
            int diff = Convert.ToInt32(ddlDiff.SelectedItem.Value);

            //试题类型
            int.TryParse(ddlType.SelectedValue, out type);
            //是否错误
            bool?isError = ddlErrorState.SelectedItem.Value == "-1" ? null : (bool?)(ddlErrorState.SelectedItem.Value == "2" ? true : false);
            //是否有人反馈错误
            bool?isWroing = ddlWrongState.SelectedItem.Value == "-1" ? null : (bool?)(ddlWrongState.SelectedItem.Value == "2" ? true : false);
            //是否启用
            bool?isUse = ddlUseState.SelectedItem.Value == "-1" ? null : (bool?)(ddlUseState.SelectedItem.Value == "1" ? true : false);

            Song.Entities.Questions[] eas = null;
            eas = Business.Do <IQuestions>().QuesPager(-1, type, -1, couid, olid, isUse, isError, isWroing, diff, this.tbSear.Text, Pager1.Size, Pager1.Index, out count);
            GridView1.DataSource = eas;
            //去除题干中的html标签
            string regexstr = @"(<[^>]*>)|\r|\n|\s";

            foreach (Song.Entities.Questions q in eas)
            {
                if (string.IsNullOrWhiteSpace(q.Qus_Title))
                {
                    continue;
                }
                q.Qus_Title = Regex.Replace(q.Qus_Title, regexstr, string.Empty, RegexOptions.IgnoreCase);
            }
            GridView1.DataKeyNames = new string[] { "Qus_ID" };
            GridView1.DataBind();
            Pager1.RecordAmount = count;
        }
コード例 #13
0
ファイル: ProductCom.cs プロジェクト: zzti/LearningSystem
        public int ProductAdd(Product entity)
        {
            //创建时间
            entity.Pd_CrtTime = DateTime.Now;
            Song.Entities.Columns nc = Business.Do <IColumns>().Single((int)entity.Col_Id);
            if (nc != null)
            {
                entity.Col_Name = nc.Col_Name;
            }
            //添加对象,并设置排序号
            object obj = Gateway.Default.Max <Product>(Product._.Pd_Tax, Product._.Col_Id == entity.Col_Id);

            entity.Pd_Tax = obj is int?(int)obj + 1 : 0;
            //所在机构
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            if (org != null)
            {
                entity.Org_ID   = org.Org_ID;
                entity.Org_Name = org.Org_Name;
            }
            return(Gateway.Default.Save <Product>(entity));
        }
コード例 #14
0
ファイル: NewsSetup.aspx.cs プロジェクト: zzti/LearningSystem
 /// <summary>
 /// 批量生成专题二维码
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSpecBuild_Click(object sender, EventArgs e)
 {
     try
     {
         btnSpecEnter_Click(null, null);
         //二维码的宽高
         int wh = Business.Do <ISystemPara>()["NewsSpec_QrCode_WidthAndHeight"].Int16 ?? 200;
         //二维码模板内容
         string template = Business.Do <ISystemPara>()["NewsSpec_QrCode_Template"].String;
         //所属机构的所有课程
         Song.Entities.Organization org      = Business.Do <IOrganization>().OrganCurrent();
         Song.Entities.Special[]    entities = Business.Do <IContents>().SpecialCount(org.Org_ID, null, null, 0);
         foreach (Song.Entities.Special entity in entities)
         {
             createSpecQrCode(entity, _uppath, template, wh);
         }
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
コード例 #15
0
        public Position GetAdmin(int orgid)
        {
            Song.Entities.Organization org = Gateway.Default.From <Organization>().Where(Organization._.Org_ID == orgid).ToFirst <Organization>();
            if (org == null)
            {
                throw new WeiSha.Common.ExceptionForWarning("ID为" + orgid + "的机构不存在!");
            }
            Position pos = Gateway.Default.From <Position>().Where(Position._.Posi_IsAdmin == true && Position._.Org_ID == orgid).ToFirst <Position>();

            if (pos == null)
            {
                pos = new Position();
                pos.Posi_IsAdmin = true;
                pos.Posi_IsUse   = true;
                pos.Posi_Name    = "管理员";
                pos.Org_Name     = org.Org_Name;
                pos.Org_ID       = orgid;
                Gateway.Default.Save <Position>(pos);
            }
            pos = Gateway.Default.From <Position>().Where(Position._.Posi_IsAdmin == true && Position._.Org_ID == orgid).ToFirst <Position>();
            return(pos);
        }
コード例 #16
0
 public int TeamAdd(Team entity)
 {
     entity.Team_CrtTime = DateTime.Now;
     //如果没有排序号,则自动计算
     if (entity.Team_Tax < 1)
     {
         object obj = Gateway.Default.Max <Team>(Team._.Team_Tax, Team._.Team_ID > -1);
         entity.Team_Tax = obj is int?(int)obj + 1 : 0;
     }
     Song.Entities.Depart dep = Gateway.Default.From <Depart>().Where(Depart._.Dep_Id == entity.Dep_ID).ToFirst <Depart>();
     if (dep != null)
     {
         entity.Dep_Name = dep.Dep_CnName;
     }
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     if (org != null)
     {
         entity.Org_ID   = org.Org_ID;
         entity.Org_Name = org.Org_Name;
     }
     return(Gateway.Default.Save <Team>(entity));
 }
コード例 #17
0
 /// <summary>
 /// 绑定列表
 /// </summary>
 protected void BindData(object sender, EventArgs e)
 {
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     //刷新模板信息
     WeiSha.Common.Template.RefreshTemplate();
     //web模板列表
     if (site == "web")
     {
         WeiSha.Common.Templates.TemplateBank[] tem = Business.Do <Song.ServiceInterfaces.ITemplate>().WebTemplates();
         WeiSha.Common.Template.ForWeb.SetCurrent(org.Org_Template);
         rtpTemplate.DataSource = tem;
         rtpTemplate.DataBind();
     }
     //手机模板列表
     if (site == "mobi")
     {
         WeiSha.Common.Templates.TemplateBank[] mobitm = Business.Do <Song.ServiceInterfaces.ITemplate>().MobiTemplates();
         WeiSha.Common.Template.ForMobile.SetCurrent(org.Org_TemplateMobi);
         rtpTempMobi.DataSource = mobitm;
         rtpTempMobi.DataBind();
     }
 }
コード例 #18
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">业务实体</param>
        public int ThemeAdd(Vote entity)
        {
            entity.Vt_CrtTime = DateTime.Now;
            entity.Vt_IsTheme = true;
            object obj = Gateway.Default.Max <Vote>(Vote._.Vt_Tax, Vote._.Vt_IsTheme == true);

            if (obj != DBNull.Value)
            {
                entity.Vt_Tax = Convert.ToInt32(obj) + 1;
            }
            else
            {
                entity.Vt_Tax = 1;
            }
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            if (org != null)
            {
                entity.Org_ID   = org.Org_ID;
                entity.Org_Name = org.Org_Name;
            }
            return(Gateway.Default.Save <Vote>(entity));
        }
コード例 #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.ServerVariables["REQUEST_METHOD"] == "GET")
            {
                org = Business.Do <IOrganization>().OrganCurrent();
                if (!this.IsPostBack)
                {
                    //当前学员的学习卡数量
                    int accid = Extend.LoginState.Accounts.UserID;
                    if (accid > 0)
                    {
                        cardcount = Business.Do <ILearningCard>().AccountCardOfCount(accid);
                        usecount  = cardcount - Business.Do <ILearningCard>().AccountCardOfCount(accid, 0);
                        //学员的学习卡
                        Song.Entities.LearningCard[] cards = Business.Do <ILearningCard>().AccountCards(accid);
                        rptCards.DataSource = cards;
                        rptCards.DataBind();
                    }
                }
            }
            //
            //此页面的ajax提交,全部采用了POST方式
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                string action = WeiSha.Common.Request.Form["action"].String;
                switch (action)
                {
                //使用学习卡
                case "useCode":
                    useCode(this.Context);
                    break;

                //领用学习卡
                case "getCode":
                    getCode(this.Context);
                    break;
                }
            }
        }
コード例 #20
0
        protected void ExcelInput1_OnInput(object sender, EventArgs e)
        {
            org = Business.Do <IOrganization>().OrganCurrent();
            //工作簿中的数据
            DataTable dt = ExcelInput1.SheetDataTable;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                try
                {
                    //将数据逐行导入数据库
                    _inputData(dt.Rows[i]);
                }
                catch
                {
                    //如果出错,将错误行返回给控件
                    ExcelInput1.AddError(dt.Rows[i]);
                }
            }
            Business.Do <IQuestions>().OnSave(null, EventArgs.Empty);
            Business.Do <IOutline>().OnSave(null, EventArgs.Empty);
        }
コード例 #21
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEnter_Click(object sender, EventArgs e)
        {
            Song.Entities.PayInterface pi = id <= 0 ? new Song.Entities.PayInterface() : Business.Do <IPayInterface>().PaySingle(id);
            pi = this.EntityFill(pi) as Song.Entities.PayInterface;
            //支付方式
            pi.Pai_Pattern = Pai_Pattern.DdlInterFace.SelectedItem.Text;
            //自定义配置项
            WeiSha.Common.CustomConfig config = CustomConfig.Load(pi.Pai_Config);
            config["MCHID"].Text  = tbMCHID.Text.Trim();    //商户id
            config["Paykey"].Text = tbPaykey.Text.Trim();   //支付密钥
            pi.Pai_Config         = config.XmlString;
            //所用的平台
            pi.Pai_Platform = "mobi";
            //支付的应用场景
            pi.Pai_Scene = scene;
            //只能根机构才可以设置支付接口(也就是说,钱全到根机构账上)
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganRoot();
            if (org != null)
            {
                pi.Org_ID = org.Org_ID;
            }
            try
            {
                if (id <= 0)
                {
                    Business.Do <IPayInterface>().PayAdd(pi);
                }
                else
                {
                    Business.Do <IPayInterface>().PaySave(pi);
                }

                Master.AlertCloseAndRefresh("操作成功!");
            }
            catch (Exception ex)
            {
                Master.Alert(ex.Message);
            }
        }
コード例 #22
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            try
            {
                //总记录数
                int count = 0;
                //当前选择的栏目id
                int col = Convert.ToInt16(ddlColumn.SelectedItem.Value);
                Song.Entities.Product[]    eas = null;
                Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
                eas = Business.Do <IContents>().ProductPager(org.Org_ID, col, this.tbSear.Text, true, Pager1.Size, Pager1.Index, out count);

                GridView1.DataSource   = eas;
                GridView1.DataKeyNames = new string[] { "Pd_id" };
                GridView1.DataBind();

                Pager1.RecordAmount = count;
            }
            catch (Exception ex)
            {
                Message.ExceptionShow(ex);
            }
        }
コード例 #23
0
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            try
            {
                //总记录数
                int count = 0;
                Song.Entities.Product[] eas = null;
                bool isNew = cbIsNew.Checked;
                bool isRec = cbIsRec.Checked;
                Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
                eas = Business.Do <IContents>().ProductPager(org.Org_ID, colid, this.tbSear.Text, false, null, isNew, isRec, "rec", Pager1.Size, Pager1.Index, out count);

                GridView1.DataSource   = eas;
                GridView1.DataKeyNames = new string[] { "Pd_id" };
                GridView1.DataBind();

                Pager1.RecordAmount = count;
            }
            catch (Exception ex)
            {
                Message.ExceptionShow(ex);
            }
        }
コード例 #24
0
        /// <summary>
        /// 课程选择项变更事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ddlCourse_SelectedIndexChanged(object sender, EventArgs e)
        {
            ddlOutline.Items.Clear();
            //课程id
            int cou;

            int.TryParse(ddlCourse.SelectedValue, out cou);
            if (cou > 0)
            {
                org = Business.Do <IOrganization>().OrganCurrent();
                Song.Entities.Outline[] outline = Business.Do <IOutline>().OutlineAll(cou, null);
                ddlOutline.DataSource          = outline;
                this.ddlOutline.DataTextField  = "Ol_Name";
                this.ddlOutline.DataValueField = "Ol_ID";
                ddlOutline.DataBind();
            }
            this.ddlOutline.Items.Insert(0, new ListItem("-章节-", "0"));
            //执行事件
            if (this.CourseChange != null)
            {
                this.CourseChange(null, null);
            }
        }
コード例 #25
0
        public void ProcessRequest(HttpContext context)
        {
            //机构信息
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
            //总记录数
            int count = 0;

            Song.Entities.Knowledge[] kn = Business.Do <IKnowledge>().KnowledgePager(org.Org_ID, -1, knsid, true, null, null, null, sear,
                                                                                     size, index, out count);
            string tm = "[";

            for (int i = 0; i < kn.Length; i++)
            {
                kn[i].Kn_Details = "";
                kn[i].Kn_Intro   = "";
                tm += "" + kn[i].ToJson() + ",";
                //if (i < kn.Length - 1) tm += ",";
            }
            tm += "{\"SumCount\":" + count + "}";
            tm += "]";
            context.Response.ContentType = "text/plain";
            context.Response.Write(tm);
        }
コード例 #26
0
        private void fill()
        {
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganSingle(id);
            if (org != null)
            {
                lbOrg.Text = org.Org_Name;
            }
            //根据公司id获取公司管理员信息。
            EmpAccount ea = Business.Do <IEmployee>().GetAdminByOrgId(id);

            if (ea != null)
            {
                tbAccName.Text = ea.Acc_AccName;
                tbName.Text    = ea.Acc_Name;
                tbMobile.Text  = ea.Acc_MobileTel;
                rbSex.Items.FindByValue(ea.Acc_Sex.ToString()).Selected = true;
                if ((DateTime.Now.Year - (int)ea.Acc_Age) < 1000)
                {
                    tbAge.Text = (DateTime.Now.Year - ea.Acc_Age).ToString();
                }
                tbIdCard.Text = ea.Acc_IDCardNumber;
            }
        }
コード例 #27
0
ファイル: GuideCom.cs プロジェクト: zzti/LearningSystem
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="entity">业务实体</param>
 public void GuideSave(Guide entity)
 {
     //最后编辑时间
     entity.Gu_LastTime = DateTime.Now;
     if (entity.Gu_PushTime < DateTime.Now.AddYears(-100))
     {
         entity.Gu_PushTime = entity.Gu_CrtTime;
     }
     //所在机构
     Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
     if (org != null)
     {
         entity.Org_ID   = org.Org_ID;
         entity.Org_Name = org.Org_Name;
     }
     //所属栏目
     Song.Entities.GuideColumns nc = this.ColumnsSingle((int)entity.Gc_ID);
     if (nc != null)
     {
         entity.Gc_Title = nc.Gc_Title;
     }
     Gateway.Default.Save <Guide>(entity);
 }
コード例 #28
0
        public object DataInfo(int orgid)
        {
            Song.Entities.Organization org = Business.Do <IOrganization>().OrganSingle(orgid);
            if (org == null)
            {
                org = Business.Do <IOrganization>().OrganCurrent();
            }
            //
            OrginDataInfo info = new OrginDataInfo();

            info.OrgName   = org.Org_Name;
            info.PlateName = org.Org_PlatformName;
            info.Subject   = Business.Do <ISubject>().SubjectOfCount(org.Org_ID, true, -1);
            info.Course    = Business.Do <ICourse>().CourseOfCount(org.Org_ID, -1, -1);
            info.Questions = Business.Do <IQuestions>().QuesOfCount(org.Org_ID, -1, -1, -1, -1, true);
            info.TestPaper = Business.Do <ITestPaper>().PagerOfCount(org.Org_ID, -1, -1, -1, true);
            info.Student   = Business.Do <IAccounts>().AccountsOfCount(org.Org_ID, null);
            info.Article   = Business.Do <IContents>().ArticleOfCount(org.Org_ID, -1);
            info.Teacher   = Business.Do <ITeacher>().TeacherOfCount(org.Org_ID, null);
            info.Knowledge = Business.Do <IKnowledge>().KnowledgeOfCount(org.Org_ID, -1, null);
            info.Notice    = Business.Do <INotice>().OfCount(org.Org_ID, null);
            return(info);
        }
コード例 #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Song.Entities.Accounts st = this.Master.Account;
     if (st == null)
     {
         return;
     }
     org   = Business.Do <IOrganization>().OrganCurrent();
     dtLog = Business.Do <IStudent>().StudentStudyCourseLog(org.Org_ID, this.Master.Account.Ac_ID);
     if (!this.IsPostBack)
     {
         BindData(null, null);
     }
     //此页面的ajax提交,全部采用了POST方式
     if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
     {
         string action = WeiSha.Common.Request.Form["action"].String.ToLower();
         string couid  = WeiSha.Common.Request.Form["couid"].String.ToLower();
         string json   = string.Empty;
         switch (action)
         {
         case "getstc":
             Song.Entities.Student_Course stc = GetStc(couid);
             if (stc == null)
             {
                 json = "{\"success\":\"0\"}";
             }
             else
             {
                 json = "{\"success\":\"1\",data:" + stc.ToJson() + "}";
             }
             break;
         }
         Response.Write(json);
         Response.End();
     }
 }
コード例 #30
0
 /// <summary>
 /// 栏目下拉绑定
 /// </summary>
 private void ddlColumnBind()
 {
     try
     {
         //栏目分类
         //所属机构的所有课程
         Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
         Song.Entities.Columns[]    nc  = Business.Do <IColumns>().ColumnCount(org.Org_ID, "product", true, -1);
         this.ddlColumn.DataSource     = nc;
         this.ddlColumn.DataTextField  = "Col_Name";
         this.ddlColumn.DataValueField = "Col_Id";
         this.ddlColumn.DataBind();
         //厂家
         this.ddlFactory.DataSource     = Business.Do <IProduct>().FactoryAll(true);
         this.ddlFactory.DataTextField  = "Pfact_Name";
         this.ddlFactory.DataValueField = "Pfact_Id";
         this.ddlFactory.DataBind();
         this.ddlFactory.Items.Insert(0, new ListItem("", "-1"));
         //产地
         this.ddlOrigin.DataSource     = Business.Do <IProduct>().OriginAll(true);
         this.ddlOrigin.DataTextField  = "Pori_Name";
         this.ddlOrigin.DataValueField = "Pori_Id";
         this.ddlOrigin.DataBind();
         this.ddlOrigin.Items.Insert(0, new ListItem("", "-1"));
         //材质
         this.ddlMaterial.DataSource     = Business.Do <IProduct>().MaterialAll(true);
         this.ddlMaterial.DataTextField  = "Pmat_Name";
         this.ddlMaterial.DataValueField = "Pmat_Id";
         this.ddlMaterial.DataBind();
         this.ddlMaterial.Items.Insert(0, new ListItem("", "-1"));
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }