Example #1
0
        private void BtnChangeGroupName_Click(object sender, EventArgs e)
        {
            DataGridView gv = gridLetterGroup;

            if (gv.SelectedCells.Count <= 0)
            {
                return;
            }

            DataGridViewColumn col = gv.Columns[gv.SelectedCells[0].ColumnIndex];

            bool isAnySelected = col.DataGridView.SelectedCells.Count > 0 && gv.SelectedCells[0].Selected;

            if (!isAnySelected)
            {
                return;
            }
            DataGridViewRow dr      = gv.SelectedCells[0].OwningRow;
            int             groupId = int.Parse(dr.Cells[0].Value.ToString());

            LetterGroupEntity entity = _letterGroupBL.get(groupId);
            string            title  = entity.get(LetterGroupEntity.FIELD_GROUPTITLE).ToString();
            string            s      = Prompt.ShowDialog(title, "عنوان گروه");

            if (!"".Equals(s))
            {
                _letterGroupBL.updateTitle(groupId, s);
                fillGrid();
                fillLetterGrid();
            }
        }
Example #2
0
        private void addTitle()
        {
            LetterGroupEntity letterGroupEntity = _letterGroupBL.get(_groupId);
            string            title             = letterGroupEntity.get(LetterGroupEntity.FIELD_GROUPTITLE).ToString();

            txtTitle.Text = title;
        }
Example #3
0
        public LetterGroupEntity getById(int id)
        {
            LetterGroupEntity entity = new LetterGroupEntity();
            string            cond   = LetterGroupEntity.FIELD_ID + "=" + provider.getSQLString(id);

            return(get(entity, cond));
        }
Example #4
0
        public LetterGroupEntity get(string ids)
        {
            LetterGroupEntity entity = new LetterGroupEntity();
            string            cond   = LetterGroupEntity.FIELD_ID + " in (" + ids + ")";

            return(get(entity, cond));
        }
Example #5
0
        public LetterGroupEntity get()
        {
            LetterGroupEntity entity = new LetterGroupEntity();

            provider.loadToDataSet(entity);
            return(entity);
        }
Example #6
0
        private void btnSelectNewGroup_Click(object sender, EventArgs e)
        {
            if (txtNewGroupTitle.Text != null && txtNewGroupTitle.Text.Trim().Length > 0)
            {
                LetterGroupEntity   entity  = new LetterGroupEntity();
                System.Data.DataRow dataRow = entity.Tables[entity.TableName].NewRow();

                dataRow[LetterGroupEntity.FIELD_GROUPTITLE] = txtNewGroupTitle.Text;

                entity.Tables[entity.TableName].Rows.Add(dataRow);
                int id = _letterGroupBL.add(entity);
                _id = id;
                this.Close();
            }
        }
Example #7
0
        private void fillGrid(string cond)
        {
            LetterGroupEntity entity = null;

            if (UnselectIds != null && UnselectIds.Length > 0)
            {
                if (cond.Length > 0)
                {
                    cond += " AND ";
                }
                cond += LetterGroupEntity.FIELD_ID + " not in(" + UnselectIds + ")";
            }


            entity = _letterGroupBL.get(cond);

            System.Collections.Hashtable hash = new Hashtable();
            _gridTools.bindDataToGrid(dataGridView1, entity, null, hash);
        }
Example #8
0
 public int update(LetterGroupEntity entity)
 {
     return(((LetterGroupDA)_abstractDA).update(entity));
 }
Example #9
0
 public int add(LetterGroupEntity entity)
 {
     return(((LetterGroupDA)_abstractDA).add(entity));
 }
Example #10
0
        public LetterGroupEntity get(string cond)
        {
            LetterGroupEntity entity = new LetterGroupEntity();

            return(((LetterGroupDA)_abstractDA).get(entity, cond));
        }
Example #11
0
 public int update(LetterGroupEntity entity)
 {
     return(provider.update(entity));
 }
Example #12
0
 public int add(LetterGroupEntity letterGroupEntity)
 {
     return(provider.add(letterGroupEntity));
 }
Example #13
0
 public LetterGroupEntity get(LetterGroupEntity entity, string cond)
 {
     provider.loadToDataSet(entity, cond);
     return(entity);
 }