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(); } }
private void addTitle() { LetterGroupEntity letterGroupEntity = _letterGroupBL.get(_groupId); string title = letterGroupEntity.get(LetterGroupEntity.FIELD_GROUPTITLE).ToString(); txtTitle.Text = title; }
public LetterGroupEntity getById(int id) { LetterGroupEntity entity = new LetterGroupEntity(); string cond = LetterGroupEntity.FIELD_ID + "=" + provider.getSQLString(id); return(get(entity, cond)); }
public LetterGroupEntity get(string ids) { LetterGroupEntity entity = new LetterGroupEntity(); string cond = LetterGroupEntity.FIELD_ID + " in (" + ids + ")"; return(get(entity, cond)); }
public LetterGroupEntity get() { LetterGroupEntity entity = new LetterGroupEntity(); provider.loadToDataSet(entity); return(entity); }
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(); } }
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); }
public int update(LetterGroupEntity entity) { return(((LetterGroupDA)_abstractDA).update(entity)); }
public int add(LetterGroupEntity entity) { return(((LetterGroupDA)_abstractDA).add(entity)); }
public LetterGroupEntity get(string cond) { LetterGroupEntity entity = new LetterGroupEntity(); return(((LetterGroupDA)_abstractDA).get(entity, cond)); }
public int update(LetterGroupEntity entity) { return(provider.update(entity)); }
public int add(LetterGroupEntity letterGroupEntity) { return(provider.add(letterGroupEntity)); }
public LetterGroupEntity get(LetterGroupEntity entity, string cond) { provider.loadToDataSet(entity, cond); return(entity); }