Example #1
0
        public bool DeleteUptake(UptakeGeography ut)
        {
            Organization org = Organization.FromIdentity(ut.OrgId);

            org.DeleteUptakeGeography(ut.GeoId);

            return(true);
        }
Example #2
0
        public bool AddUptake(UptakeGeography ut)
        {
            Organization org = Organization.FromIdentity(ut.OrgId);

            org.AddUptakeGeography(ut.GeoId);

            // Return true if precisely one row was inserted, otherwise false
            return(true);
        }
Example #3
0
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////

        private static UptakeGeography[] UptakeFromArray(Structure.UptakeGeography[] inputArray)
        {
            List <UptakeGeography> retlist = new List <UptakeGeography>();

            foreach (Structure.UptakeGeography up in inputArray)
            {
                retlist.Add(UptakeGeography.fromUptake(up));
            }
            return(retlist.ToArray());
        }
Example #4
0
 protected void GridViewOtherUptakes_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         UptakeGeography bu  = ((UptakeGeography)e.Row.DataItem);
         Organization    org = Organization.FromIdentity(bu.OrgId);
         if (org.AnchorGeographyId == bu.GeoId)
         {
             e.Row.Cells[4].Text = "Anchor";
         }
         else if (!_authority.HasPermission(Permission.CanEditOrg, bu.OrgId, -1, Authorization.Flag.Default))
         {
             e.Row.Cells[4].Text = "No Access";
         }
         else
         {
             LinkButton deletebtn = e.Row.FindControl("lnkDelete") as LinkButton;
             string     jscript   = GetLocalResourceObject("ConfimDeleteUptakeJS").ToString();
             //return confirm('Do you really want to remove {0} as uptake area for {1}?');
             jscript = string.Format(jscript, bu.Geography.Name, bu.Organization.Name);
             deletebtn.OnClientClick = jscript;
         }
     }
 }