protected void gv_Transaction_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow row = (GridViewRow)((Control)e.CommandSource).NamingContainer; int id = Convert.ToInt32(gv_Transaction.DataKeys[row.RowIndex].Values[0]); string _FromEntityID =gv_Transaction.DataKeys[row.RowIndex].Values[1].ToString(); string _ToEntityID = gv_Transaction.DataKeys[row.RowIndex].Values[2].ToString(); using (DataEntryServiceClient _client = new DataEntryServiceClient()) { PeriodServiceClient _pclient = new PeriodServiceClient(); Period _period = new PeriodCollection(_pclient.GetCurrentPeriod())[0]; if (e.CommandName.Equals("Btn_Notice")) { _client.SetNotices(id, Convert.ToInt32(Session["Userid"])); GetData(_period); } else if (e.CommandName.Equals("Btn_Confirm")) { Transaction _tran = new TransactionCollection(_client.LoadTransactionByID(id))[0]; _tran.Updater.UserID = Convert.ToInt32(Session["Userid"]); _tran.Period = _period; _client.SetConfirm(_tran); GetData(_period); } else if (e.CommandName.Equals("Btn_Edit")) { Session["IsAdd"] = false; tx_FromEntity.Text = gv_Transaction.Rows[row.RowIndex].Cells[0].Text ; tx_ToEntity.Text = gv_Transaction.Rows[row.RowIndex].Cells[2].Text; tx_Amount.Text = gv_Transaction.Rows[row.RowIndex].Cells[5].Text; lb_FromEntityID.Text = _FromEntityID; lb_ToEntityID.Text = _ToEntityID; lb_FromCurrency.Text = gv_Transaction.Rows[row.RowIndex].Cells[1].Text; lb_ToCurrency.Text = gv_Transaction.Rows[row.RowIndex].Cells[3].Text; tx_ExchangeRate.Text = gv_Transaction.Rows[row.RowIndex].Cells[4].Text; btn_Confirm.Text = ""; lb_ID.Text = id.ToString(); up_Edit.Update(); Session["Rowindex"] = row.RowIndex; mp1.Show(); } gv_Transaction.Rows[row.RowIndex].BackColor = System.Drawing.ColorTranslator.FromHtml("#023e91"); } }