Ejemplo n.º 1
0
        private void btnOk_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            grdCompetitorView.FocusedRowHandle = grdCompetitorView.FocusedRowHandle + 1;
            DataTable     dt           = new DataTable();
            DataTable     dt_CompTrans = new DataTable();
            DataView      dv           = null;
            ProjectInfoBO CompBO       = new ProjectInfoBO();

            CompBO.i_CostCentreId = i_CostCentreId;

            dt_CompTrans = ProjectInfoDL.SelectCompetitorTrans(CompBO);

            for (int j = 0; j <= dt_CompTrans.Rows.Count - 1; j++)
            {
                ProjectInfoDL.DeleteCompetitor(CompBO);
            }

            if (Convert.ToBoolean(ChkEditComp.ValueChecked) == true)
            {
                dtCom.AcceptChanges();
                dv = new DataView(dtCom)
                {
                    RowFilter = "Sel='" + true + "'"
                };
                dt = dv.ToTable();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        CompBO.i_CompProjectId = Convert.ToInt32(dt.Rows[i]["ProjectId"].ToString());
                        ProjectInfoDL.InsertCompetitor(CompBO);
                    }
                }
            }
            Close();
        }
Ejemplo n.º 2
0
 public static void DeleteCompetitor(ProjectInfoBO CompBO)
 {
     ProjectInfoDL.DeleteCompetitor(CompBO);
 }