protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Edit") { base.Response.Redirect("ExpertsPredictEdit.aspx?ID=" + e.Item.Cells[6].Text, true); } }
protected void dgv_total_ItemCommand(object source, DataGridCommandEventArgs e) { try { //Select in grid if (e.Item.DataSetIndex >= 0) { try { string client_code = e.Item.Cells[0].Text.Trim(); Load_Data_Details(client_code); } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "Error in dgv_total_ItemCommand!!! (1) \n" + ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message); //Response.Write("<script>alert('Error when executing coding')</script>"); Alert.Show("Error in dgv_total_ItemCommand!!! (1) \n" + ex.ToString(), this); #endregion logException } } } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), "Error in DataGrid1_ItemCommand!!! (2) \n" + ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message); //Response.Write("<script>alert('Error when executing coding')</script>"); Alert.Show("Error in DataGrid1_ItemCommand!!! (2) \n" + ex.ToString(), this); #endregion logException } }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "btnOK") { int num = _Convert.StrToInt(e.Item.Cells[5].Text, -1); int num2 = _Convert.StrToInt(e.Item.Cells[6].Text, -1); int num3 = _Convert.StrToInt(((TextBox)e.Item.Cells[2].FindControl("tbSystemEndAheadMinute")).Text, -1); int num4 = _Convert.StrToInt(((TextBox)e.Item.Cells[3].FindControl("tbChaseExecuteDeferMinute")).Text, -1); if (num3 < 2) { JavaScript.Alert(this.Page, "提前截止分钟数最少必须 2 分钟,否则系统执行可能会因时间过短而不能及时处理,导致数据错误!"); } else { string str = e.Item.Cells[7].Text.Replace(" ", "").Trim(); if ((str != "") && (num4 < 1)) { JavaScript.Alert(this.Page, "追号任务自动执行必须在开始时间后最少 1 分钟!"); } else if (new Tables.T_PlayTypes { SystemEndAheadMinute = { Value = num3 } }.Update("[ID] = " + num.ToString()) < 0L) { PF.GoError(4, "数据库繁忙,请重试", "Admin_LotteryTimeSet"); } else if ((str != "") && (MSSQL.ExecuteNonQuery("update T_Lotteries set ChaseExecuteDeferMinute = " + num4.ToString() + " where [ID] = " + num2.ToString(), new MSSQL.Parameter[0]) < 0)) { PF.GoError(4, "数据库繁忙,请重试", "Admin_LotteryTimeSet"); } else { this.BindData(); JavaScript.Alert(this.Page, "保存成功。"); } } } }
protected void DataGridbound_DeleteCommand(object source, DataGridCommandEventArgs e) { int t_index = DataGridbound.CurrentPageIndex; DataView t_dvTemp = (DataView)this.SqlDataSourceNews.Select(DataSourceSelectArguments.Empty); DataTable t_tableTemp = t_dvTemp.ToTable(); string t_idNumber = t_tableTemp.Rows[t_index*10+e.Item.ItemIndex][0].ToString(); string t_sqlconnectstr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; SqlConnection t_connect; try { t_connect = new SqlConnection(t_sqlconnectstr); t_connect.Open(); } catch (System.Exception ex) { throw ex; } string t_str_sqlcommand = "DELETE FROM TableNews WHERE (id='$idNum$')"; t_str_sqlcommand = t_str_sqlcommand.Replace("$idNum$", t_idNumber); SqlCommand t_Command = new SqlCommand(t_str_sqlcommand, t_connect); t_Command.ExecuteReader(); Response.Write("<Script language='javascript'>window.top.location.href='NewsManage.aspx';</Script>"); }
public void Grid_CartCommand(Object sender, DataGridCommandEventArgs e) { string name = e.Item.Cells[1].Text; string op = e.Item.Cells[2].Text; int err; if ("Add".Equals(((Button)e.CommandSource).CommandName)) { if ("新增".Equals(op) && College_Key.IsExist(name)) { Response.Write("<script>window.alert('该关键词已经存在。');</script>"); return; } err = College_Key.AuditAccept(name, op); } else err = College_Key.AuditReject(name, op); if (err == 1) { ItemsGrid.DataSource = CreateDataSource(); ItemsGrid.DataBind(); e.Item.Cells[3].Enabled = false; Response.Write("<script>window.alert('操作成功。');</script>"); } else Response.Write("<script>window.alert('通过或拒绝关键词的操作出错。');</script>"); }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Edit") { base.Response.Redirect("SiteAffichesEdit.aspx?id=" + e.Item.Cells[5].Text, true); } else if (e.CommandName == "Del") { int returnValue = -1; string returnDescription = ""; if (Procedures.P_SiteAfficheDelete(base._Site.ID, long.Parse(e.Item.Cells[5].Text), ref returnValue, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", "Admin_SiteAffiches"); } else if (returnValue < 0) { PF.GoError(1, returnDescription, "Admin_SiteAffiches"); } else { Shove._Web.Cache.ClearCache("SiteAffiches"); Shove._Web.Cache.ClearCache("Default_GetSiteAffiches"); this.BindData(); } } }
public void grdCOSOV_CancelCommand(object sender, DataGridCommandEventArgs e) { //'grdSOV_CancelCommand' grdCOSOV.ShowFooter = true; grdCOSOV.EditItemIndex = -1; this.DisplayCOSOVGrid(); }
public void grdEmpl_Itemcommand(Object sender, DataGridCommandEventArgs e) { String loginid = ""; DataSet dsExpand = new DataSet(); WhitfieldPayroll _dbClass = new WhitfieldPayroll(); switch (e.CommandName) { case "Expand": { loginid = Convert.ToString(grdEmpl.DataKeys[e.Item.ItemIndex]); dsExpand = _dbClass.GetPayRollProjectHoursForEmployee(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); PlaceHolder exp = new PlaceHolder(); exp = (System.Web.UI.WebControls.PlaceHolder)e.Item.Cells[7].FindControl("ExpandedContent"); ImageButton img = new ImageButton(); img = (System.Web.UI.WebControls.ImageButton)e.Item.Cells[0].FindControl("btnExpand"); if (dsExpand.Tables[0].Rows.Count > 0) { if (img.ImageUrl == "assets/img/Plus.gif") { img.ImageUrl = "assets/img/Minus.gif"; exp.Visible = true; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = true; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).DisplayGrid(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); } else { exp.Visible = false; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = false; img.ImageUrl = "assets/img/Plus.gif"; } } else { if (img.ImageUrl == "assets/img/Plus.gif") { //((ViewDesignAdmin)(e.Item.FindControl("DynamicTable1"))).Visible = true; img.ImageUrl = "assets/img/Minus.gif"; exp.Visible = true; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = true; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).DisplayGrid(loginid, txtFromDate.Text.Trim(), txtToDate.Text.Trim()); } else { exp.Visible = false; ((Whitfield_Payroll_ByProject)(e.Item.FindControl("DynamicTable1"))).Visible = false; img.ImageUrl = "assets/img/Plus.gif"; } } break; } default: { break; } } }
protected void dgvAccount_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.Item.DataSetIndex >= 0) { try { string cr_acc_nbr = ""; //xác định vị trí của row // Button3.Enabled = true; cr_acc_nbr = e.Item.Cells[3].Text; //lbSource_no.Text = source_no; // Loadreport(cr_acc_nbr); load_data(cr_acc_nbr); } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message); //Response.Write("<script>alert('Error when executing coding')</script>"); Alert.Show("Error when executing coding!!!", this); #endregion logException } } }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Edit") { base.Response.Redirect("AdvertisementsEdit.aspx?ID=" + e.Item.Cells[6].Text + "&LotteryID=" + this.ddlLotteries.SelectedValue + "&TypeID=" + this.ddlType.SelectedValue, true); } }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "QuashIsuse") { int num = _Convert.StrToInt(e.Item.Cells[10].Text, 0); if (num < 1) { PF.GoError(7, "找不到追号记录", base.GetType().FullName); } else { string returnDescription = ""; int num2 = base._User.QuashChaseTaskDetail((long)num, false, ref returnDescription); if ((returnDescription != "") || (num2 != 0)) { PF.GoError(4, returnDescription, base.GetType().FullName); } else { int chaseID = _Convert.StrToInt(this.labChase_id.Text, 0); if (chaseID < 1) { PF.GoError(7, "没有记录!", base.GetType().FullName); } else { this.BindData(chaseID); } } } } }
public void grid_ItemCommand(object source, DataGridCommandEventArgs e) { try { switch(e.CommandName) { case "Delete": SessionManager.BlogService.DeleteHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString())); SessionManager.Invalidate<TransitHighlight>(); ReportInfo("Item Deleted"); GetData(source, e); break; case "Up": SessionManager.BlogService.MoveHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()), -1); SessionManager.Invalidate<TransitHighlight>(); GetData(source, e); break; case "Down": SessionManager.BlogService.MoveHighlight(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString()), 1); SessionManager.Invalidate<TransitHighlight>(); GetData(source, e); break; } } catch(Exception ex) { ReportException(ex); } }
public void gridLookup_ItemCommand(object sender, DataGridCommandEventArgs e) { switch (e.CommandName) { case "Impersonate": int id = int.Parse(e.CommandArgument.ToString()); if (SessionManager.AccountId == id) { throw new Exception("You cannot impersonate self."); } if (!SessionManager.IsAdministrator) { // avoid round-trip throw new Exception("You must be an administrator to impersonate users."); } if (SessionManager.IsImpersonating) { throw new Exception("You're already impersonating a user."); } SessionManager.Impersonate(SessionManager.AccountService.Impersonate( SessionManager.Ticket, id)); Response.Redirect("AccountView.aspx"); break; } }
protected void DataGrid1_ItemCommand1(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); UserInfoOperator.Delete(id); WebTools.Alert(this, "删除成功!"); this.SimplePager1.Changed = true; } else if (e.CommandName == "Detail") { int id = Convert.ToInt32(e.CommandArgument); this.Pop(id); } else if (e.CommandName == "ResetPwd") { int id = Convert.ToInt32(e.CommandArgument); bool result = UserInfoOperator.ResetPwd(id, ConfigurationManager.AppSettings["DefaultPassword"].ToString()); if (result) WebTools.Alert(this, "密码重置成功!"); else WebTools.Alert(this, "密码重置失败!"); } }
protected void dgLists_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Delete") { int id = Convert.ToInt32(e.CommandArgument); FT.DAL.DataAccessFactory.GetDataAccess().ExecuteSql("delete from yuantuo_terminals where id=" + id); WebTools.Alert(this, "删除成功!"); TerminalOnlineMonitorThread.InitTerminalList(); this.ProcedurePager1.Changed = true; } else if (e.CommandName == "Detail") { int id = Convert.ToInt32(e.CommandArgument); this.Pop(id); } else if (e.CommandName == "Open") { int id = Convert.ToInt32(e.CommandArgument); TerminalEntity entity = SimpleOrmOperator.Query<TerminalEntity>(id); FT.Commons.Tools.WindowExHelper.WakeUp(entity.MachineMac); WebTools.Alert(this,"已给终端"+entity.MachineName+"发送开机命令,请稍等片刻!!!"); } else if (e.CommandName == "Close") { int id = Convert.ToInt32(e.CommandArgument); TerminalEntity entity = SimpleOrmOperator.Query<TerminalEntity>(id); WholeBllTools.CloseComputer(entity.MachineIp); WebTools.Alert(this, "已给终端" + entity.MachineName + "发送关机命令,请稍等片刻!!!"); // FT.Commons.Tools.WindowExHelper.WakeUp(entity.MachineMac); } }
public void gridManage_ItemCommand(object sender, DataGridCommandEventArgs e) { switch (e.CommandName) { case "Delete": { int id = int.Parse(e.Item.Cells[(int)Cells.id].Text); SessionManager.Delete<TransitAccountFeed>(id, SessionManager.SyndicationService.DeleteAccountFeed); ReportInfo("Feed deleted."); GetData(sender, e); } break; case "Update": { int id = int.Parse(e.Item.Cells[(int)Cells.id].Text); int item_count = SessionManager.SyndicationService.UpdateAccountFeedItems(SessionManager.Ticket, id); int image_count = SessionManager.SyndicationService.UpdateAccountFeedItemImgs(SessionManager.Ticket, id); int media_count = SessionManager.SyndicationService.UpdateAccountFeedItemMedias(SessionManager.Ticket, id); SessionManager.InvalidateCache<TransitAccountFeedItem>(); SessionManager.InvalidateCache<TransitAccountFeedItemImg>(); SessionManager.InvalidateCache<TransitAccountFeedItemMedia>(); StringBuilder s = new StringBuilder("Feed updated with "); s.AppendFormat("{0} new item{1}", item_count, item_count == 1 ? string.Empty : "s"); s.AppendFormat(", {0} new image{1}", image_count, image_count == 1 ? string.Empty : "s"); s.AppendFormat(" and {0} new media item{1}.", media_count, media_count == 1 ? string.Empty : "s"); ReportInfo(s.ToString()); gridManage_OnGetDataSource(sender, e); gridManage.DataBind(); } break; } }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Cancel") { if (base._User == null) { JavaScript.Alert(this, "已退出登陆,请重新登陆", base.Request.Url.AbsoluteUri); } else { int num = _Convert.StrToInt(e.Item.Cells[6].Text, -1); if (num < 0) { JavaScript.Alert(this, "取消定制失败!"); } else if (MSSQL.ExecuteNonQuery("delete from T_CustomFriendFollowSchemes where FollowUserID = " + num.ToString() + " and UserID = " + base._User.ID.ToString(), new MSSQL.Parameter[0]) < 0) { JavaScript.Alert(this, "取消定制失败!"); } else { Shove._Web.Cache.ClearCache("T_CustomFriendFollowSchemes" + this.HidLotteryID.Value); this.BindData(); JavaScript.Alert(this, "取消定制成功!"); } } } }
protected void g1_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Del") { long ID = Shove._Convert.StrToLong(e.Item.Cells[5].Text, 0); if (MSSQL.ExecuteNonQuery("update T_StationSMS set isShow = 0 where [ID] = " + ID.ToString()) < 0) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Room_Message"); return; } Shove._Web.Cache.ClearCache("MemberMessage_System" + _User.ID.ToString()); BindDataForSystemMessage(); return; } else if (e.CommandName == "View") { long ID = Shove._Convert.StrToLong(e.Item.Cells[5].Text, 0); Response.Redirect("ViewMessage.aspx?ID=" + ID); } }
public void grid_ItemCommand(object source, DataGridCommandEventArgs e) { try { switch(e.CommandName) { case "Delete": SessionManager.BlogService.DeleteFeed(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString())); SessionManager.Invalidate<TransitFeed>(); ReportInfo("Item Deleted"); GetData(source, e); break; case "Update": int count = SessionManager.BlogService.UpdateFeed(SessionManager.Ticket, int.Parse(e.CommandArgument.ToString())); ReportInfo(string.Format("Feed Updated With {0} New Item(s)", count)); SessionManager.Invalidate<TransitFeed>(); grid_OnGetDataSource(source, e); grid.DataBind(); break; } } catch(Exception ex) { ReportException(ex); } }
protected void dgCoaches_ItemCommand(object source, DataGridCommandEventArgs e) { Label lbl = (Label)e.Item.FindControl("lblid"); id = int.Parse(lbl.Text); ServiceReference1.Service1Client sv = new ServiceReference1.Service1Client(); ServiceReference1.get_Coach_By_ID_Result coaches = sv.Get_Coach_By_ID(id); // get train name string trainname = sv.get_Train_By_ID(int.Parse(coaches.Train_ID.ToString())).Train_Name; // show data ddlTrainName.SelectedValue = coaches.Train_ID.ToString(); ddlCoachesType.SelectedItem.Text = coaches.Coach_Type; txtSeats.Text = coaches.Number_Of_Seats.ToString(); _train_id = int.Parse(coaches.Train_ID.ToString()); txtPrices.Text = coaches.Price.ToString(); if (coaches.Status.ToString() == "Active") { RadioButton1.Checked = true; RadioButton2.Checked = false; } else { RadioButton2.Checked = true; RadioButton1.Checked = false; } ddlTrainName.Enabled = false; ddlCoachesType.Enabled = false; btnUpdate.Visible = true; btnDelete.Visible = true; btnCancel.Visible = true; btnAdd.Visible = false; }
protected void dgvAccount_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.Item.DataSetIndex >= 0) { try { ClearDetail(); Button3.Enabled = true; string source_no = ""; //xác định vị trí của row Panel1.Visible = true; source_no = e.Item.Cells[1].Text; //tbType string type=e.Item.Cells[10].Text; tbType.Text = type; LoadDetails(source_no,type); } catch (Exception ex) { #region logException executedb.WriteLogERROR(Session["Username"].ToString(), "IP: " + Request.UserHostAddress, this.Page.ToString(), System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex.Message); //executedb.WriteLogPri(Environment.NewLine + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + " - " + Session["Username"].ToString() + ": " + ex.Message); //Response.Write("<script>alert('Error when executing coding')</script>"); Alert.Show("Error when executing coding!!!", this); #endregion logException } } }
public void grdpl1_DeleteCommand(object sender, DataGridCommandEventArgs e) { String DetailId = ""; DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfieldcore _dbClass = new Whitfieldcore(); _dbClass.DeleteSubMaterials(Convert.ToInt32(DetailId)); this.DisplayGrid(Convert.ToInt32(ViewState["material_id"].ToString())); }
public void grdManPower_DeleteCommand(object sender, DataGridCommandEventArgs e) { whitfielduser _wRep = new whitfielduser(); String worker_id = ""; worker_id = grdManPower.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); _wRep.DeleteWorkerRecord(worker_id); this.DisplayManPowerGrid(); }
public void grdEstimateMaterials_CancelCommand(object sender, DataGridCommandEventArgs e) { contingency _wc = new contingency(); grdEstimateMaterials.ShowFooter = true; grdEstimateMaterials.EditItemIndex = -1; DataSet dsGridResults = _wc.FetchTermsData(); PopulateDataGrid(dsGridResults, grdEstimateMaterials); }
protected void dgEventos_ItemCommand(object sender, DataGridCommandEventArgs e) { if (e.CommandName == "Horarios") { Label lblEventoId = (Label)e.Item.FindControl("lblEventoId"); Response.Redirect("~/Common/DetalhesEvento.aspx?Evento=" + lblEventoId.Text); } }
public void grdEstimateMaterials_EditCommand(object sender, DataGridCommandEventArgs e) { contingency _wc = new contingency(); grdEstimateMaterials.ShowFooter = false; grdEstimateMaterials.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex); DataSet dsGridResults = _wc.FetchTermsData(); PopulateDataGrid(dsGridResults, grdEstimateMaterials); }
public void grd1_EditCommand(object sender, DataGridCommandEventArgs e) { contingency _wc = new contingency(); grd1.ShowFooter = false; grd1.EditItemIndex = Convert.ToInt32(e.Item.ItemIndex); DataSet dsGridResults = _wc.FetchSubContingencyData(Convert.ToInt32(ViewState["cont_id"].ToString())); PopulateDataGrid(dsGridResults, grd1); }
protected void Dglogin_DeleteCommand(object source, DataGridCommandEventArgs e) { string s = (((Label)e.Item.FindControl("lblRollno")).Text); SqlCommand cmd = new SqlCommand("delete from StudentDetails where Rollno='" + s.ToString() + "'", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); bindgrid(); }
protected void g_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Edit") { base.Response.Redirect("NewsEdit.aspx?TypeID=" + this.tv.SelectedValue + "&ID=" + e.Item.Cells[8].Text, true); } else if (e.CommandName == "Del") { int returnValue = -1; string returnDescription = ""; if (Procedures.P_NewsDelete(base._Site.ID, long.Parse(e.Item.Cells[8].Text), ref returnValue, ref returnDescription) < 0) { PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName); } else if (returnValue < 0) { PF.GoError(1, returnDescription, base.GetType().BaseType.FullName); } else { if (this.tv.SelectedNode.Text == "时时乐资讯") { Shove._Web.Cache.ClearCache(DataCache.LotteryNews + "29"); } if (this.tv.SelectedNode.Text == "十一运夺金资讯") { Shove._Web.Cache.ClearCache(DataCache.LotteryNews + "62"); } if (this.tv.SelectedNode.Text == "热门人物追踪") { Shove._Web.Cache.ClearCache("Home_Room_JoinAllBuy_BindNews"); } string str2 = this.tv.SelectedNode.Text.Trim(); switch (str2) { case "福彩资讯": case "体彩资讯": case "足彩资讯": Shove._Web.Cache.ClearCache("Default_GetNews"); break; } if (str2.Contains("3D")) { Shove._Web.Cache.ClearCache("Home_Room_Buy_BindNewsForLottery6"); } if (str2.Contains("双色球")) { Shove._Web.Cache.ClearCache("Home_Room_Buy_BindNewsForLottery5"); } if (str2.Contains("玩法攻略")) { Shove._Web.Cache.ClearCache("Default_BindWFGL"); } this.BindData(); } } }
public void grdpl1_UpdateCommand(object sender, DataGridCommandEventArgs e) { String DetailId = grdpl1.DataKeys[Convert.ToInt32(e.Item.ItemIndex)].ToString(); Whitfieldcore _dbClass = new Whitfieldcore(); _dbClass.UPDATESubMaterials(Convert.ToInt32(DetailId), ((TextBox)(e.Item.FindControl("txtthickness"))).Text, ((TextBox)(e.Item.FindControl("txtlength"))).Text, ((TextBox)(e.Item.FindControl("txtweight"))).Text, ((TextBox)(e.Item.FindControl("txtwidth"))).Text, ((TextBox)(e.Item.FindControl("txtDescription"))).Text, ((TextBox)(e.Item.FindControl("txtCost"))).Text, Convert.ToInt32(((DropDownList)(e.Item.FindControl("ddlUOM"))).SelectedItem.Value), ((RadioButtonList)(e.Item.FindControl("chkLEED"))).SelectedItem.Value, ((TextBox)(e.Item.FindControl("txtManufacturer"))).Text, ((RadioButtonList)(e.Item.FindControl("chkFSC"))).SelectedItem.Value, ((TextBox)(e.Item.FindControl("txtMaterial_Code"))).Text, ((TextBox)(e.Item.FindControl("txtNotes"))).Text, ((RadioButtonList)(e.Item.FindControl("chkDefault_Field"))).SelectedItem.Value); grdpl1.EditItemIndex = -1; grdpl1.ShowFooter = true; this.DisplayGrid(Convert.ToInt32(ViewState["material_id"].ToString())); }
protected void gvResult_CancelCommand(object source, DataGridCommandEventArgs e) { this.gvResult.EditItemIndex = -1; Session.Remove("AnnouncementEditItemIndex"); this.BindData(); }
protected void gvResult_EditCommand(object source, DataGridCommandEventArgs e) { this.gvResult.EditItemIndex = e.Item.ItemIndex; Session["AnnouncementEditItemIndex"] = e.Item.ItemIndex; this.BindData(); }
protected void dgcart_EditCommand(object source, DataGridCommandEventArgs e) { dgcart.EditItemIndex = e.Item.ItemIndex; HienThi(); }
// Delete selected item void dgList_DeleteCommand(object source, DataGridCommandEventArgs e) { OccurrenceTypeAttribute.Delete(Int32.Parse(e.Item.Cells[0].Text)); ShowList(); }
protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e) { }
public void dgResolutionTime_Update(object sender, DataGridCommandEventArgs e) { try { Label lblresolutionID = ((Label)e.Item.FindControl("lblresolutionID")); objclsResolutionTime.ResolutionID = Convert.ToInt32(lblresolutionID.Text.Trim()); DropDownList ddlcategory1 = ((DropDownList)e.Item.FindControl("ddlcategory1")); objclsResolutionTime.CategoryID = Convert.ToInt32(((DropDownList)e.Item.FindControl("ddlcategory1")).SelectedValue); DropDownList ddlsubCategorymaster = ((DropDownList)e.Item.FindControl("ddlsubCategorymaster")); objclsResolutionTime.SubCategoryID = Convert.ToInt32(((DropDownList)e.Item.FindControl("ddlsubCategorymaster")).SelectedValue); DropDownList ddlseveritymaster = ((DropDownList)e.Item.FindControl("ddlseveritymaster")); objclsResolutionTime.ProblemSeverityId = Convert.ToInt32(((DropDownList)e.Item.FindControl("ddlseveritymaster")).SelectedValue); TextBox txtgreen1 = ((TextBox)e.Item.FindControl("txtgreen1")); objclsResolutionTime.ResolutionForGreen = txtgreen1.Text.Trim(); TextBox txtamber1 = ((TextBox)e.Item.FindControl("txtamber1")); objclsResolutionTime.ResolutionForAmber = txtamber1.Text.Trim(); dsDuplicateResolution = objclsBLResolutionTime.IsDuplicateResolution(objclsResolutionTime); // Validation for enter Duplcate values if (dsDuplicateResolution.Tables[0].Rows.Count > 0) { lblError.Text = "Don't Enter Duplicate Data"; } //validation for Text Boxes else if (txtgreen1.Text.Trim() == "") { lblError.Text = "Please enter an integer value for green resolution"; } else if (txtgreen1.Text.Trim() != "") { string txtgreen2 = txtgreen1.Text.Trim(); for (int i = 0; i < txtgreen2.Length; i++) { if (!char.IsNumber(txtgreen2[i])) { lblError.Text = "Enter Interger value for green resolution"; return; //break; } } string strGreen = txtgreen1.Text.Trim(); if (strGreen.StartsWith("0") || strGreen.StartsWith("1") || strGreen.StartsWith("2") || strGreen.StartsWith("3") || strGreen.StartsWith("4") || strGreen.StartsWith("5") || strGreen.StartsWith("6") || strGreen.StartsWith("7") || strGreen.StartsWith("8") || strGreen.StartsWith("9")) { objclsResolutionTime.ResolutionForGreen = strGreen; if (txtamber1.Text.Trim() == "") { lblError.Text = "Please enter resolution for amber"; bindResolutionTime(); } else if (txtamber1.Text.Trim() != "") { //if (Convert.ToInt32(txtamber1.Text) < 0 && Convert.ToInt32(txtamber1.Text) > 9) //{ //} //else // { string txtamber2 = txtamber1.Text.Trim(); for (int i = 0; i < txtamber2.Length; i++) { if (!char.IsNumber(txtamber2[i])) { lblError.Text = "Enter Interger value for amber resolution"; return; //break; } } string strAmber = txtamber1.Text.Trim(); if (strAmber.StartsWith("0") || strAmber.StartsWith("1") || strAmber.StartsWith("2") || strAmber.StartsWith("3") || strAmber.StartsWith("4") || strAmber.StartsWith("5") || strAmber.StartsWith("6") || strAmber.StartsWith("7") || strAmber.StartsWith("8") || strAmber.StartsWith("9")) { objclsResolutionTime.ResolutionForAmber = strAmber; if (Convert.ToInt32(txtgreen1.Text.Trim()) >= Convert.ToInt32(txtamber1.Text.Trim())) { lblError.Text = "Your value is less than/same Resolution for Green. Please enter correct value "; } else { lblError.Text = ""; objclsBLResolutionTime.updateResolutionTime(objclsResolutionTime); dgResolutionTime.EditItemIndex = -1; bindResolutionTime(); } } else { lblError.Text = "Enter Interger value for amber resolution"; } } //} } else { lblError.Text = "Enter Interger value for green resolution"; } } /*else * { * lblError.Text=""; * //objclsBLResolutionTime.updateResolutionTime (objclsResolutionTime); * dgResolutionTime.EditItemIndex=-1; * bindResolutionTime(); * }*/ isEdit = true; } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ResolutionTimeMaster.aspx", "dgResolutionTime_Update", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
protected void RedirectionsListItemCommand(object source, DataGridCommandEventArgs e) { // Perform Item Action RedirectionItemAction(source, e); Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(), true); }
protected void dgApprovalLevel_CancelCommand1(object source, DataGridCommandEventArgs e) { this.dgApprovalLevel.EditItemIndex = -1; BindApprovalLevels(); }
protected void dgCashPaymentDetail_CancelCommand(object source, DataGridCommandEventArgs e) { this.dgCashPaymentDetail.EditItemIndex = -1; }
protected void dgCashPaymentDetail_EditCommand(object source, DataGridCommandEventArgs e) { this.dgCashPaymentDetail.EditItemIndex = e.Item.ItemIndex; BindCashPaymentDetails(); //BindCarRentals(); }
protected void DataGrid_Delete(Object sender, DataGridCommandEventArgs E) { int id = Utils.StrToInt(DataGrid1.DataKeys[E.Item.ItemIndex].ToString(), 0); DataGrid1.DeleteByString(DatabaseProvider.GetInstance().DeleteSmily(id)); }
protected void dgItemSubCategory_CancelCommand(object source, DataGridCommandEventArgs e) { this.dgItemSubCategory.EditItemIndex = -1; }
protected void grdCampaignFields_DeleteRecord(object source, DataGridCommandEventArgs e) { Campaign objCampaign; if (Session["Campaign"] != null) { objCampaign = (Campaign)Session["Campaign"]; anchHome.InnerText = objCampaign.Description;// Replaced Short description if (IsCampaignRunning()) { Isrunning = true; } } if (Isrunning) { PageMessage = "Fields may not be changed while the campaign is running. Please stop the campaign and try again."; return; } // Update the database here try { if (Session["Campaign"] != null) { // we have an existing campaign currentCampaign = (Campaign)Session["Campaign"]; } string strOriginalFieldName = ""; dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = string.Format("SELECT FieldName FROM CampaignFields WHERE FieldID = {0}", e.Item.Cells[7].Text); DataView dv1 = (DataView)dsMainGrid.Select(DataSourceSelectArguments.Empty); DataRow dr = dv1.Table.Rows[0]; strOriginalFieldName = dr["FieldName"].ToString(); // Udelete the field in the campaign table StringBuilder sbSqlStmt2 = new StringBuilder(); sbSqlStmt2.AppendFormat("ALTER TABLE Campaign DROP COLUMN {0}", strOriginalFieldName); string sqlStmt = sbSqlStmt2.ToString(); ActivityLogger.WriteAdminEntry(currentCampaign, "Change columns Statement to Execute: '{0}'", sqlStmt); dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = sqlStmt; dsMainGrid.Select(DataSourceSelectArguments.Empty); StringBuilder sbSqlStmt = new StringBuilder(); sbSqlStmt.AppendFormat("DELETE FROM CampaignFields "); sbSqlStmt.AppendFormat(" WHERE FieldID = {0}", e.Item.Cells[7].Text); sqlStmt = sbSqlStmt.ToString(); ActivityLogger.WriteAdminEntry(currentCampaign, "Delete statement to execute: '{0}'", sqlStmt); dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = sqlStmt; dsMainGrid.Select(DataSourceSelectArguments.Empty); string sortDirection = (string)Session["SortDir"]; string sortQueryAppend = ""; if (Session["SortExp"] != null) { if (Session["SortExp"].ToString().Length > 0) { sortQueryAppend = string.Format(" ORDER BY {0} {1}", Session["SortExp"].ToString(), sortDirection); } } grdCampaignFields.EditItemIndex = -1; BindDataGrid(sortQueryAppend); } catch (Exception ex) { PageMessage = "Exception deleting record: " + ex.Message; } }
/// <summary> /// This handles various commands for the data grid /// </summary> /// <param name="source">The source of the event</param> /// <param name="e">The event arguments</param> protected void dgHolidays_ItemCommand(object source, DataGridCommandEventArgs e) { HolidayCollection hc; switch (e.CommandName) { case "Add": // Save changes to the edited item if there is one if (dgHolidays.EditItemIndex != -1) { dgHolidays_UpdateCommand(source, new DataGridCommandEventArgs( dgHolidays.Items[dgHolidays.EditItemIndex], e.CommandSource, e)); } // Ignore the request if the page is not valid if (!Page.IsValid) { return; } // Add a new holiday and go into edit mode on it hc = (HolidayCollection)Session["Holidays"]; hc.AddFixed(DateTime.Today.Month, DateTime.Today.Day, true, String.Empty); dgHolidays.EditItemIndex = hc.Count - 1; dgHolidays.DataSource = hc; dgHolidays.DataBind(); break; case "Clear": // Clear all holidays hc = (HolidayCollection)Session["Holidays"]; hc.Clear(); dgHolidays.EditItemIndex = -1; dgHolidays.DataSource = hc; dgHolidays.DataBind(); break; case "Default": // Revert to the default set hc = (HolidayCollection)Session["Holidays"]; hc.Clear(); hc.AddStandardHolidays(); dgHolidays.EditItemIndex = -1; dgHolidays.DataSource = hc; dgHolidays.DataBind(); break; case "Download": // Save changes to the edited item if there is one if (dgHolidays.EditItemIndex != -1) { dgHolidays_UpdateCommand(source, new DataGridCommandEventArgs( dgHolidays.Items[dgHolidays.EditItemIndex], e.CommandSource, e)); } // Ignore the request if the page is not valid if (!Page.IsValid) { return; } hc = (HolidayCollection)Session["Holidays"]; // Send the file to the user as XML this.Response.ClearContent(); this.Response.ContentType = "text/xml"; this.Response.AppendHeader("Content-Disposition", "inline;filename=Holidays.xml"); XmlSerializer xs = new XmlSerializer(typeof(HolidayCollection)); xs.Serialize(Response.OutputStream, hc); Response.End(); break; } }
//直接拷贝过去,放在自身页执行,也可。 protected void myManageGrid_DeleteCommand(object source, DataGridCommandEventArgs e) { //DeleteById(ManageTable, ManageKey, DataConvert.GetInt32(e.Item.Cells[0].Text)); }
protected void dgItemSubCategory_EditCommand(object source, DataGridCommandEventArgs e) { this.dgItemSubCategory.EditItemIndex = e.Item.ItemIndex; BindItemSubCategory(); }
protected void dghomework_UpdateCommand(object source, DataGridCommandEventArgs e) { Response.Redirect("homeworkdetails.aspx?hid=" + e.Item.Cells[0].Text + "&hwf=" + e.Item.Cells[1].Text); }
protected void grdCampaignFields_UpdateRecord(object source, DataGridCommandEventArgs e) { try { // Update the database here if (Session["Campaign"] != null) { // we have an existing campaign currentCampaign = (Campaign)Session["Campaign"]; } string sqlStmt = ""; string strOriginalFieldName = ""; string strOriginalLength = ""; dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = string.Format("SELECT FieldName, FieldTypeID, Value FROM CampaignFields WHERE FieldID = {0}", ((TextBox)e.Item.Cells[e.Item.Cells.Count - 1].Controls[0]).Text); DataView dv1 = (DataView)dsMainGrid.Select(DataSourceSelectArguments.Empty); DataRow dr = dv1.Table.Rows[0]; strOriginalFieldName = dr["FieldName"].ToString(); strOriginalLength = dr["Value"].ToString(); StringBuilder sbSqlStmt = new StringBuilder(); sbSqlStmt.AppendFormat("UPDATE CampaignFields SET "); // *** CHeck how nulls will work ... alert? EMpty string? // Formatting as sql string types for now ... handle data types? if (((TextBox)e.Item.Cells[2].Controls[0]).Text.Length > 0) { sbSqlStmt.AppendFormat("FieldName = '{0}', ", ((TextBox)e.Item.Cells[2].Controls[0]).Text); } else { PageMessage = "Field Name cannot be blank. Please enter a name."; return; } sbSqlStmt.AppendFormat("FieldTypeID = {0}, ", ((DropDownList)e.Item.Cells[3].Controls[1]).SelectedValue); if (((CheckBox)e.Item.Cells[5].Controls[1]).Checked) { sbSqlStmt.AppendFormat("ReadOnly = 1"); } else { sbSqlStmt.AppendFormat("ReadOnly = 0"); } // Update the field name if it has changed if (strOriginalFieldName != ((TextBox)e.Item.Cells[2].Controls[0]).Text) { StringBuilder sbSqlStmt2 = new StringBuilder(); sbSqlStmt2.AppendFormat("EXEC sp_rename 'Campaign.{0}', '{1}', 'COLUMN'", strOriginalFieldName, ((TextBox)e.Item.Cells[2].Controls[0]).Text); sqlStmt = sbSqlStmt2.ToString(); ActivityLogger.WriteAdminEntry(currentCampaign, "Change columns Statement to Execute: '{0}'", sqlStmt); dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = sqlStmt; dsMainGrid.Select(DataSourceSelectArguments.Empty); } // Update the field name if it has changed if (strOriginalLength != ((TextBox)e.Item.Cells[4].Controls[0]).Text) { int numeric; bool isNumeric = int.TryParse(((TextBox)e.Item.Cells[4].Controls[0]).Text, out numeric); if (isNumeric) { StringBuilder sbSqlStmt2 = new StringBuilder(); sbSqlStmt2.AppendFormat("ALTER TABLE Campaign ALTER COLUMN [{0}] varchar({1})", ((TextBox)e.Item.Cells[2].Controls[0]).Text, ((TextBox)e.Item.Cells[4].Controls[0]).Text); sqlStmt = sbSqlStmt2.ToString(); ActivityLogger.WriteAdminEntry(currentCampaign, "Change columns Statement to Execute: '{0}'", sqlStmt); dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = sqlStmt; dsMainGrid.Select(DataSourceSelectArguments.Empty); if (((TextBox)e.Item.Cells[4].Controls[0]).Text.Length > 0) { sbSqlStmt.AppendFormat(", Value = '{0}' ", ((TextBox)e.Item.Cells[4].Controls[0]).Text); } else { sbSqlStmt.AppendFormat(", Value = NULL "); } } } sbSqlStmt.AppendFormat(" WHERE FieldID = {0}", ((TextBox)e.Item.Cells[e.Item.Cells.Count - 1].Controls[0]).Text); string sqlStmtFinal = sbSqlStmt.ToString(); ActivityLogger.WriteAdminEntry(currentCampaign, "Update Statement to Execute: '{0}'", sqlStmtFinal); dsMainGrid.ConnectionString = currentCampaign.CampaignDBConnString; dsMainGrid.SelectCommand = sqlStmtFinal; dsMainGrid.Select(DataSourceSelectArguments.Empty); string sortQueryAppend = ""; if (Session["SortExp"] != null) { if (Session["SortExp"].ToString().Length > 0) { string sortDirection = (string)Session["SortDir"]; sortQueryAppend = string.Format(" ORDER BY {0} {1}", Session["SortExp"].ToString(), sortDirection); } } grdCampaignFields.EditItemIndex = -1; grdCampaignFields.Columns[1].Visible = true; BindDataGrid(sortQueryAppend); } catch (Exception ex) { PageMessage = "Exception updating record: " + ex.Message; } }
protected void dgRequisitions_ItemCommand(object source, DataGridCommandEventArgs e) { }
protected void dtgTareaAlerta_Edit(object sender, DataGridCommandEventArgs e) { this.dtgTareaAlerta.DataSource = (DsTareaAlertas)Session["dsTareaAlertas"]; this.dtgTareaAlerta.EditItemIndex = e.Item.ItemIndex; this.dtgTareaAlerta.DataBind(); }
private void grdTasks_ItemCommand(object source, DataGridCommandEventArgs e) { if (e.CommandName == "Collapse") { string s = pc["Report_CollapsedProjectsList"]; if (s != null && s.Length > 0) { if (s[s.Length - 1] == ';') { s += e.CommandArgument.ToString(); } else { s += ";" + e.CommandArgument.ToString(); } pc["Report_CollapsedProjectsList"] = s; } else { pc["Report_CollapsedProjectsList"] = e.CommandArgument.ToString(); } BindDataGrid(); } if (e.CommandName == "Expand") { string s = pc["Report_CollapsedProjectsList"]; if (s == e.CommandArgument.ToString()) { s = string.Empty; } else { int index = s.IndexOf(e.CommandArgument.ToString() + ";"); if (index >= 0) { s = s.Remove(index, e.CommandArgument.ToString().Length + 1); } else { index = s.IndexOf(";" + e.CommandArgument.ToString()); if (index >= 0) { s = s.Remove(index, e.CommandArgument.ToString().Length + 1); } } } pc["Report_CollapsedProjectsList"] = s; BindDataGrid(); } if (e.CommandName == "ProjectStart") { DataTable dt = GanttManager.GetAnalysisDataTable(BasePlan1, BasePlan2); if (dt.Rows.Count > 0) { _topProjectId = (int)dt.Rows[0]["ProjectId"]; } int projectId = int.Parse(e.CommandArgument.ToString()); DateTime zeroPoint = DateTime.Now; using (IDataReader reader = Project.GetProject(projectId)) { if (reader.Read()) { if (reader["TargetStartDate"] != DBNull.Value) { zeroPoint = (DateTime)reader["TargetStartDate"]; } } } pc["GantChartMilestones_Lx_New"] = (GanttManager.GetPortionX(_topProjectId, zeroPoint)).ToString(); Response.Redirect("../Projects/ProjectsByMilestones.aspx", true); } if (e.CommandName == "ProjectEnd") { DataTable dt = GanttManager.GetAnalysisDataTable(BasePlan1, BasePlan2); if (dt.Rows.Count > 0) { _topProjectId = (int)dt.Rows[0]["ProjectId"]; } int projectId = int.Parse(e.CommandArgument.ToString()); DateTime zeroPoint = DateTime.Now; using (IDataReader reader = Project.GetProject(projectId)) { if (reader.Read()) { if (reader["TargetFinishDate"] != DBNull.Value) { zeroPoint = (DateTime)reader["TargetFinishDate"]; } } } pc["GantChartMilestones_Lx_New"] = (GanttManager.GetPortionX(_topProjectId, zeroPoint) - 1).ToString(); Response.Redirect("../Projects/ProjectsByMilestones.aspx", true); } }
protected void dgboard_EditCommand(object source, DataGridCommandEventArgs e) { Session["intID"] = e.Item.Cells[0].Text; txtsubject.Text = e.Item.Cells[1].Text; btnSave.Text = "Update"; }
private void dtgTareaAlerta_Cancel(object sender, DataGridCommandEventArgs e) { this.dtgTareaAlerta.EditItemIndex = -1; Session["dsTareaAlerta"] = null; this.BindGrilla(); }
protected void dtgTareaAlerta_Update(object sender, DataGridCommandEventArgs e) { try { string valorString = Request.Form[((TextBox)e.Item.FindControl("txtValor")).UniqueID]; if (valorString == "") { ((ErrorWeb)this.phErrores.Controls[0]).setMensaje("Error, el valor no puede quedar vacio"); return; } this.dsTareaAlertas = (DsTareaAlertas)Session["dsTareaAlertas"]; DsTareaAlertas.datosRow dr = (DsTareaAlertas.datosRow) this.dsTareaAlertas.datos.Rows[e.Item.DataSetIndex]; ITareaAlerta tareaAlerta = TareaAlertaFactory.GetTareaAlerta(); tareaAlerta.TareaAlertaID = dr.TareaAlertaID; int valor = Utiles.Validaciones.obtieneEntero(valorString); tareaAlerta.Valor = valor; string opcion = this.Request.QueryString["OpcionEstado"]; this.UnidadVentaID = Utiles.Validaciones.obtieneEntero(this.Request.QueryString["UnidadVentaID"] == null ? "" : this.Request.QueryString["UnidadVentaID"].ToString()); if (opcion == "alertaTareasBolsin") { tareaAlerta.EsBolsin = true; } else if (opcion == "alertaTareasUVenta") { if (this.UnidadVentaID != 0) { tareaAlerta.UnidadVentaID = this.UnidadVentaID; } else { tareaAlerta.EsUnidadVenta = true; } } try { tareaAlerta.Guardar(usuario); this.dtgTareaAlerta.EditItemIndex = -1; Session["dsTareaAlertas"] = null; this.BindGrilla(); } catch (Exception ex) { string mensaje = ex.Message; try { mensaje = this.TraducirTexto(ex.Message); if (mensaje == "" || mensaje == null) { mensaje = ex.Message; } } catch (Exception) { mensaje = ex.Message; } ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje); } } catch (Exception ex) { ManejaErrores(ex); } }
protected void DataGrid1_EditCommand(object source, DataGridCommandEventArgs e) // DataGrid Güncelleme İşlemi { L_Id.Text = e.Item.Cells[0].Text; L_islem.Text = "GÜNCELLEME"; NewsSql.GetRecordXML("CATEGORY_PROC_ID_AREA", Txt_Ttl, Txt_Shrt, Lbl_Txt_Pic, Editor_Text_Box, L_Id, Live_Check, Product_Image, Category_Text); }
protected void dgRespuesta_CancelCommand(object Sender, DataGridCommandEventArgs e) { dgRespuesta.EditItemIndex = -1; dgRespuesta_DataBind(); }
private void DataGrid1_CancelCommand(object source, DataGridCommandEventArgs e) { DataGrid1.EditItemIndex = -1; BindUserType(); }
protected void DataGrid1_DeleteCommand(object source, DataGridCommandEventArgs e) // Datagrid Delete İşlemi { db.SP("exec CATEGORY_DELETE_PROC @P0", int.Parse((e.Item.Cells[0].Text))); //ID'e göre delete işlemi NewsSql.GetRecords(DataGrid1, "Category_PROC_AREA", "Category"); }
private void MenuDefaultGrid_DeleteCommand(object source, DataGridCommandEventArgs e) { SmartAdmin.Data.Menu.MenuDefaultDelete(this.menuID, int.Parse(e.Item.Cells[0].Text)); this.LoadMenuOptionDefault(); }
protected void gridData_ItemCommand(object source, DataGridCommandEventArgs e) { switch (e.CommandName.ToUpper()) { case "MODIFICA": { ViewState["INMODIFICA"] = "SI"; ((clsSession)Session["GreenApple"]).AzioneCorrente = clsSession.AzioniPagina.Modifica; gridData.SelectedIndex = e.Item.ItemIndex; txtElemento.Text = gridData.Items[e.Item.ItemIndex].Cells[2].Text.Replace(" ", "").Trim(); txtPosizione.Text = gridData.Items[e.Item.ItemIndex].Cells[1].Text.Replace(" ", "").Trim(); txtPercCompenso.Text = gridData.Items[e.Item.ItemIndex].Cells[3].Text.Replace(" ", "").Trim(); chkDifferita.Checked = bool.Parse(gridData.Items[e.Item.ItemIndex].Cells[4].Text); ModificaVisible = true; ((clsSession)Session["GreenApple"]).AzioneCorrente = clsSession.AzioniPagina.Modifica; clsFunctions.WriteGOTO_and_FOCUS("SectionEdit", txtElemento, this.Page); break; } case "ELIMINA": { clsParameter pParameter = new clsParameter(); if (NvarcharID == false) { pParameter.Parameters.Add(new clsParameter.MemberOfclsParameter("@COLUMNID", gridData.DataKeys[e.Item.ItemIndex], SqlDbType.Int, ParameterDirection.Input)); } else { pParameter.Parameters.Add(new clsParameter.MemberOfclsParameter("@COLUMNID", gridData.DataKeys[e.Item.ItemIndex], SqlDbType.NVarChar, ParameterDirection.Input)); } sql = "DELETE FROM " + TABLENAME + " WHERE " + COLUMNID + "=@COLUMNID"; clsDB.Execute_Command_ClsParameter(this.Page, ((clsSession)Session["GreenApple"]).CnnStr, sql, pParameter.Parameters); ModificaVisible = false; CaricaDati(); break; } case "DOWN": { clsParameter pParameter = new clsParameter(); pParameter.Parameters.Add(new clsParameter.MemberOfclsParameter("@COLUMNID", gridData.DataKeys[e.Item.ItemIndex], SqlDbType.Int, ParameterDirection.Input)); sql = "UPDATE " + TABLENAME + " SET " + COLUMNORDER + " = " + COLUMNORDER + "+1 WHERE " + COLUMNID + "=@COLUMNID"; clsDB.Execute_Command_ClsParameter(this.Page, ((clsSession)Session["GreenApple"]).CnnStr, sql, pParameter.Parameters); sql = "UPDATE " + TABLENAME + " SET " + COLUMNORDER + " = " + COLUMNORDER + " - 1 "; sql += "WHERE " + COLUMNORDER + " IN (SELECT " + COLUMNORDER + " FROM " + TABLENAME + " WHERE " + COLUMNID + " = @COLUMNID) AND " + COLUMNID + " <> @COLUMNID "; clsDB.Execute_Command_ClsParameter(this.Page, ((clsSession)Session["GreenApple"]).CnnStr, sql, pParameter.Parameters); ModificaVisible = false; CaricaDati(); break; } case "UP": { clsParameter pParameter = new clsParameter(); pParameter.Parameters.Add(new clsParameter.MemberOfclsParameter("@COLUMNID", gridData.DataKeys[e.Item.ItemIndex], SqlDbType.Int, ParameterDirection.Input)); sql = "UPDATE " + TABLENAME + " SET " + COLUMNORDER + " = " + COLUMNORDER + "-1 WHERE " + COLUMNID + "=@COLUMNID"; clsDB.Execute_Command_ClsParameter(this.Page, ((clsSession)Session["GreenApple"]).CnnStr, sql, pParameter.Parameters); sql = "UPDATE " + TABLENAME + " SET " + COLUMNORDER + " = " + COLUMNORDER + " + 1 "; sql += "WHERE " + COLUMNORDER + " IN (SELECT " + COLUMNORDER + " FROM " + TABLENAME + " WHERE " + COLUMNID + " = @COLUMNID) AND " + COLUMNID + " <> @COLUMNID "; clsDB.Execute_Command_ClsParameter(this.Page, ((clsSession)Session["GreenApple"]).CnnStr, sql, pParameter.Parameters); ModificaVisible = false; CaricaDati(); break; } } }