コード例 #1
0
 public static void EditGroup(Group Group)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
       container.AttachTo("Groups", Group);
       container.UpdateObject(Group);
       var serviceResponse = container.SaveChanges();
 }
コード例 #2
0
 public static void DeleteGroupItem(GroupItem GroupItem)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
       container.AttachTo("GroupItems", GroupItem);
       container.DeleteObject(GroupItem);
       var serviceResponse = container.SaveChanges();
 }
コード例 #3
0
 public static void EditOptionSetEntity(OptionSetEntity OptionSetEntity)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
       container.AttachTo("OptionSetEntities",OptionSetEntity);
       container.UpdateObject(OptionSetEntity);
       var serviceResponse = container.SaveChanges();
 }
コード例 #4
0
        public static GroupItem GetGroupItem(int GroupItemId)
        {
            BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));

            var result = container.GroupItems.Where(prod => prod.Id == GroupItemId).SingleOrDefault();
            return result;
        }
コード例 #5
0
 public static void DeleteOptionSets(OptionSet OptionSets)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
       container.AttachTo("OptionSets", OptionSets);
       container.DeleteObject(OptionSets);
       var serviceResponse = container.SaveChanges();
 }
コード例 #6
0
 public static IEnumerable<GroupItem> GetGroupItems(int groupid = 0)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     if (groupid == 0)
         return container.GroupItems.Expand("Group").Expand("GroupItemType").Expand("OptionSetEntity").ToList();
     else
         return container.GroupItems.Expand("Group").Expand("GroupItemType").Expand("OptionSetEntity").Where(os => os.GroupId == groupid).ToList();
 }
コード例 #7
0
 public static OptionSet GetOptionSet(int OptionsetId)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     //var result = container.OptionSets.Where(prod => prod.Id == OptionsetId).SingleOrDefault();
     //var result = (from optionset in container.OptionSets where optionset.Id == OptionsetId select optionset).ToList();
     var result = container.OptionSets.Where(prod => prod.Id == OptionsetId).SingleOrDefault() ;
     return result;
 }
コード例 #8
0
        public static IEnumerable<OptionSet> GetOptionSets(int OptionSetEntityId=0)
        {
            BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
             if (OptionSetEntityId == 0)

                 return container.OptionSets.Expand("OptionSetEntity").ToList();
            else
               return container.OptionSets.Expand("OptionSetEntity").Where(os => os.OptionSetEntityId == OptionSetEntityId).ToList();
        }
コード例 #9
0
        public static async Task<List<BaseTable>> GetAllTables()
        {
            BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
            // Error in Odata Client https://odata.codeplex.com/workitem/29
            //  return container.GetAllTables().Cast<BaseTable>();


            var result = await DirectOdataWebApi.ExecuteSample("getall database tables ",
             Serviceurl + "GetAllTables");

           return result;
        }
コード例 #10
0
        public static void EditOptionSets(OptionSet OptionSets)
        {
            DataServiceResponse serviceResponse = null;
              try
              {
              BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
              OptionSets.OptionSetEntity = OptionSetEntityRepository.GetOptionSetEntity(OptionSets.OptionSetEntityId);
              container.AttachTo("OptionSets", OptionSets);
              container.UpdateObject(OptionSets);
                serviceResponse = container.SaveChanges();
              }
              catch (DataServiceRequestException exp)
              {

              }
        }
コード例 #11
0
        public static void AddGroupItem(GroupItem GroupItem)
        {
            DataServiceResponse serviceResponse = null;
              try
              {

            BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));

              container.AddToGroupItems(GroupItem);
              serviceResponse = container.SaveChanges();
              }
              catch (DataServiceRequestException exp)
              {

              }
        }
コード例 #12
0
        public static void EditGroupItem(GroupItem GroupItem)
        {
            DataServiceResponse serviceResponse = null;
              try
              {
              BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));

              container.AttachTo("GroupItems", GroupItem);
              container.UpdateObject(GroupItem);
                serviceResponse = container.SaveChanges();
              }
              catch (DataServiceRequestException exp)
              {

              }
        }
コード例 #13
0
 public static void AddGroup( Group Group)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     container.AddToGroups(Group);
     var serviceResponse = container.SaveChanges();
 }
コード例 #14
0
 public ActionResult Index()
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri("http://localhost:9129/odata/"));
      var result=   container.GetAllTables();
     return View();
 }
コード例 #15
0
 public static OptionSetEntity GetOptionSetEntity(int Id)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.OptionSetEntities.Where(prod => prod.Id == Id).SingleOrDefault();
 }
コード例 #16
0
 public static IEnumerable<OptionSetEntity> GetOptionSetEntity()
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.OptionSetEntities;
 }
コード例 #17
0
 public static IEnumerable<OptionSetEntity> GetActiveOptionSetEntity()
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.OptionSetEntities.Where(os=> os.Active==true).ToList ();
 }
コード例 #18
0
 public static IEnumerable<Group> GetActiveGroup()
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.Groups.Where(os => os.Active == true).ToList();
 }
コード例 #19
0
 public static void AddOptionSetEntity( OptionSetEntity OptionSetEntity)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     container.AddToOptionSetEntities(OptionSetEntity);
     var serviceResponse = container.SaveChanges();
 }
コード例 #20
0
 public static IEnumerable<Group> GetGroup()
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.Groups;
 }
コード例 #21
0
 public static Group GetGroup(int Id)
 {
     BackOffice.Models.ODataClient.Default.Container container = new BackOffice.Models.ODataClient.Default.Container(new Uri(Serviceurl));
     return container.Groups.Where(prod => prod.Id == Id).SingleOrDefault();
 }