Ejemplo n.º 1
0
 void gridView_DoubleClick(object sender, EventArgs e)
 {
     DevExpress.XtraGrid.Views.Grid.GridView gv = sender as DevExpress.XtraGrid.Views.Grid.GridView;
     Point pt = gv.GridControl.PointToClient(MousePosition);
     DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo vi = gv.CalcHitInfo(pt);
     if (vi.InRowCell || vi.InRow)
     {
         var datarowitem = (BMS_DAL.DS.BMSDS.TFixturesRow)gv.GetDataRow(vi.RowHandle);
         datarowitem.OPER = BMS_Component.UserInfo.UserName;
         datarowitem.OP_DT = DateTime.Now;
         FixtureItem item = new FixtureItem();
         item.Text = "Update Fixture";
         item.DataRowItem = datarowitem;
         switch (item.ShowDialog())
         {
             case DialogResult.OK:
                 MessageBox.Show(string.Format("Update {0} rows", this._daService.UpdateFixtureWithRelation(this._bmsDS)));
                 this.RefreshData();
                 this.BindData();
                 break;
             case DialogResult.Cancel:
                 this._bmsDS.RejectChanges();
                 break;
         }
     }
 }
Ejemplo n.º 2
0
 void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
 {
     var datarowitem = this._bmsDS.TFixtures.NewTFixturesRow();
     datarowitem.VSL_ID = 1;
     datarowitem.CP_DATE = DateTime.Now;
     datarowitem.CP_TYPE = "VC";
     datarowitem.CP_DESC = string.Empty;
     datarowitem.PAYER = "OWR";
     datarowitem.HRORFRT = 0;
     datarowitem.DAYSORMT = 0;
     datarowitem.BRKRATE_OWR = 1.25M;
     datarowitem.BRKAMOUNT_OWR = 0;
     datarowitem.BRKRATE_CHR = 1.25M;
     datarowitem.BRKAMOUNT_CHR = 0;
     datarowitem.OWR = "OWR";
     datarowitem.CHR = "CHR";
     datarowitem.ESTBRK = 0;
     datarowitem.BROKER1 = "BROKER1";
     datarowitem.BROKER2 = "BROKER2";
     datarowitem.SIGNOPER = "OP";
     datarowitem.CAP_RATE = 0.5M;
     datarowitem.CAP_AMOUNT = 0;
     datarowitem.TFCB = 1;
     datarowitem.FIXNO = string.Format("P{0}", DateTime.Now.ToString("yyMMdd"));
     datarowitem.STATUS = "PROGRESS";
     datarowitem.REMARK = string.Empty;
     datarowitem.OPER = BMS_Component.UserInfo.UserName;
     datarowitem.OP_DT = DateTimeOffset.Now;
     FixtureItem item = new FixtureItem();
     item.Text = "Add Fixture";
     item.DataRowItem = datarowitem;
     this._bmsDS.TFixtures.AddTFixturesRow(datarowitem);
     switch (item.ShowDialog())
     {
         case DialogResult.OK:
             MessageBox.Show(string.Format("Add {0} rows", this._daService.UpdateFixtureWithRelation(this._bmsDS)));
             this.RefreshData();
             this.BindData();
             break;
         case DialogResult.Cancel:
             datarowitem = null;
             this._bmsDS.RejectChanges();
             break;
     }
 }