Ejemplo n.º 1
0
 protected void org_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     if (Session["Sp_Org_X"] == null)
         Response.Redirect("../VIP/机构.aspx");
     var json = Session["Sp_Org_X"].ToString();
     var list = JsonConvert.DeserializeObject<List<dynamic>>(json);
     org.DataSource = list;
 }
Ejemplo n.º 2
0
    protected void icons_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
    {
        var id = Guid.Parse(Request.QueryString["Id"]);
        var g = HomoryContext.Value.Group.First(o => o.Id == id);

        var dir = new DirectoryInfo(Server.MapPath("~/GroupIcon"));
        var files = dir.GetFiles("*.png").Select(o => "~/GroupIcon/" + o.Name).OrderBy(o => o).ToList();
        icons.DataSource = files;
    }
Ejemplo n.º 3
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var id = Guid.Parse(Request.QueryString[0]);
     var obj = HomoryContext.Value.ViewTeacher.Where(o => o.State < State.审核 && (o.Type == DepartmentUserType.部门主职教师 || o.Type == DepartmentUserType.借调后部门主职教师));
     var query = peek.Text;
     view.DataSource = string.IsNullOrWhiteSpace(query) ? obj.ToList() : obj.Where(
         o =>
             o.Account.Contains(query) || o.RealName.Contains(query) || (o.Email != null && o.Email.Contains(query)) ||
             (o.IDCard != null && o.IDCard.Contains(query))).ToList();
 }
Ejemplo n.º 4
0
        protected void gList_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            try
            {
                gList.DataSource = HomoryContext.Value.Group.Where(o => o.State < State.审核 && o.Type == GroupType.教研团队 && o.GroupUser.Count(p => p.Type == GroupUserType.创建者 && p.UserId == CurrentUser.Id && p.State < State.审核) > 0).OrderBy(o => o.Name).ToList();
                //gList.DataSource = HomoryContext.Value.Group.Where(o => o.State < State.审核 && o.Type == GroupType.教研团队).OrderBy(o => o.Name).ToList();
            }
            catch
            {

            }
        }
Ejemplo n.º 5
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var id = Guid.Parse(Request.QueryString[0]);
     var camId = CurrentCampus.Id;
     var obj = HomoryContext.Value.ViewTeacher.Where(o => o.State < State.审核 && o.TopDepartmentId == camId && (o.Type == DepartmentUserType.部门主职教师 || o.Type == DepartmentUserType.借调后部门主职教师));
     if (CurrentGroup.GroupUser.Count(o => o.GroupId == id && o.Type == GroupUserType.创建者 && o.State < State.审核) > 0)
     {
         var userId = CurrentGroup.GroupUser.First(o => o.GroupId == id && o.Type == GroupUserType.创建者 && o.State < State.审核).UserId;
         obj = obj.Where(o => o.Id != userId);
     }
     var query = peek.Text;
     view.DataSource = string.IsNullOrWhiteSpace(query) ? obj.ToList() : obj.Where(
         o =>
             o.Account.Contains(query) || o.RealName.Contains(query) || (o.Email != null && o.Email.Contains(query)) ||
             (o.IDCard != null && o.IDCard.Contains(query))).ToList();
 }
Ejemplo n.º 6
0
 protected void txtAdonsList_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
 }
Ejemplo n.º 7
0
        //protected void grdTabuladores_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    //GridDataItem item = (GridDataItem)grdTabuladores.SelectedItems[0];
        //    //int dataKey = int.Parse(item.GetDataKeyValue("ID_TABULADOR").ToString());
        //    ////if (dataKey != 0) {
        //    //    var vTabulador = nTabulador.ObtenerTabuladores(ID_TABULADOR: dataKey).FirstOrDefault();
        //    //    if (vTabulador.FG_MERCADO_SALARIAL.Equals(true))
        //    //        chbMercadoSalarial.Checked = true;
        //    //    else
        //    //        chbMercadoSalarial.Checked = false;
        //    //    if (vTabulador.FG_PLANEACION_INCREMENTOS.Equals(true))
        //    //        chbPlaneacionIncrementos.Checked = true;
        //    //    else
        //    //        chbPlaneacionIncrementos.Checked = false;
        //    //    if (vTabulador.FG_VALUACION_PUESTOS.Equals(true))
        //    //        chbValuacionPuestos.Checked = true;
        //    //    else
        //    //        chbValuacionPuestos.Checked = false;
        //    //    if (vTabulador.FG_TABULADOR_MAESTRO.Equals(true))
        //    //        chbTabuladorMaestro.Checked = true;
        //    //    else
        //    //        chbTabuladorMaestro.Checked = false;
        //    ////}
        //}

        protected void rlvConsultas_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            rlvConsultas.DataSource = nTabulador.ObtenerTabuladores();
        }
Ejemplo n.º 8
0
 void ImagesListView_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListViewDataItem item = ListViewAlbums.SelectedItems[0];
     int parentID = Convert.ToInt32(item.GetDataKeyValue("ID").ToString());
     labelAlbumName.Text = item.GetDataKeyValue("Name").ToString();
     ImagesListView.DataSource = from a in context.Images
                                 where a.AlbumID == parentID
                                 select a;
 }
Ejemplo n.º 9
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var value = "ObjectId".Query();
     if (value.None())
     {
         Response.Redirect("~/Depot/Home.aspx");
         return;
     }
     var objId = value.GlobalId();
     var obj = DataContext.DepotObject.Single(o => o.Id == objId);
     if (obj.Fixed)
     {
         var source = DataContext.DepotInX.Where(o => (o.AvailableAmount > 0) && o.ObjectId == obj.Id).ToList().Select(o => new Placed { Id = o.Id, Ordinal = o.Ordinal, Fixed = true, Place = o.Place, Code = o.Code }).OrderBy(o => o.Ordinal).ToList();
         if (obj.Single)
         {
             source = source.Where(o => o.Code == "Code".Query()).ToList();
         }
         view.DataSource = source;
     }
     else
     {
         var source = DataContext.DepotInX.Where(o => (o.AvailableAmount > 0) && o.ObjectId == obj.Id).OrderByDescending(o => o.AvailableAmount).ToList().Select(o => new Placed { Id = o.Id, Ordinal = 0, Fixed = false, Place = o.Place, Code = o.Code }).ToList();
         for (var i = 0; i < source.Count; i++)
         {
             source[i].Ordinal = i + 1;
         }
         if (obj.Single)
         {
             source = source.Where(o => o.Code == "Code".Query()).ToList();
         }
         view.DataSource = source;
     }
 }
Ejemplo n.º 10
0
 protected void RadListViewArticles_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListViewArticles.DataSource = Articles;
 }
Ejemplo n.º 11
0
 protected void publish_attachment_list_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var resource = CurrentResource;
     var files = HomoryContext.Value.Resource.Single(o => o.Id == resource.Id).ResourceAttachment.OrderBy(o => o.Id).ToList();
     publish_attachment_list.DataSource = files;
     pppp1.Visible = pppp2.Visible = HomoryContext.Value.Resource.Single(o => o.Id == resource.Id).ResourceAttachment.Count > 0;
 }
Ejemplo n.º 12
0
 protected void icons_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var dir = new DirectoryInfo(Server.MapPath("~/GroupIcon"));
     var files = dir.GetFiles("*.png").Select(o => "~/GroupIcon/" + o.Name).OrderBy(o => o).ToList();
     icons.DataSource = files;
 }
Ejemplo n.º 13
0
 protected void RadListView1_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListView1.DataSource = ImgList;
 }
Ejemplo n.º 14
0
        protected void secondList_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            Func<Catalog, bool> TreeWhere = o => o.Id == o.TopId && o.State < State.审核 && (o.Type == CatalogType.文章 || o.Type == CatalogType.视频 || o.Type == CatalogType.课件);

            if (VideoResource.Checked && !ArticleResource.Checked && !CoursewareResource.Checked)
            {
                TreeWhere = o => o.Id == o.TopId && o.State < State.审核 && o.Type == CatalogType.视频;
            }
            if (!VideoResource.Checked && ArticleResource.Checked && !CoursewareResource.Checked)
            {
                TreeWhere = o => o.Id == o.TopId && o.State < State.审核 && o.Type == CatalogType.文章;
            }
            if (!VideoResource.Checked && !ArticleResource.Checked && CoursewareResource.Checked)
            {
                TreeWhere = o => o.Id == o.TopId && o.State < State.审核 && o.Type == CatalogType.课件;
            }
            secondList.DataSource = HomoryContext.Value.Catalog.Where(TreeWhere).ToList();
        }
Ejemplo n.º 15
0
 protected void lvProd_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     lvProd.DataSource = Instances;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// NeedDataSource handler
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void RadListView1_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListView1.DataSource = ListDataSource;
 }
Ejemplo n.º 17
0
 protected void RadListViewArticles_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListViewArticles.DataSource = Articles;
 }
Ejemplo n.º 18
0
 protected void viewX_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     viewX.DataSource = HomoryContext.Value.Role.Where(o => o.State < State.审核).OrderBy(o => o.Ordinal).ToList();
 }
Ejemplo n.º 19
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     if (tree.SelectedNode != null && tree.SelectedNode.Level > 0)
     {
         view.Visible = true;
         if (tree.SelectedNode.Level == 1)
         {
             view.DataSource = HomoryContext.Value.Catalog.Where(o => o.State < State.审核 && o.Type == CatalogType.课程 && o.TopId == null && o.Name != "综合").OrderBy(o => o.State).ThenBy(o => o.Ordinal).ThenBy(o => o.Name).ToList();
         }
         else
         {
             view.DataSource = HomoryContext.Value.Catalog.Where(o => o.State < State.审核 && o.Type == CatalogType.课程 && o.TopId == Guid.Empty && o.Name != "综合").OrderBy(o => o.State).ThenBy(o => o.Ordinal).ThenBy(o => o.Name).ToList();
         }
     }
     else
     {
         view.DataSource = null;
     }
 }
Ejemplo n.º 20
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     try
     {
         view.DataSource = ActionStudents.Join(HomoryContext.Value.ViewStudent.Where(o => o.State < State.删除), o => o, o => o.Id, (a, b) => b).OrderBy(o => o.RealName).ToList();
     }
     catch
     {
         view.DataSource = null;
     }
 }
Ejemplo n.º 21
0
    protected void RadListView1_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
    {
        EFDal ed = new EFDal();
        int BolgeKodu = ed.kal_BolgeKoduDon(Context.User.Identity.Name);
        if (UserManager.Default.IsUserInRole(Context.User.Identity.Name, "labpers"))
        {
            using (Service1Client proxy = new Service1Client())
            {
                RadListView1.DataSource = proxy.PersonelIsDetayi((short)BolgeKodu, Context.User.Identity.Name);
                lblKayitSayisi.Text = proxy.PersonelIsDetayi((short)BolgeKodu, Context.User.Identity.Name).Count().ToString() + " adet kayıt bulundu";

                //RadListView1.DataBind();
            }
            //RadListView1.DataSource = ds;
            //RadListView1.DataBind();
            //lblKayitSayisi.Text = ds.Tables[0].Rows.Count.ToString() + " adet kayıt bulundu";
        }
        else if (UserManager.Default.IsUserInRole(Context.User.Identity.Name, "yon"))
        {
            using (Service1Client proxy = new Service1Client())
            {
                RadListView1.DataSource = proxy.BolgeyeAitIsDetayi((short)BolgeKodu);
                lblKayitSayisi.Text = proxy.BolgeyeAitIsDetayi((short)BolgeKodu).Count().ToString() + " adet kayıt bulundu";

                //RadListView1.DataBind();
            }
        }
    }
Ejemplo n.º 22
0
 protected void result_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     reBind(FindSourceTreeChecked());
 }
Ejemplo n.º 23
0
 protected void rlvMyListView_NeedDataSource(object source, RadListViewNeedDataSourceEventArgs e)
 {
     rlvMyListView.DataSource = Persons;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// NeedDataSource handler
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void RadListView1_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     RadListView1.DataSource = ListDataSource;
 }
Ejemplo n.º 25
0
        protected void assessTable_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            var path = Server.MapPath(CurrentResource.Preview);
            bool yes = false;
            if (File.Exists(path))
            {
                FileInfo info = new FileInfo(path);
                try
                {
                    var s = info.OpenWrite();
                    try
                    {
                        s.Close();
                    }
                    catch
                    {
                    }
                    yes = true;
                }
                catch
                {
                }
            }

            if (!yes)
            {
                return;
            }

            if (CurrentResource.GradeId.HasValue && CurrentResource.CourseId.HasValue)
            {
                assessPanel.Visible = true;
                var 课程 = CurrentResource.CourseId.Value;
                var 年级 = CurrentResource.GradeId.Value;
                if (HomoryContext.Value.AssessTable.Count(o => o.CourseId == 课程 && o.GradeId == 年级 && o.State == State.启用) > 0)
                {
                    var t =
                        HomoryContext.Value.AssessTable.First(o => o.CourseId == 课程 && o.GradeId == 年级 && o.State == State.启用);
                    var list = t.Content.FromJson<List<AssessItem>>();
                    var total = 0.0;
                    var ____c = CurrentResource.ResourceAssess.Count(
                            o => o.AssessTableId == t.Id && o.ResourceId == CurrentResource.Id);
                    var ras = CurrentResource.ResourceAssess.Where(
                            o => o.AssessTableId == t.Id && o.ResourceId == CurrentResource.Id)
                            .Select(o => o.Content)
                            .ToList()
                            .Select(o => o.FromJson<List<int>>())
                            .ToList();
                    for (int k = 0; k < list.Count; k++)
                    {
                        if (____c > 0)
                        {
                            total += ras.Average(p => p[k]);
                            list[k].All = string.Format("({0}/{1}分)", ras.Average(p => p[k]).ToString("F1"), list[k].Score.ToString("F1"));
                        }
                        else
                        {
                            list[k].All = string.Format("({0}/{1}分)", 0, list[k].Score.ToString("F1"));
                        }
                    }
                    sss.InnerText = string.Format("共{0}次评估,得分{1}分", ras.Count, total.ToString("F1"));

                    if (IsOnline)
                    {
                        if (CurrentResource.ResourceAssess.Count(o => o.UserId == CurrentUser.Id && o.AssessTableId == t.Id && o.ResourceId == CurrentResource.Id) > 0)
                        {
                            rr.Visible = false;
                            var ra = CurrentResource.ResourceAssess.First(o => o.UserId == CurrentUser.Id && o.AssessTableId == t.Id && o.ResourceId == CurrentResource.Id);
                            List<int> me = ra.Content.FromJson<List<int>>();
                            for (int i = 0; i < me.Count; i++)
                            {
                                list[i].Me = me[i];
                            }
                        }
                    }
                    assessTable.DataSource = list;
                }
                else
                {
                    assessPanel.Visible = false;
                }
            }
        }
Ejemplo n.º 26
0
 protected void RadListViewTags_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     aqufitEntities entities = new aqufitEntities();
     if (ProfileSettings == null)
     {
         ProfileSettings = UserSettings;
     }
     if (ProfileSettings != null)
     {
         Photo[] photos = entities.User2Photo.Where(p => p.UserSettingsKey == ProfileSettings.Id).OrderByDescending(p => p.Photo.Id).Select(p => p.Photo).OfType<Photo>().ToArray();
         RadListViewTags.DataSource = photos;
     }
 }
Ejemplo n.º 27
0
 protected void NeedDataSource(object o, RadListViewNeedDataSourceEventArgs e)
 {
     LoadData(false);
 }
Ejemplo n.º 28
0
 protected void publish_attachment_list_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     if (!IsOnline || CurrentUser.Resource.Count(o => o.State == State.审核 && o.Type == ResourceType && o.UserId == CurrentUser.Id) == 0)
         return;
     var resource = CurrentResource;
     var files = HomoryContext.Value.Resource.First(o => o.Id == resource.Id).ResourceAttachment.OrderBy(o => o.Id).ToList();
     publish_attachment_list.DataSource = files;
 }
Ejemplo n.º 29
0
 protected void result_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     reBind();
 }
Ejemplo n.º 30
0
 protected void result4_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var user = TargetUser;
     result4.DataSource = HomoryContext.Value.Resource.Where(o => o.Type == ResourceType.试卷 && o.UserId == user.Id && o.State == State.启用).OrderByDescending(o => o.Time).ToList();
 }
Ejemplo n.º 31
0
 protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     if (box.SelectedIndex < 0)
         return;
     view.DataSource = HomoryContext.Value.机构用户(Guid.Parse(box.SelectedValue)).OrderBy(o => o.用户部门).ToList();
 }
Ejemplo n.º 32
0
 protected void viewX_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var classId = treeX.SelectedNode == null || treeX.SelectedNode.Level != 2
         ? (Guid?)null
         : Guid.Parse(treeX.SelectedNode.Value);
     if (classId.HasValue)
     {
         var id = classId.Value;
         var pid = Guid.Parse(treeX.SelectedNode.ParentNode.Value);
         viewX.DataSource = HomoryContext.Value.ViewLearned.Where(o => o.DepartmentId == id || o.DepartmentId == pid).OrderBy(o => o.Ordinal).ToList();
         viewX.Visible = true;
     }
     else
     {
         viewX.DataSource = null;
         viewX.Visible = false;
     }
 }
Ejemplo n.º 33
0
        protected void view_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            var id = tree.SelectedNode == null ? (Guid?)null : Guid.Parse(tree.SelectedNode.Value);
            if (id == null)
                view.DataSource = null;
            else
            {
                var gid = id.Value;

                var source = HomoryContext.Value.ViewTeacher.Where(o => o.DepartmentId == gid && (o.Type == DepartmentUserType.借调后部门主职教师 || o.Type == DepartmentUserType.部门主职教师 || o.Type == DepartmentUserType.部门兼职教师) && o.State == State.启用);
                var text = peek.Text.Trim();
                var ds = source.Where(o => o.RealName.Contains(text) || o.PinYin.Contains(text) || o.Phone.Contains(text) || o.IDCard.Contains(text)).ToList();
                view.DataSource = ds;
            }
        }
Ejemplo n.º 34
0
 protected void view_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var departmentId = tree.SelectedNode == null || tree.SelectedNode.Level == 0 ? (Guid?)null : Guid.Parse(tree.SelectedNode.Value);
     var list = departmentId.HasValue
         ? HomoryContext.Value.ViewTeacher.Where(o => o.DepartmentId == departmentId && o.Type == DepartmentUserType.部门主职教师)
             .OrderBy(o => o.State)
             .ThenBy(o => o.PriorOrdinal)
             .ToList()
         : null;
     var stext = peek.Text.Trim();
     view.DataSource = list == null ? null : list.Where(o => o.Account.Contains(stext) || o.RealName.Contains(stext) || o.PinYin.Contains(stext) || o.Phone.Contains(stext) || o.IDCard.Contains(stext)).ToList();
 }
Ejemplo n.º 35
0
 protected void view_OnNeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     var node = tree.SelectedNode;
     if (node != null)
     {
         var id = Guid.Parse(node.Value);
         var topId = HomoryContext.Value.Department.First(o => o.Id == id).TopId;
         var source =
             HomoryContext.Value.ViewTeacher.Where(
                 o => o.TopDepartmentId == topId && o.Type == DepartmentUserType.部门主职教师 && o.State == State.启用);
         var text = peek.Text.Trim();
         var ds = source.Where(o => o.RealName.Contains(text) || o.Phone.Contains(text) || o.IDCard.Contains(text) || o.PinYin.Contains(text)).ToList();
         view.DataSource = ds;
     }
 }
Ejemplo n.º 36
0
 protected void txtOptions_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
 {
     BindOptions();
 }