Beispiel #1
0
        private void btnRemoveGroup_Click(object sender, EventArgs e)
        {
            if ((MessageBox.Show("Are you sure you want to delete this group ?", "delete group", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes))
            {
                try
                {
                    string id = cbRemoveGroup.SelectedValue.ToString();

                    GROUP gr = new GROUP();
                    if (gr.deleteGroup(id))
                    {
                        MessageBox.Show("Group already removed", "Remove group", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        loadNewGroup();
                    }
                    else
                    {
                        MessageBox.Show("Error", "Remove group", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                catch
                {
                    MessageBox.Show("Group Not Exist", "Remove group", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Beispiel #2
0
    protected virtual void Awake()
    {
        //SetStates
        _logic = LOGIC.Default;
        _group = GROUP.None;
        _state = STATE.Generalize;

        //Load Resources
        _prefabGroup = Resources.Load("Prefabs/Group") as GameObject;

        //init objects
        _listCollidedSWindows = new List <SWindow>();
        _ray         = new Ray();
        _rayPosition = Vector3.zero;
        _parent      = transform.parent;

        //Position &  Looker Init
        _updateLogic  = null;
        _updateLogic += UpdateDefaultLogic;

        _updateGrouping = UpdateCheckingGrouping;

        _currentScale    = _targetScale = transform.localScale;
        _currentPosition = _targetPosition = transform.position;
        _currentLooker   = _targetLooker = transform.position + transform.forward;

        //added components
        InitComponent <Rigidbody>(InitRigidBody);
        InitComponent <BoxCollider>(InitBoxCollider);
    }
        private void Button_Click_5(object sender, RoutedEventArgs e)
        {
            //Изменить группу по ID
            string        ssql             = @"UPDATE Students SET [Groupa] = @GRoupa WHERE Id = @Id";
            string        connectionString = @"Data Source=DESKTOP-CDQ6MB6\SQLEXPRESS;Initial Catalog=gnevnik;Integrated Security=True"; //prak - имя базы данных(Поменять на свою)
            SqlConnection conn             = new SqlConnection(connectionString);                                                        // Подключение к БД

            conn.Open();
            SqlCommand command = new SqlCommand(ssql, conn);// Объект вывода запросов

            command.Parameters.Add("@Id", SqlDbType.Int).Value          = Convert.ToInt32(ID1.Text);
            command.Parameters.Add("@Groupa", SqlDbType.NVarChar).Value = GROUP.Text;
            SqlDataReader reader = command.ExecuteReader(); // Выаолнение запроса вывод информации

            while (reader.Read())                           //В цикле вывести всю информацию из таблици
            {
                InfoS.Text += reader[0] + " - Id студента " + " ФИО: " + reader[1].ToString() + "  Группа: " + reader[2].ToString() + " Возраст: " + reader[3].ToString() + "\n";
            }
            reader.Close();
            MessageBox.Show("Группа изменена");
            GROUP.Clear();
            ID1.Clear();
            InfoM.Clear();
            InfoS.Clear();
        }
 protected void clear()
 {
     NIK.Value = "";
     UNIT.ClearSelection();
     GROUP.ClearSelection();
     FULLNAME.Value = "";
     email.Value    = "";
     email2.Value   = "";
     //emailDivisi.Value = "";
     //emailDevHead.Value = "";
     //emailDirektur.Value = "";
     NOUSER.Value = "";
     //NODEVHEAD.Value = "";
     //NOKADIV.Value = "";
     //NODIREKTUR.Value = "";
     if (GROUP.SelectedValue.Equals("003HEAD"))
     {
         SU_UPLINER.ClearSelection();
     }
     else if (GROUP.SelectedValue.Equals("002PEN"))
     {
         PIC2.ClearSelection();
         SU_UPLINER.ClearSelection();
     }
     else if (GROUP.SelectedValue.Equals("004KADIV"))
     {
         emailDirektur.Value = "";
         NODIREKTUR.Value    = "";
     }
 }
 private void buttonRemoveGroup_Click(object sender, EventArgs e)
 {
     try
     {
         int   groupID = (int)comboBoxG2.SelectedValue;
         GROUP group   = new GROUP();
         if (MessageBox.Show("Are You Sure You Want To Remove This Group", "Delete Group", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             if (group.deleteGroup(groupID))
             {
                 MessageBox.Show("Group Deleted", " Remove Group", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 fillCombo();
             }
             else
             {
                 MessageBox.Show("Group not Deleted", "Remove Group", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
     catch (Exception ex)
     {
         //MessageBox.Show("Enter A Valid Numeric ID", "Remove Group", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         MessageBox.Show(ex.Message, "Remove Group", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Beispiel #6
0
        public ObservableCollection <GROUP> GetGroupList()
        {
            int    firstLocation, lengthSubString;
            string line;

            string[] lineElements;
            GROUP    tempGroup;
            ObservableCollection <GROUP> localRefCharacteristicList = new ObservableCollection <GROUP>();
            List <string> referanceString;


            if (File.Exists(a2lfileName))
            {
                //A2LLineNumber = File.ReadLines(a2lfileName).Count();
                a2lFileStream   = new FileStream(a2lfileName, FileMode.Open);
                a2lStreamReader = new StreamReader(a2lFileStream);

                while ((line = a2lStreamReader.ReadLine()) != null)
                {
                    if (line.Contains(GROUP_ST_START))
                    {
                        tempGroup             = new GROUP();
                        referanceString       = new List <string>();
                        lineElements          = line.Split(' ');
                        tempGroup.Name        = lineElements[2];
                        firstLocation         = line.IndexOf("\"") + 1;
                        lengthSubString       = (line.Length - 1) - firstLocation;
                        tempGroup.Description = line.Substring(firstLocation, lengthSubString);

                        line = a2lStreamReader.ReadLine();

                        //többsoros comment esetén * -al kezdődik minden
                        if (line.Contains('*') == true)
                        {
                            tempGroup.Description += line.Substring(1, line.Length - 2);
                            line = a2lStreamReader.ReadLine();
                        }
                        line = a2lStreamReader.ReadLine();


                        while (!(line = a2lStreamReader.ReadLine()).Contains(GROUP_RC_END))
                        {
                            referanceString.Add(line.Substring(4));
                        }

                        tempGroup.RefCharacteristicList = referanceString;
                        localRefCharacteristicList.Add(tempGroup);
                    }
                }
                a2lStreamReader.Close();
                a2lFileStream.Close();
                return(localRefCharacteristicList);
            }
            else
            {
                a2lStreamReader = null;
                a2lFileStream   = null;
                return(null);
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //Добавить Студента
            string        FIO              = FIo.Text;
            string        Groupa           = GROUP.Text;
            int           v                = Voz();
            string        DataR            = v.ToString();
            string        ssql             = $"INSERT INTO Students (FIO,Groupa,DataR) VALUES ('{FIO}','{Groupa}','{DataR}')";           //ЗАпрос вставить данные в таблицу Table_1 - имя таблици
            string        connectionString = @"Data Source=DESKTOP-CDQ6MB6\SQLEXPRESS;Initial Catalog=gnevnik;Integrated Security=True"; //prak - имя базы данных(Поменять на свою)
            SqlConnection conn             = new SqlConnection(connectionString);                                                        // Подключение к БД

            conn.Open();                                                                                                                 // Открытие Соединения

            SqlCommand command = new SqlCommand(ssql, conn);                                                                             // Объект вывода запросов

            MessageBox.Show("Данные добавлены");
            FIo.Clear();
            GROUP.Clear();
            DATAR.Clear();
            SqlDataReader reader = command.ExecuteReader(); // Выаолнение запроса вывод информации

            while (reader.Read())                           //В цикле вывести всю информацию из таблици
            {
                InfoS.Text += reader[0] + " - Id студента " + " ФИО: " + reader[1].ToString() + "  Группа: " + reader[2].ToString() + " Возраст: " + reader[3].ToString() + "\n";
            }
            reader.Close();
        }
Beispiel #8
0
    public virtual void OnClicked(Vector3 pos, Vector3 forward)
    {
        //Set Status
        _logic = LOGIC.Clicked;

        if (_state != STATE.Generalize)
        {
            return;
        }

        //Set Grouping Status
        if (_group != GROUP.Done)
        {
            _group = GROUP.Ready;
        }

        _currentPosition = transform.position;
        _targetPosition  = pos;

        _currentLooker = transform.position + transform.forward;
        _targetLooker  = pos + forward;

        _updateLogic  = null;
        _updateLogic += UpdateGrapedLogic;

        _boxCollider.size      = _boxColliderSizeDraged;
        _boxCollider.center    = _boxColliderCenterDraged;
        _boxCollider.isTrigger = true;
    }
        private void Edit_Contact_Form_Load(object sender, EventArgs e)
        {
            GROUP group = new GROUP();

            comboBoxGroup.DataSource    = group.getGroups(Globals.GlobalUserId);
            comboBoxGroup.DisplayMember = "name";
            comboBoxGroup.ValueMember   = "id";
        }
Beispiel #10
0
 public void CreateGroup(GROUP group)
 {
     using (var context = new OpletalovaDbEntities())
     {
         context.GROUP.Add(group);
         context.SaveChanges();
     }
 }
Beispiel #11
0
        void loadNewGroup()
        {
            GROUP group = new GROUP();

            cbRemoveGroup.DataSource    = group.GetListGroup();
            cbRemoveGroup.DisplayMember = "name";
            cbRemoveGroup.ValueMember   = "groupid";
        }
Beispiel #12
0
        void LoadGroup()
        {
            GROUP group = new GROUP();

            cbGroup.DataSource    = gr.GetListGroup();
            cbGroup.DisplayMember = "name";
            cbGroup.ValueMember   = "groupid";
        }
Beispiel #13
0
        public ActionResult Detail(int groupinfoid)
        {
            GROUP group     = RemotingHelp.GetModelObject <GROUP>();
            var   groupList = group.GroupInfoListForAdmin().data as List <GroupInfoModel>;

            ViewBag.GroupInfo = groupList.SingleOrDefault(t => t.groupinfoid == groupinfoid);
            return(View());
        }
Beispiel #14
0
 public void SetGroup(GROUP g, bool addUnkown = false)
 {
     group = g;
     if (addUnkown)
     {
         AddUnkown();
     }
 }
Beispiel #15
0
        void loadChucVu()
        {
            GROUP gr = new GROUP();

            cbChucVu.DataSource    = gr.GetListGroup();
            cbChucVu.DisplayMember = "name";
            cbChucVu.ValueMember   = "name";
        }
Beispiel #16
0
        public ActionResult DeleteConfirmed(int id)
        {
            GROUP gROUP = db.GROUPs.Find(id);

            db.GROUPs.Remove(gROUP);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #17
0
 public ActionResult Edit([Bind(Include = "ID_GROUP,LABEL")] GROUP gROUP)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gROUP).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(gROUP));
 }
Beispiel #18
0
        /// <summary>
        /// 作业调度定时执行的方法
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task Execute(IJobExecutionContext context)
        {
            ORDER order = new ORDER();

            order.UpdateOrderState();

            GROUP group = new GROUP();

            group.UpdateGroupState();
        }
Beispiel #19
0
        public ActionResult Create([Bind(Include = "ID_GROUP,LABEL")] GROUP gROUP)
        {
            if (ModelState.IsValid)
            {
                db.GROUPs.Add(gROUP);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(gROUP));
        }
Beispiel #20
0
 /// <summary>
 /// Add <see cref="GROUP"/>s to the lists.
 /// </summary>
 /// <param name="obj">GROUP object to add</param>
 /// <exception cref="ValidationErrorException">thrown if duplicated <see cref="GROUP"/> is found.</exception>
 public void AddElement(GROUP obj)
 {
     try
     {
         Groups.Add(obj.Name, obj);
     }
     catch (ArgumentException)
     {
         throw new ValidationErrorException(String.Format("Warning: Duplicate '{0}' (Must be unique of all 'GROUPs' in the MODULE) with name '{1}' found, ignoring", obj.GetType().Name, obj.Name));
     }
 }
Beispiel #21
0
 public Nurse(Nurse _nurse)
 {
     name    = _nurse.name;
     sex     = _nurse.sex;
     id      = _nurse.id;
     pw      = _nurse.pw;
     licNum  = _nurse.licNum;
     phNum   = _nurse.phNum;
     groupID = _nurse.groupID;
     isChief = _nurse.isChief;
 }
Beispiel #22
0
 /// <summary>
 /// Provide a list of group names to create the group headings
 /// </summary>
 /// <param name="groupNames"></param>
 public void LoadGroups(string[] groupNames)
 {
     lock (singleton)
     {
         foreach (string gn in groupNames)
         {
             GROUP g = new GROUP();
             groupNamesTable.Add(gn, g);
         }
     }
 }
Beispiel #23
0
    public virtual void DoGrouping(Transform parent)
    {
        _parent = parent;

        _group = GROUP.Done;

        _targetPosition = parent.position;
        _targetLooker   = parent.forward;

        _updateLogic  = null;
        _updateLogic += UpdateGroupingLogic;
    }
        private void fillCombo()
        {
            GROUP group = new GROUP();

            comboBoxG1.DataSource    = group.getGroups(Globals.GlobalUserId);
            comboBoxG1.DisplayMember = "name";
            comboBoxG1.ValueMember   = "id";

            comboBoxG2.DataSource    = group.getGroups(Globals.GlobalUserId);
            comboBoxG2.DisplayMember = "name";
            comboBoxG2.ValueMember   = "id";
        }
        private void Save(string strLink = "")
        {
            try
            {
                Delete_group_menu();
                if (_groupid == 0)
                {
                    GROUP group = new GROUP();
                    group.GROUP_NAME = Txtname.Text;
                    group.GROUP_TYPE = Utils.CIntDef(Rdtype.SelectedValue);
                    db.GROUPs.InsertOnSubmit(group);
                    db.SubmitChanges();
                    var getlink = db.GROUPs.OrderByDescending(n => n.GROUP_ID).Take(1).ToList();
                    if (getlink.Count > 0)
                    {
                        _groupid = getlink[0].GROUP_ID;
                        strLink  = string.IsNullOrEmpty(strLink) ? "chi-tiet-nhom-quan-tri.aspx?groupid=" + getlink[0].GROUP_ID : strLink;
                    }
                }
                else
                {
                    var list = db.GROUPs.Where(n => n.GROUP_ID == _groupid).ToList();
                    foreach (var i in list)
                    {
                        i.GROUP_NAME = Txtname.Text;
                        i.GROUP_TYPE = Utils.CIntDef(Rdtype.SelectedValue);
                    }
                    db.SubmitChanges();
                    strLink = string.IsNullOrEmpty(strLink) ? "chi-tiet-nhom-quan-tri.aspx?groupid=" + _groupid : strLink;
                }

                foreach (TreeListNode node in ASPxTreeList_menu.GetSelectedNodes())
                {
                    int        menu_id = Utils.CIntDef(node.Key);
                    GROUP_MENU grmenu  = new GROUP_MENU();
                    grmenu.GROUP_ID = _groupid;
                    grmenu.MENU_ID  = menu_id;
                    db.GROUP_MENUs.InsertOnSubmit(grmenu);
                    db.SubmitChanges();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (!string.IsNullOrEmpty(strLink))
                {
                    Response.Redirect(strLink);
                }
            }
        }
Beispiel #26
0
 public void InsertOrUpdate(GROUP group)
 {
     if (group.ID == default(int))
     {
         // New entity
         context.GROUPs.Add(group);
     }
     else
     {
         // Existing entity
         context.Entry(group).State = EntityState.Modified;
     }
 }
Beispiel #27
0
 public ActionResult Edit(GROUP group)
 {
     if (ModelState.IsValid)
     {
         groupRepository.InsertOrUpdate(group);
         groupRepository.Save();
         return(RedirectToAction("Index"));
     }
     else
     {
         return(View());
     }
 }
Beispiel #28
0
        // GET: Group/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GROUP gROUP = db.GROUPs.Find(id);

            if (gROUP == null)
            {
                return(HttpNotFound());
            }
            return(View(gROUP));
        }
Beispiel #29
0
    public virtual void UnGrouping()
    {
        _parent = null;

        _group = GROUP.None;

        _updateLogic = null;
        if (_logic == LOGIC.Grabed)
        {
            _updateLogic += UpdateGrapedLogic;
        }
        else
        {
            _updateLogic += UpdateDefaultLogic;
        }
    }
Beispiel #30
0
        public static ELEMENT CreateListUnkown(GROUP g, int c)
        {
            var e = new ELEMENT()
            {
                group = g
            };

            e.list = new List <ELEMENT>();
            for (int i = 0; i < c; i++)
            {
                e.list.Add(new ELEMENT()
                {
                    group = GROUP.UNKNOWN
                });
            }
            return(e);
        }
        public ActionResult Create(List <Role> rs, string groupname)
        {
            GROUP new_group = new GROUP();

            new_group.Name = groupname;
            db.GROUPs.Add(new_group);
            db.SaveChanges();

            foreach (var item in rs)
            {
                item.Group_id = new_group.ID;
                db.Roles.Add(item);
                db.SaveChanges();
            }

            return(RedirectToAction("Index"));
        }
Beispiel #32
0
 /// <summary>
 /// Provide a list of group names to create the group headings
 /// </summary>
 /// <param name="groupNames"></param>
 public void LoadGroups(string[] groupNames)
 {
     lock (singleton)
     {
         foreach (string gn in groupNames)
         {
             GROUP g = new GROUP();
             groupNamesTable.Add(gn, g);
         }
     }
 }
Beispiel #33
0
        public void UpdateGroupName(GROUP group)
        {
            using (var context = new OpletalovaDbEntities())
            {
                var dbGroup = context.GROUP.First(g => g.Id == group.Id);
                dbGroup.GroupName = group.GroupName;

                context.SaveChanges();
            }
        }