protected void btnDel_Click(object sender, EventArgs e) { List <String> ids = GetSelectedIDs(); AssignProjectService.DeleteProjects(ids); SmartGridView1.DataBind(); }
protected void BindData() { string xuhao_engid = Server.HtmlDecode(Request.QueryString["xuhao_engid"].ToString()); string[] a = xuhao_engid.Split('_'); ViewState["xuhao"] = a[0]; ViewState["engid"] = a[1]; string sql = "select * from View_TM_OUTSOURCELIST where OSL_ENGID='" + a[1] + "' and OSL_NEWXUHAO='" + a[0] + "' and OST_STATE!='9' and OSL_STATUS='0'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); SmartGridView1.DataSource = dt; SmartGridView1.DataBind(); if (SmartGridView1.Rows.Count > 0) { NoDataPanel1.Visible = false; btnShowMpChange.Visible = true; btnShowSameLot.Visible = true; btnShowAll.Visible = true; } else { btnShowMpChange.Visible = false; btnShowSameLot.Visible = false; btnShowAll.Visible = false; NoDataPanel1.Visible = true; } }
protected void btnSearch_Click(object sender, EventArgs e) { if (String.IsNullOrWhiteSpace(txtKeyword.Text)) { LinqDataSource1.Where = null; SmartGridView1.DataBind(); return; } DataClassesDataContext dc = new DataClassesDataContext(); if (ddlType.SelectedValue.Equals(SearchType.Bigger)) { this.LinqDataSource1.Where = ddlField.SelectedValue + " > \"" + txtKeyword.Text + "\""; } else if (ddlType.SelectedValue.Equals(SearchType.ExactMatch)) { this.LinqDataSource1.Where = ddlField.SelectedValue + " = \"" + txtKeyword.Text + "\""; } else if (ddlType.SelectedValue.Equals(SearchType.FuzzMatch)) { this.LinqDataSource1.Where = ddlField.SelectedValue + ".Contains(\"" + txtKeyword.Text + "\")"; } else if (ddlType.SelectedValue.Equals(SearchType.Smaller)) { this.LinqDataSource1.Where = ddlField.SelectedValue + " < \"" + txtKeyword.Text + "\""; } SmartGridView1.PageIndex = 0; SmartGridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //SmartGridView1.DataSourceID = null; //SmartGridView1.DataSource = GetAdvanceSearchTable(); SmartGridView1.DataBind(); getStastic(); } }
protected void btnLoad_Click(object sender, EventArgs e) { String F_ID = Request.Params["id"].ToString(); DataClassesDataContext dc = new DataClassesDataContext(); AssignProject project = dc.AssignProject.SingleOrDefault(_ap => _ap.F_projectID.Equals(ddlHistory.SelectedValue)); project.F_ID = F_ID; dc.AssignProject.InsertOnSubmit(project); LinqDataSource1.WhereParameters[0].DefaultValue = F_ID; SmartGridView1.DataBind(); }
protected void btnAuthor_Click(object sender, EventArgs e) { List <String> posIDs = GetSelectedIDs(); if (posIDs.Count == 0) { MessageBox.Show(this, "请选择相应的条目!"); return; } ExpertBll.AuthPositions(posIDs); SmartGridView1.DataBind(); }
protected void BindData() { string xuhao_engid = Server.HtmlDecode(Request.QueryString["xuhao_engid_table"].ToString()); string[] a = xuhao_engid.Split(','); ViewState["xuhao"] = a[0]; ViewState["engid"] = a[1]; switch (a[2]) { case "TBPM_MSOFHZY": ViewState["table"] = "View_TM_MSOFHZY"; break; case "TBPM_MSOFQLM": ViewState["table"] = "View_TM_MSOFQLM"; break; case "TBPM_MSOFBLJ": ViewState["table"] = "View_TM_MSOFBLJ"; break; case "TBPM_MSOFDQJ": ViewState["table"] = "View_TM_MSOFDQJ"; break; case "TBPM_MSOFGFB": ViewState["table"] = "View_TM_MSOFGFB"; break; case "TBPM_MSOFDQO": ViewState["table"] = "View_TM_MSOFDQO"; break; default: break; } string sql = "select * from " + ViewState["table"] + " where MS_ENGID='" + a[1] + "' and MS_NEWINDEX='" + a[0] + "' and MS_REWSTATE!='9' and MS_STATUS='0'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sql); SmartGridView1.DataSource = dt; SmartGridView1.DataBind(); if (SmartGridView1.Rows.Count > 0) { NoDataPanel1.Visible = false; btnShowMpChange.Visible = true; } else { btnShowMpChange.Visible = false; NoDataPanel1.Visible = true; } }
protected void btnDel_Click(object sender, EventArgs e) { List <String> ids = GetSelectedIDs(); if (ids.Count == 0) { // 客户端已经弹出窗口,这个语句无效 MessageBox.Show(this, "请选择相应的条目!"); return; } ExpertBll.DeletePositions(ids); SmartGridView1.DataBind(); }
private void MyDataBind(bool AllowSorting) { DataSet ds = (DataSet)ViewState["DS"]; if (ds == null) { tbpage.Visible = false; return; } if (AllowSorting == true) { if (ViewState["SortExpression"] != null) { ds.Tables[0].DefaultView.Sort = ViewState["SortExpression"].ToString() + " " + ViewState["SortDirection"].ToString(); } } SmartGridView1.PageSize = Common.ConvertEx.ToInt(Common.Session.GetSession("PageCount")); SmartGridView1.DataSource = ds.Tables[0].DefaultView; SmartGridView1.DataBind(); AddSelectColumn(); int recordcount = ds.Tables[0].Rows.Count; lbRecordCount.Text = recordcount.ToString(); lbCurPage.Text = (SmartGridView1.PageIndex + 1).ToString();//(int.Parse(ViewState["GridPageIndex"].ToString()) + 1).ToString(); int pagecount; if (recordcount % SmartGridView1.PageSize == 0) { pagecount = recordcount / SmartGridView1.PageSize; } else { pagecount = (recordcount / SmartGridView1.PageSize) + 1; } lbPageCount.Text = pagecount.ToString(); SetShowPageIndex(); if (ds.Tables[0].Rows.Count > 0) { tbpage.Visible = true; } else { tbpage.Visible = false; } Session["PageIndex"] = SmartGridView1.PageIndex; }
protected void UpdateBind() { string s1 = DropDownList1.SelectedValue.Trim(); string s2 = DropDownList2.SelectedValue.Trim(); if (s1 != "" && s2 != "") { sSQL = @"select iID, a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME, a.COLUMN_NAME, COLUMN_Text, COLUMN_Text2, VisibleIndex, ShowCol, ColType, ColLink, ColLinkID, ColLinkText, ColSel, ColSelFlag, IsInput, UpdateVisibleIndex, UpdateEnable, UpdateType, a.DATA_TYPE, COLLATION_ADD, bSystem, bKey, a.DATA_Type as DATA_Type2,0 as bUsed ,2 as DataType,isnull(t.collation_add,0) as collation_add,case a.COLUMN_NAME when isnull(t.COLUMN_NAME,0) then 0 else 1 end as newAdd,isnull(t.bKey ,0) as bKey " + "from " + s1 + ".INFORMATION_SCHEMA.COLUMNS a left join dbo._TableColInfo t on a.TABLE_CATALOG = t.TABLE_CATALOG and a.TABLE_NAME=t.TABLE_NAME and a.COLUMN_NAME = t.COLUMN_NAME " + "where a.table_name = '" + s2 + "' " + "order by a.table_name,a.ordinal_position"; SmartGridView1.DataSource = clsSQLCommond.ExecQuery(sSQL); SmartGridView1.DataBind(); } }
protected void UpdateBind() { if (YxBtn.HidID != "") { sSQL = "select * from _Form where fchrFrmNameID = '" + YxBtn.HidID + "' ORDER BY fIntOrderID"; DataTable dtFormNew = clsSQLCommond.ExecQuery(sSQL); if (dtFormNew.Rows.Count > 0) { TextBox1.Text = dtFormNew.Rows[0]["fchrFrmNameID"].ToString().Trim(); TextBox2.Text = dtFormNew.Rows[0]["fIntOrderID"].ToString().Trim(); TextBox3.Text = dtFormNew.Rows[0]["fchrFrmText"].ToString().Trim(); TextBox4.Text = dtFormNew.Rows[0]["fchrFrmText2"].ToString().Trim(); } //if (dtFormNew.Rows[0]["fchrFrmNameID"].ToString().Trim().ToLower().StartsWith("frm")) //{ sSQL = "select 0 as bChoose,*,'' as FormText,'' as FormText2,'' as FormOrder,'' as FormEnable from _BtnBaseInfo order by iOrder "; DataTable dts = clsSQLCommond.ExecQuery(sSQL); sSQL = "select *,vchrBtnText as FormText,intOrder as FormOrder from dbo._FormBtnInfo where fchrFrmNameID = '" + YxBtn.HidID + "'"; DataTable dt = clsSQLCommond.ExecQuery(sSQL); for (int i = 0; i < dt.Rows.Count; i++) { for (int j = 0; j < dts.Rows.Count; j++) { if (dt.Rows[i]["vchrBtnID"].ToString().Trim().ToLower() == dts.Rows[j]["btnCode"].ToString().Trim().ToLower()) { dts.Rows[j]["bChoose"] = true; dts.Rows[j]["FormText"] = dt.Rows[i]["vchrBtnText"].ToString().Trim(); dts.Rows[j]["FormText2"] = dt.Rows[i]["vchrBtnText2"].ToString().Trim(); dts.Rows[j]["FormOrder"] = dt.Rows[i]["FormOrder"].ToString().Trim(); dts.Rows[j]["FormEnable"] = dt.Rows[i]["intOrder"].ToString().Trim(); break; } } } SmartGridView1.DataSource = dts; SmartGridView1.DataBind(); //} } }
private void databind() { SmartGridView1.DataSource = null; SmartGridView1.DataBind(); pager.TableName = "View_TBDS_STAFFINFO"; pager.PrimaryKey = "ST_ID"; pager.ShowFields = "*"; if (rblIfZaizhi.SelectedValue == "1") { pager.OrderField = "ST_LZSJ"; pager.OrderType = 1; } else { pager.OrderField = "ST_POSITION,ST_ID"; pager.OrderType = 0; } pager.StrWhere = StrWhere(); // pager.OrderType = 0; pager.PageSize = int.Parse(ddl_pageno.SelectedValue); UCPaging1.PageSize = pager.PageSize; pager.PageIndex = UCPaging1.CurrentPage; System.Data.DataTable dt = CommonFun.GetDataByPagerQueryParam(pager); CommonFun.Paging(dt, SmartGridView1, UCPaging1, NoDataPanel); if (NoDataPanel.Visible) { UCPaging1.Visible = false; //如果筛选结果没有,则UCPaging不显示 deletebt.Visible = false; //如果筛选结果没有,则删除按钮不显示 } else { UCPaging1.Visible = true; UCPaging1.InitPageInfo(); deletebt.Visible = true; } string sql = "select ST_ID from View_TBDS_STAFFINFO where " + StrWhere(); lb_People.Text = DBCallCommon.GetDTUsingSqlText(sql).Rows.Count.ToString();//多少行就有多少人 }
protected void btnSetting_Click(object sender, EventArgs e) { List <String> posIDs = GetSelectedIDs(); if (posIDs.Count == 0) { MessageBox.Show(this, "请选择相应的条目!"); return; } DateTime dt = DateTime.MinValue; if (String.IsNullOrEmpty(txtEndDate.Text.Trim()) == false) { DateTime.TryParse(txtEndDate.Text.Trim(), out dt); } else if (null == DateTime.MinValue) { // return; } ExpertBll.SetPositionsEndDate(posIDs, dt); SmartGridView1.DataBind(); }
protected void btnSearch_Click(object sender, EventArgs e) { SmartGridView1.DataBind(); getStastic(); }
protected void SmartGridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { SmartGridView1.DataSource = Session[SessionMgm.DataSource]; SmartGridView1.PageIndex = e.NewPageIndex; SmartGridView1.DataBind(); }