public async Task <IHttpActionResult> DeleteBusinessArea([FromBody] BusinessArea ba)
 {
     return(await HttpActionResultWithErrorHandling(SecurityActions.SuperTenantAdmin, async() =>
     {
         _adminRepo.DeleteBusinessArea(ba);
         return Ok();
     }));
 }
Exemple #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            BusinessArea businessArea = db.BusinessAreas.Find(id);

            db.BusinessAreas.Remove(businessArea);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            BusinessArea businessArea = Mapper.Map <BusinessArea>(businessAreaService.Get(id));

            businessArea.IsDeleted = true;
            businessAreaService.Update(businessArea);
            return(RedirectToAction("Index"));
        }
Exemple #4
0
        public ComplaintAddedImpl(User addedBy, string subject, BusinessArea area)
        {
            AddedAt = DateTime.UtcNow;

            AddedBy = addedBy;
            Subject = subject;
            Area    = area;
            Body    = string.Empty;
        }
Exemple #5
0
 public ActionResult Edit([Bind(Include = "BusinessAreaID,Name")] BusinessArea businessArea)
 {
     if (ModelState.IsValid)
     {
         db.Entry(businessArea).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(businessArea));
 }
Exemple #6
0
        public ActionResult Create([Bind(Include = "BusinessAreaID,Name")] BusinessArea businessArea)
        {
            if (ModelState.IsValid)
            {
                db.BusinessAreas.Add(businessArea);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(businessArea));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,Description,MainAreaId,CreatedBy,CreatedAt,UpdatedBy,UpdatedAt,IsDeleted,DeletedBy,DeletedAt,IsActive,IpAddress,UserAgent,Location")] BusinessArea businessArea)
 {
     if (ModelState.IsValid)
     {
         var entity = Mapper.Map <BusinessArea>(businessArea);
         businessAreaService.Update(entity);
         return(RedirectToAction("Index"));
     }
     ViewBag.MainAreaId = new SelectList(businessAreaService.GetAll(), "Id", "Name", businessArea.MainAreaId);
     return(View(businessArea));
 }
        public ComplaintAddedImpl(User addedBy, string subject, BusinessArea area)
        {
            var dateTime = DateTime.UtcNow;

            AddedAt = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second,
                                   dateTime.Millisecond, DateTimeKind.Utc);

            AddedBy = addedBy;
            Subject = subject;
            Area    = area;
            Body    = string.Empty;
        }
 public IActionResult Create(BusinessArea businessArea)
 {
     try
     {
         _businessAreaRepository.Add(businessArea);
         return(RedirectToAction("Index"));
     }
     catch
     {
         ViewBag.ParentAreas = _businessAreaRepository.BusinessAreas;
         return(View(businessArea));
     }
 }
        public IActionResult SaveBusinessArea([FromBody] BusinessArea ba)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var id = _skillRepository.SaveBusinessArea(ba);

            var res = _skillRepository.GetBusinessAreaById(id);

            return(Ok(res));
        }
Exemple #11
0
 public void GuardarAreaAndroid(Area descripcion)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             negocio.GuardarAreaAndroid(descripcion);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #12
0
 public void Guardar(Area area)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             negocio.Guardar(area);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #13
0
 public Area ObtenerAreaById(int idArea)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             return(negocio.ObtenerAreaById(idArea));
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #14
0
 public void Habilitar(int idArea, bool habilitado)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             negocio.Habilitar(idArea, habilitado);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #15
0
 public void Actualizar(int idArea, Area area)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             negocio.Actualizar(idArea, area);
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #16
0
        public int getCounts(SEE see, BusinessArea ba, ArrayList r)
        {
            IWorkspace sdeConn = ext.TransactionManager.ConnectionManager.getConnection(ba);

            ArrayList layers = null; // List<LayerConfig>
            if(ba == BusinessArea.ForAdmBound)
            {
                layers = ext.TransactionManager.transactionConfig().AdminBoundaryLayers;
            }
            else
            {
                if(ba == BusinessArea.Tantalis)
                {
                    layers = ext.TransactionManager.transactionConfig().TantalisLayers;
                }
                else
                {
                    layers = new ArrayList();
                }
                }

            string prefix = null;
            switch(ba)
            {
                case BusinessArea.ForAdmBound:
                    prefix = this.ext.get_SystemValue(DAOUtils.FADM_SCHEMA_KEY);
                    break;
                case BusinessArea.Tantalis:
                    prefix = this.ext.get_SystemValue(DAOUtils.TANT_SCHEMA_KEY);
                    break;
            }

            int rint = 0;
            for(IEnumerator e = layers.GetEnumerator();e.MoveNext();)
            {
                TransactionConfig.LayerConfig layer = (TransactionConfig.LayerConfig)e.Current;
                try
                {
                    int cnt = count(prefix, layer, sdeConn, see);
                    rint += cnt;
                    r.Add(layer.OsdbLayerName + ": " + cnt + " Features ");
                }
                catch (HandledException ex)
                {
                    // ignore
                    System.Diagnostics.Debug.WriteLine(ex.Message + "\n" + ex.StackTrace); //ajw
                }
            }
            return rint;
        }
Exemple #17
0
 public List <Area> ObtenerAreaConsulta(string descripcion)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             return(negocio.ObtenerAreaConsulta(descripcion));
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #18
0
        // GET: BusinessAreas/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            BusinessArea businessArea = db.BusinessAreas.Find(id);

            if (businessArea == null)
            {
                return(HttpNotFound());
            }
            return(View(businessArea));
        }
Exemple #19
0
 public List <Area> GetAll()
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             return(negocio.ObtenerAreas(true));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #20
0
 public List <Area> ObtenerAreasUsuarioPublico(bool insertarSeleccion)
 {
     try
     {
         using (BusinessArea negocio = new BusinessArea())
         {
             return(negocio.ObtenerAreasUsuarioPublico(insertarSeleccion));
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemple #21
0
 public void InsertNewArea(string newArea)
 {
     using (SQLDBDataContext context = new SQLDBDataContext())
     {
         if (context.BusinessArea.Count(x => x.AreaName == newArea) > 0)
         {
             throw new Exception("输入的地区名已经存在");
         }
         BusinessArea area = new BusinessArea()
         {
             AreaName = newArea
         };
         context.BusinessArea.InsertOnSubmit(area);
         context.SubmitChanges();
     }
 }
        // Method for  grid update for GridArea
        protected void GridArea_BatchUpdate(object sender, ASPxDataBatchUpdateEventArgs e)
        {
            var listInsert = new List <BusinessArea>();

            foreach (var args in e.InsertValues)
            {
                //InsertNewItem(args.NewValues);
                BusinessArea Area = new BusinessArea();
                Area.AreaTitle   = Convert.ToString(args.NewValues["AreaTitle"]);
                Area.UniqueID    = Convert.ToString(args.NewValues["UniqueID"]);
                Area.Description = Convert.ToString(args.NewValues["Description"]);
                Area.Source      = Convert.ToString(args.NewValues["Source"]);
                Area.Date        = Convert.ToDateTime(args.NewValues["Date"]);
                listInsert.Add(Area);
            }
            if (listInsert.Count > 0)
            {
                rtm_services.InsertNewBusinessArea(listInsert);
            }
            var listUpdates = new List <BusinessArea>();

            foreach (var args in e.UpdateValues)
            {
                BusinessArea Area = new BusinessArea();
                Area.Id          = Convert.ToString(args.Keys["Id"]);
                Area.AreaTitle   = Convert.ToString(args.NewValues["AreaTitle"]);
                Area.UniqueID    = Convert.ToString(args.NewValues["UniqueID"]);
                Area.Description = Convert.ToString(args.NewValues["Description"]);
                Area.Source      = Convert.ToString(args.NewValues["Source"]);
                Area.Date        = Convert.ToDateTime(args.NewValues["Date"]);
                listUpdates.Add(Area);
            }
            if (listUpdates.Count > 0)
            {
                rtm_services.UpdateBusinessArea(listUpdates);
            }
            foreach (var args in e.DeleteValues)
            {
                DeleteArea(args.Keys);
            }
            e.Handled = true;

            BindArea();
            BindCategory();
            BindProcess(ddlProjects.SelectedItem.Value.ToString());
        }
        public IActionResult Edit(int id, BusinessArea businessArea)
        {
            if (id != businessArea.Id)
            {
                return(NotFound());
            }

            try
            {
                _businessAreaRepository.Update(businessArea);
                return(RedirectToAction("Index"));
            }
            catch (DbUpdateConcurrencyException)
            {
                ViewBag.ParentAreas = _businessAreaRepository.BusinessAreas.Where(b => b.Id != id && b.ParentId != id);
                return(View(businessArea));
            }
        }
Exemple #24
0
        // BA is optional -- optimization
        public bool includesOSDB(string name, BusinessArea ba)
        {
            if(ba != BusinessArea.Tantalis)
            {
                return this.adminLayers.ContainsKey(name);
            }

            if(ba != BusinessArea.ForAdmBound)
            {
                return this.tantalisLayers.ContainsKey(name);
            }

            return false;
        }
Exemple #25
0
 public void Insert(BusinessArea businessArea)
 {
     businessAreaRepository.Insert(businessArea);
     unitOfWork.SaveChanges();
 }
Exemple #26
0
 public IWorkspace getConnection(BusinessArea ba)
 {
     switch(ba)
     {
         case BusinessArea.ForAdmBound:
             return this.Fadm;
         case BusinessArea.Tantalis:
             return this.Tant;
     }
     return null;
 }
Exemple #27
0
 public BusinessAreaEntity(BusinessArea area)
 {
     this.Code = area.BusinessAreaCode;
     this.Name = area.BusinessAreaName;
 }
 public void Add(BusinessArea businessArea)
 {
     businessArea.Code += "BA" + HiResDateTime.UtcNowTicks;
     _appDbContext.BusinessAreas.Add(businessArea);
     _appDbContext.SaveChanges();
 }
Exemple #29
0
		public ComplaintAddedImpl(User addedBy, string subject, BusinessArea area)
		{
			AddedAt = DateTime.UtcNow;

			AddedBy = addedBy;
			Subject = subject;
			Area = area;
			Body = string.Empty;
		}
Exemple #30
0
		public ComplaintAddedImpl(User addedBy, string subject, BusinessArea area)
		{
			DateTime dateTime = DateTime.UtcNow;
			AddedAt = new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second,
				dateTime.Millisecond, DateTimeKind.Utc);

			AddedBy = addedBy;
			Subject = subject;
			Area = area;
			Body = string.Empty;
		}
Exemple #31
0
        private void init(IWorkspace con, string prefix, BusinessArea ba, Hashtable layers)
        {
            IQueryDef query = ((IFeatureWorkspace)con).CreateQueryDef();
            query.Tables = prefix+SDE_LAYERS_TABLE+","+prefix+SDE_OSDB_TABLE;
            query.WhereClause = prefix + SDE_LAYERS_TABLE + "." + OPERATIONAL_DATASET_NAME_COL + " = " +
                prefix + SDE_OSDB_TABLE + "." + OPERATIONAL_DATASET_NAME_COL +
                " AND "+prefix + SDE_LAYERS_TABLE + "." + OPERATIONAL_DATASET_NAME_COL + " = '" +
                (ba == BusinessArea.ForAdmBound?DAOUtils.FADM_OSDB_KEY:
                    (ba == BusinessArea.Tantalis?DAOUtils.TANT_OSDB_KEY:"NULL"))+"'";

            ICursor cur = null;
            try
            {
                cur = query.Evaluate();

                for(IRow row = cur.NextRow();row!=null;row = cur.NextRow())
                {
                    int fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE+"."+SDE_LAYER_NAME_COL);
                    object t = null;
                    string osdb = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            osdb = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + WORKING_THEME_NAME_COL);
                    t = null;
                    string working = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            working = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + PRISTINE_THEME_NAME_COL);
                    t = null;
                    string pristine = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            pristine = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + EDIT_THEME_NAME_COL);
                    t = null;
                    string edit = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            edit = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + CONFLICT_THEME_NAME_COL);
                    t = null;
                    string conflict = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            conflict = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + PRIMARY_KEY_FIELD_COL);
                    t = null;
                    string[] primaries = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        string tmp = null;
                        if(!(t is DBNull))
                            tmp = (string)t;
                        primaries = (tmp == null?null:tmp.Split(new char[] {'|'}));
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + READ_ONLY_FIELD_COL);
                    t = null;
                    string[] read_only = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        string tmp = null;
                        if(!(t is DBNull))
                            tmp = (string)t;
                        read_only = (tmp == null?null:tmp.Split(new char[] {'|'}));
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + JOIN_TABLE_COL);
                    t = null;
                    string join_table = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            join_table = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + JOIN_OUTPUT_ATTRS_COL);
                    t = null;
                    string[] join_output_attrs = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        string tmp = null;
                        if(!(t is DBNull))
                            tmp = (string)t;
                        join_output_attrs = (tmp == null?null:tmp.Split(new char[] {'|'}));
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + LABEL_COL);
                    t = null;
                    string label = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            label = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + UPDATE_TIME_FIELD_COL);
                    t = null;
                    string updateTimeField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            updateTimeField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + UPDATE_USER_FIELD_COL);
                    t = null;
                    string updateUserField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            updateUserField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + CREATE_TIME_FIELD_COL);
                    t = null;
                    string createTimeField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            createTimeField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + CREATE_USER_FIELD_COL);
                    t = null;
                    string createUserField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            createUserField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + GEOMETRY_TYPE_COL);
                    t = null;
                    string geometry = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            geometry = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + REQUIRES_SID_IND_COL);
                    t = null;
                    string requiresSID = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            requiresSID = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + SID_FIELD_NAME_COL);
                    t = null;
                    string sidField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            sidField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + FCODE_FIELD_NAME_COL);
                    t = null;
                    string fcodeField = null;
                    if(fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if(!(t is DBNull))
                            fcodeField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + SYMBOL_TYPE_FIELD_COL);
                    t = null;
                    string symbolTypeField = null;
                    if (fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if (!(t is DBNull))
                            symbolTypeField = (string)t;
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_OSDB_TABLE + "." + CLUSTER_TOL_COL);
                    t = null;
                    float clusterTol = 0.0F;
                    if (fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if (!(t is DBNull))
                            if (!t.Equals(0.0))
                            {
                                clusterTol = (float)t;
                            }
                    }

                    fIndex = row.Fields.FindField(prefix + SDE_LAYERS_TABLE + "." + IS_TOPO_COL);
                    t = null;
                    bool isTopo = false;
                    if (fIndex > -1)
                    {
                        t = row.get_Value(fIndex);
                        if (!(t is DBNull))
                        {
                            isTopo = ((string)t).Equals("Y") || ((string)t).Equals("y");
                        }
                    }

                    LayerConfig lc = new LayerConfig(ba, osdb, working, pristine, edit,
                            conflict, toList(primaries), toList(read_only), join_table, toList(join_output_attrs), label,
                            updateTimeField, createTimeField, updateUserField, createUserField,
                            geometry, requiresSID, sidField, fcodeField, symbolTypeField,isTopo,clusterTol);

                    layers.Add(osdb,lc);
                }
            }
            catch(InvalidCastException e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message + "\n" + e.StackTrace);
            }
            finally
            {
                if(cur!=null)
                {
                    Utils.Release(cur);
                }
            }
        }
Exemple #32
0
 public void Update(BusinessArea businessArea)
 {
     businessAreaRepository.Update(businessArea);
     unitOfWork.SaveChanges();
 }
 public void Update(BusinessArea businessArea)
 {
     _appDbContext.Update(businessArea);
     _appDbContext.SaveChanges();
 }
Exemple #34
0
            internal LayerConfig(BusinessArea ba, string osdb, string working, string pristine, 
				string edit, string conflict, ArrayList primaries, ArrayList read_only, 
				string join_table, ArrayList join_output_attrs, string label, 
				string updateTimeField, string createTimeField, string updateUserField, string createUserField,
				string geometry, string requiresSID, string sidField, string fcodeField, string symbolTypeField,
                bool isTopoLayer, float clusterTolerance)
            {
                this.ba = ba;
                this.osdb = osdb;
                this.working = working;
                this.pristine = pristine;
                this.edit = edit;
                this.conflict = conflict;
                this.isTopoLayer = isTopoLayer;
                this.clusterTolerance = clusterTolerance;
                this.primaries = (string[])primaries.ToArray(typeof(string));
                if(read_only != null)
                {
                    read_only.Add(updateTimeField);
                    read_only.Add(createTimeField);
                    read_only.Add(updateUserField);
                    read_only.Add(createUserField);
                    this.read_only = (string[])read_only.ToArray(typeof(string));
                }
                this.join_table = join_table;
                if(join_output_attrs != null)
                {
                    this.join_output_attrs = (string[])join_output_attrs.ToArray(typeof(string));
                }

                this.label = label;

                this.updateTimeField = updateTimeField;
                this.createTimeField = createTimeField;
                this.updateUserField = updateUserField;
                this.createUserField = createUserField;

                //ajw: added March 21-07
                this.geometry = geometry; // should be one of 'none,'point','line','polygon'
                this.requiresSID = requiresSID;
                this.sidField = sidField;
                this.fcodeField = fcodeField;
                this.symbolTypeField = symbolTypeField;
            }