Beispiel #1
0
 public void Update(TypeInput entity)
 {
     this.DbHelper.Execute(this.Table, proc =>
                           proc.AsUpdate(entity, "No", "Name")
                           .Where("Id", entity.Id)
                           );
 }
Beispiel #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            TypeInput typeInput = db.TypeInputs.Find(id);

            db.TypeInputs.Remove(typeInput);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public void Delete(TypeInput entity)
        {
            entity.IsDeleted = 1;

            this.DbHelper.Execute(this.Table, proc =>
                                  proc.AsUpdate(entity, "IsDeleted", "Modifier", "ModifyTime")
                                  .Where("Id", entity.Id)
                                  );
        }
Beispiel #4
0
 public ActionResult Edit([Bind(Include = "Id,Name,ManagerTemplate,DisplayTemplate")] TypeInput typeInput)
 {
     if (ModelState.IsValid)
     {
         db.Entry(typeInput).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(typeInput));
 }
Beispiel #5
0
        private void btnAddType_Click(object sender, EventArgs e)
        {
            TypeInput input = new TypeInput();

            if (input.ShowDialog() == DialogResult.OK)
            {
                ListViewItem item = new ListViewItem(input.Type);
                item.SubItems.Add(input.Namespace);
                lvTypes.Items.Add(item);
            }
        }
Beispiel #6
0
        public ActionResult Create([Bind(Include = "Id,Name,ManagerTemplate,DisplayTemplate")] TypeInput typeInput)
        {
            if (ModelState.IsValid)
            {
                db.TypeInputs.Add(typeInput);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(typeInput));
        }
Beispiel #7
0
        // GET: DNSAdmin/TypeInputManager/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TypeInput typeInput = db.TypeInputs.Find(id);

            if (typeInput == null)
            {
                return(HttpNotFound());
            }
            return(View(typeInput));
        }
Beispiel #8
0
        public static bool ExistsRegister(string Value, TypeInput Type, string Field, string Table, long CompanyId = 0)
        {
            try
            {
                if (String.IsNullOrEmpty(Value))
                {
                    return(true);
                }
                if (String.IsNullOrEmpty(Field))
                {
                    return(true);
                }
                if (String.IsNullOrEmpty(Table))
                {
                    return(true);
                }

                Value = Type == TypeInput.Texto ? "'" + Value + "'" : Value;

                StringBuilder SQL = new StringBuilder();
                SQL = new StringBuilder();

                SQL.AppendLine(" Select ");
                SQL.AppendLine("    Count(*) As Qtd ");
                SQL.AppendLine(" From " + Table);
                SQL.AppendLine(" Where Active = 1 ");
                SQL.AppendLine(" And " + Field + " = " + Value);
                if (CompanyId > 0)
                {
                    SQL.AppendLine(" And CompanyId = " + CompanyId);
                }

                DataTable data = Conn.GetDataTable(SQL.ToString(), Table);
                if (data != null && data.Rows.Count > 0 && int.Parse(data.AsEnumerable().First().Field <int>("Qtd").ToString()) > 0)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #9
0
    public void ActivatePanel(int orderNum, bool backwards)
    {
        current_panel.isCurrentBox = false;
        current_input_panel        = orderNum;
        prev_panel    = current_panel;
        current_panel = FindPanel(orderNum);
        current_panel.isCurrentBox = true;
        if (current_input_panel == input_panels.Length - 1)
        {
            Debug.Log("Helllo");
            EndLetter();
            return;
        }
        else
        {
            Debug.Log("Naw");
        }

        if (backwards)
        {
            //current_panel.currentChar--;
            prev_panel.transform.parent.gameObject.SetActive(false);
            current_panel.RemoveLast();
            current_panel.goingToNextLine = false;
            if (current_input_panel % 4 == 0 && orderNum != 0)
            {
                Debug.Log("going back " + orderNum);
                sc.MoveCanvasBack();
            }
            //sc.multiplier -= 2;
        }
        else
        {
            current_panel.transform.parent.gameObject.SetActive(true);
            changing = true;
            prev_panel.removingLast = true;
            if (orderNum % 4 == 0 && orderNum != 0)
            {
                sc.MoveCanvas();
            }

            //sc.multiplier += .2f;
        }
    }
Beispiel #10
0
    // Update is called once per frame
    void Update()
    {
        if (!input_panels_found)
        {
            input_panels = FindObjectsOfType <TypeInput>();
            foreach (TypeInput p in input_panels)
            {
                if (p.orderNum == 0)
                {
                    p.transform.parent.gameObject.SetActive(true);
                    current_panel = p;

                    p.isCurrentBox = true;
                }
                else
                {
                    p.transform.parent.gameObject.SetActive(false);
                }
            }
            input_panels_found = true;
        }

        /*
         * if(current_input_panel != change_input_panel)
         * {
         *  input_panels[current_input_panel].isCurrentBox = false;
         *
         *  TypeInput foundpanel = FindPanel(change_input_panel);
         *
         *
         *
         *  current_input_panel = change_input_panel;
         *  foundpanel.isCurrentBox = true;
         *
         * }
         */
    }
Beispiel #11
0
 public void Insert(TypeInput entity)
 {
     this.DbHelper.Execute(this.Table, proc =>
                           proc.AsInsert(entity, "Id", "Creator", "CreateTime", "IsDeleted", "No", "Name")
                           );
 }