Exemplo n.º 1
0
        public void AddRow()
        {
            frmRaoHonPhoi frm = new frmRaoHonPhoi();

            frm.Operation = GxOperation.ADD;
            frm.UsePrint  = false;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (frm.DataReturn != null)
                {
                    DataTable tbl = Memory.GetData(string.Concat(SqlConstants.SELECT_RAOHONPHOI_LIST, " AND MaRaoHonPhoi=" + frm.DataReturn[RaoHonPhoiConst.MaRaoHonPhoi].ToString()));
                    if (tbl != null && tbl.Rows.Count > 0)
                    {
                        DataTable sourceTbl = (DataTable)this.DataSource;
                        if (sourceTbl != null)
                        {
                            sourceTbl.ImportRow(tbl.Rows[0]);
                            this.FindAll(this.RootTable.Columns[0], Janus.Windows.GridEX.ConditionOperator.Equal, tbl.Rows[0][RaoHonPhoiConst.MaRaoHonPhoi]);
                        }
                        else
                        {
                            this.DataSource = tbl;
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void EditRow(bool usePrint)
 {
     if (this.CurrentRow == null || ((this.CurrentRow.DataRow as DataRowView) != null))
     {
         DataRow       row = (this.CurrentRow.DataRow as DataRowView).Row;
         frmRaoHonPhoi frm = new frmRaoHonPhoi();
         frm.Operation    = GxOperation.EDIT;
         frm.UsePrint     = usePrint;
         frm.MaRaoHonPhoi = (int)row[RaoHonPhoiConst.MaRaoHonPhoi];
         if (frm.ShowDialog() == DialogResult.OK)
         {
             if (frm.DataReturn != null)
             {
                 DataTable tbl = Memory.GetData(string.Concat(SqlConstants.SELECT_RAOHONPHOI_LIST, " AND MaRaoHonPhoi=" + frm.DataReturn[RaoHonPhoiConst.MaRaoHonPhoi].ToString()));
                 if (Memory.ShowError())
                 {
                     return;
                 }
                 if (tbl != null && tbl.Rows.Count > 0)
                 {
                     foreach (DataColumn col in tbl.Columns)
                     {
                         if (row.Table.Columns.Contains(col.ColumnName))
                         {
                             row[col.ColumnName] = tbl.Rows[0][col.ColumnName];
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        public void XuatRaoHonPhoi()
        {
            if (this.CurrentRow == null || (this.CurrentRow.DataRow as DataRowView) == null)
            {
                return;
            }
            DataRow row = (this.CurrentRow.DataRow as DataRowView).Row;

            if ((bool)row[GiaoDanConst.DaCoGiaDinh])
            {
                if (MessageBox.Show("Giáo dân này đã từng lập gia đình.\r\nBạn có chắc muốn rao  hôn phối cho giáo dân này không?",
                                    "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No)
                {
                    return;
                }
            }
            frmRaoHonPhoi frm = new frmRaoHonPhoi();

            frm.CurrentRow = row;
            frm.UsePrint   = true;
            frm.ShowDialog();
        }