public ActionResult Create([Bind(Include = "cod_are,des_are")] AREA aREA)
        {
            if (ModelState.IsValid)
            {
                db.AREA.Add(aREA);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aREA));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "AreaID,areaname,x_coord,y_coord")] AREA area)
        {
            if (ModelState.IsValid)
            {
                db.AREAs.Add(area);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(area));
        }
Beispiel #3
0
        public AREA ToAREA()
        {
            AREA data = new AREA();

            data.NrEntries = (uint)Entries.Count;
            foreach (var entry in Entries)
            {
                data.Entries.Add(entry.ToAREAEntry());
            }
            return(data);
        }
Beispiel #4
0
        public ActionResult Create([Bind(Include = "RUT_EMPRESA_PROV,ID_AREA,EMAIL_AREA,DESCRIPCION_AREA")] AREA aREA)
        {
            if (ModelState.IsValid)
            {
                db.AREA.Add(aREA);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aREA));
        }
Beispiel #5
0
        public async Task <ActionResult> Edit([Bind(Include = "ID_EMPRESA_PROV,ID_AREA,EMAIL_AREA,DESCRIPCION_AREA")] AREA aREA)
        {
            if (ModelState.IsValid)
            {
                db.Entry(aREA).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(aREA));
        }
Beispiel #6
0
    // Use this for initialization
    protected override void Awake()
    {
        areaWidth = 3 ;
        areaHeight = 4 ;
        //マップ地形は外部ファイル(Excelとか)から読み込めるようにする予定
        areaField = new AREA[,]{	{AREA.NONE,	AREA.NONE,	AREA.NONE,	AREA.NONE},
                                    {AREA.NONE,	AREA.NONE,	AREA.NONE,	AREA.NONE},
                                    {AREA.NONE,	AREA.NONE,	AREA.NONE,	AREA.NONE},	} ;
        areaUnit = new KP_Unit[areaWidth, areaHeight] ;

        base.Awake() ;
    }
Beispiel #7
0
 public bool PostArea(AREA area)
 {
     try
     {
         db.AREA.Add(area);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #8
0
    void on_play(AREA area)
    {
        CSoundManager.Instance.stop_bgm();
        CSoundManager.Instance.update_area_bgm_clip(area);
        CSoundManager.Instance.play_bgm(area);

        CGameLogic.Instance.update_area(area);

        CUIManager.Instance.show_fade_out_in(UI_PAGE.AREA_SELECT, UI_PAGE.STAGE_SELECT, () =>
        {
            CUIManager.Instance.get_uipage(UI_PAGE.STAGE_SELECT).GetComponent <CStageSelect>().enter(area);
        });
    }
Beispiel #9
0
 public bool PutArea(AREA area)
 {
     try
     {
         db.Entry(area).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #10
0
        public bool DeleteArea(AREA area)
        {
            var isDeleted = sportsSideService.DeleteArea(area);

            if (isDeleted)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #11
0
        public bool PutArea(AREA area)
        {
            var isUpdated = sportsSideService.PutArea(area);

            if (isUpdated)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #12
0
        public bool PostArea(AREA area)
        {
            var isSaved = sportsSideService.PostArea(area);

            if (isSaved)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #13
0
        public async Task <ActionResult> Create([Bind(Include = "ID_AREA,EMAIL_AREA,DESCRIPCION_AREA")] AREA aREA)
        {
            if (ModelState.IsValid)
            {
                aREA.ID_EMPRESA_PROV = 1;
                db.AREA.Add(aREA);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(aREA));
        }
Beispiel #14
0
 public StagePair(string area_text, short stage_index)
 {
     foreach (AREA e in Enum.GetValues(typeof(AREA)))
     {
         bool found = area_text.Equals(e.ToString());
         if (found)
         {
             this.area = e;
             break;
         }
     }
     this.stage_index = stage_index;
 }
Beispiel #15
0
        // GET: /Area/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AREA area = db.AREAs.Find(id);

            if (area == null)
            {
                return(HttpNotFound());
            }
            return(View(area));
        }
Beispiel #16
0
        // GET: AREAs/Delete/5
        public async Task <ActionResult> Delete(decimal id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AREA aREA = await db.AREA.FindAsync(id);

            if (aREA == null)
            {
                return(HttpNotFound());
            }
            return(View(aREA));
        }
Beispiel #17
0
        // GET: AREAs/Delete/5
        public ActionResult Delete(decimal id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AREA aREA = db.AREA.Find(id);

            if (aREA == null)
            {
                return(HttpNotFound());
            }
            return(View(aREA));
        }
Beispiel #18
0
    public StagePair(Hashtable table)
    {
        string area_text = table["area"].ToString();

        foreach (AREA e in Enum.GetValues(typeof(AREA)))
        {
            bool found = area_text.Equals(e.ToString());
            if (found)
            {
                this.area = e;
                break;
            }
        }
        this.stage_index = short.Parse(table["stage"].ToString());
    }
Beispiel #19
0
        // GET: AREAs/Edit/5
        public ActionResult Edit(decimal id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AREA aREA = db.AREA.Find(id);

            if (aREA == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_CLIENTE = new SelectList(db.CLIENTE, "ID_CLIENTE", "NOMBRE_CLIENTE", aREA.ID_CLIENTE);
            return(View(aREA));
        }
Beispiel #20
0
        public dynamic PutPropertyMaster(dynamic property)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            { int      ID     = property.PROPERTYID;
              PROPERTY objEmp = new PROPERTY();
              objEmp = db.PROPERTies.Where(ww => ww.PROPERTYID == ID).FirstOrDefault();
              if (objEmp != null)
              {
                  string       areaname   = property.AREA;
                  string       propertype = property.PROPERTYTYPE;
                  AREA         area       = db.AREAs.Where(zz => zz.AREANAME == areaname).FirstOrDefault();
                  PROPERTYTYPE type       = db.PROPERTYTYPEs.Where(zz => zz.PROPERTTYPEDESCRIPTION == propertype).FirstOrDefault();
                  objEmp.AREAID         = property.AREA;
                  objEmp.PROPERTYTYPEID = property.PROPERTYTYPE;
                  // objEmp.PROPERTYSTATUSID = property.PROPERTYSTATUSID;
                  ///objEmp.AGENT_ID = property.AGENT_ID;
                  objEmp.PROPERTYDESCRIPTION = property.PROPERTYDESCRIPTION;
                  objEmp.ADDRESS             = property.ADDRESS;
                  objEmp.SIZE           = property.SIZE;
                  objEmp.NUMBBATH       = property.NUMBBATH;
                  objEmp.NUMBED         = property.NUMBED;
                  objEmp.GARDEN         = property.GARDEN;
                  objEmp.ADDITIONALINFO = property.ADDITIONALINFO;
                  objEmp.AVAILABLEDATE  = property.AVAILABLEDATE;
                  db.SaveChanges();

                  RENTALAMOUNT amnt = new RENTALAMOUNT();

                  amnt = db.RENTALAMOUNTs.Where(qq => qq.PROPERTYID == objEmp.PROPERTYID).FirstOrDefault();

                  amnt.AMOUNT = property.RENTALAMOUNT;
                  amnt.DATE   = DateTime.Today;


                  db.SaveChanges();
              }
            }
            catch (Exception)
            {
                return(null);
            }
            return(Ok(property));
        }
Beispiel #21
0
        //
        public void moveToPointHumanized(POINT targetPos)
        {
            if (!stopPropagation) //Para evitar que se puedan crear 2 o mas hilos interactuand ocon el raton
            {
                hilo = new Thread(() =>
                {
                    Thread.CurrentThread.IsBackground = true;
                    int milisegundosPasados           = 0;



                    POINT margeninferior = targetPos - new POINT(2, 2);
                    POINT margenSuperior = targetPos + new POINT(2, 2);
                    AREA margenArea      = new AREA(margeninferior, margenSuperior);


                    //Ecuación de la recta --> y = mx + b;
                    decimal m = (decimal)(targetPos.posY - currentPos.posY) / (decimal)(targetPos.posX - currentPos.posX); //Hallamos m
                    decimal b = -m * currentPos.posX + currentPos.posY;                                                    //Hallamos b

                    decimal x = currentPos.posX;
                    decimal y = m * x + b;
                    decimal X = (y - b) / m;

                    //Cuanto tiene que valer x para que y sea igual a targetPos.posY;
                    // y = m * x + b --> (y-b)/m
                    int limit = (int)((targetPos.posY - b) / m);
                    Trace.WriteLine("Entonces y == 100 cuando x == " + limit + ". Y x == 100 cuando y == " + (m * 100 + b));
                    //Sabemos el limite, debemos hallar el incremento que x debe tener para que tanto x como y llegan al valor especificado
                    int incrX = x > limit ? -1 : 1;
                    instance.stopPropagation = true;
                    while (!margenArea.isInArea(currentPos))
                    {
                        currentPos = new POINT(x, y);
                        this.moveToPoint(currentPos);
                        milisegundosPasados += 1;
                        System.Threading.Thread.Sleep(1);

                        x += incrX;
                        y  = (int)(m * x + b);
                    }
                    instance.stopPropagation = false;
                });
                hilo.Start();
            }
        }
Beispiel #22
0
        public ActionResult Asignacion(string idArea, List <string> analisis)
        {
            AREA area = db.AREAs.Find(Int32.Parse(idArea));

            List <EMPLEADO> empleadosArea = db.EMPLEADOes.Where(e => e.id_area == area.id_area).ToList();

            List <ANALISI> analisisList = new List <ANALISI>();

            foreach (var analisi in analisis)
            {
                analisisList.Add(db.ANALISIS.Find(Int32.Parse(analisi)));
            }

            ViewBag.Analisis  = analisisList;
            ViewBag.Empleados = empleadosArea;

            return(PartialView());
        }
Beispiel #23
0
 public bool Create()
 {
     try
     {
         Modelo.AREA us = new AREA();
         us.ID_AREA     = this.id_area;
         us.NOMBRE      = this.area;
         us.ABREVIACION = this.abreviacion;
         us.OBSOLETA    = this.obsoleta;
         CommonBC.ModeloWfbs.AREA.Add(us);
         CommonBC.ModeloWfbs.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #24
0
    public void play_bgm(AREA area)
    {
        if (!this.sound_on_flag)
        {
            return;
        }

        stop_bgm();
        if (!this.bgm_clips.ContainsKey(area))
        {
            return;
        }

        if (this.bgm_clips[area] != null)
        {
            this.bgm_controller.Play();
        }
    }
Beispiel #25
0
        public IHttpActionResult DeleteArea(int id)
        {
            INF370Entities db = new INF370Entities();

            db.Configuration.ProxyCreationEnabled = false;


            AREA AreaDetails = db.AREAs.Find(id);

            if (AreaDetails == null)
            {
                return(NotFound());
            }

            db.AREAs.Remove(AreaDetails);
            db.SaveChanges();

            return(Ok(AreaDetails));
        }
Beispiel #26
0
        private static void DataTypeLearn()
        {
            sbyte b   = 0;
            int   x   = default(int);
            int?  y   = default(int?);
            int   j   = new int();
            AREA  r   = (AREA)1;
            AREA? ar  = default(AREA?);
            bool  x11 = ar.HasValue;


            const int x1  = 666;
            char      ch  = (char)10;
            int       v1  = (int)ch;
            int       ch1 = (int)'\x000A';
            char      xf  = (char)ch1;
            float     f1  = 0 / 0.0f;
            string    st  = "";
        }
        public AREA InserirAreaBloqueio(AREA area, DB_LaborSafetyEntities entities = null)
        {
            if (entities == null)
            {
                entities = new DB_LaborSafetyEntities();
            }


            var areaBloqueio = new AREA()
            {
                Codigo    = area.Codigo,
                Nome      = area.Nome,
                Descricao = area.Descricao
            };

            entities.AREA.Add(areaBloqueio);
            entities.SaveChanges();

            return(areaBloqueio);
        }
Beispiel #28
0
        public AreaBE Delete(AreaBE pAreaBE)
        {
            int resultado = 0;

            try
            {
                using (dbModelo db = new dbModelo())
                {
                    AREA oAREA = (from elem in db.AREA where elem.ID == pAreaBE.ID select elem).FirstOrDefault();
                    db.AREA.Remove(oAREA);

                    resultado = db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(pAreaBE);
        }
Beispiel #29
0
        private List <AreaType> getUnavailableAreas(AreaDbContext DB, string username)
        {
            List <AreaType> unavailable_areatypes = new List <AreaType>();
            List <AreaType> all_areatypes         = DB.areatypes.ToList();
            AREA            tmp = new AREA();

            tmp.username       = username;
            tmp.index_action   = 0;
            tmp.index_reaction = 0;
            tmp.last_event     = "";
            foreach (var area_type in all_areatypes)
            {
                tmp.type = area_type.id;
                IArea type = AreaFactory.create(tmp, DB);
                if (type != null && !type.isAvailable())
                {
                    unavailable_areatypes.Add(area_type);
                }
            }
            return(unavailable_areatypes);
        }
        static void Main(string[] args)
        {
            double b, a, AREA, PERIMETRO, DIAGONAL;

            b = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
            a = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);

            AREA = b * a;

            PERIMETRO = 2 * (b + a);

            DIAGONAL = Math.Sqrt(Math.Pow(b, 2.0) + Math.Pow(a, 2.0));

            Console.WriteLine("AREA = " + AREA.ToString("F4", CultureInfo.InvariantCulture));

            Console.WriteLine("PERIMETRO = " + PERIMETRO.ToString("F4", CultureInfo.InvariantCulture));

            Console.WriteLine("DIAGONAL = " + DIAGONAL.ToString("F4", CultureInfo.InvariantCulture));

            Console.ReadLine();
        }
Beispiel #31
0
        public IHttpActionResult GetAreaDetailsById(string AreaID)
        {
            db.Configuration.ProxyCreationEnabled = false;
            AREA objEmp = new AREA();

            try
            {
                int ID = Convert.ToInt32(AreaID);

                objEmp = db.AREAs.Find(ID);
                if (objEmp == null)
                {
                    return(NotFound());
                }
            }
            catch (Exception)
            {
                return(null);
            }

            return(Ok(objEmp));
        }
Beispiel #32
0
        // Helper function for forward projection: compute the theta angle and determine the area number.
        static double qsc_fwd_equat_face_theta(double phi, double y, double x, out AREA area)
        {
            if(phi<EPS10)
            {
                area=AREA._0;
                return 0.0;
            }

            double theta=Math.Atan2(y, x);
            if(Math.Abs(theta)<=Proj.FORTPI)
            {
                area=AREA._0;
            }
            else if(theta>Proj.FORTPI&&theta<=Proj.HALFPI+Proj.FORTPI)
            {
                area=AREA._1;
                theta-=Proj.HALFPI;
            }
            else if(theta>Proj.HALFPI+Proj.FORTPI||theta<=-(Proj.HALFPI+Proj.FORTPI))
            {
                area=AREA._2;
                theta=(theta>=0.0?theta-Proj.PI:theta+Proj.PI);
            }
            else
            {
                area=AREA._3;
                theta+=Proj.HALFPI;
            }

            return theta;
        }
 public MKDSAreaRenderGroup(AREA Areas, Color AreaColor)
 {
     this.Areas = Areas;
     this.AreaColor = AreaColor;
 }