protected void btn_Search_Click(object sender, EventArgs e) { string containerNo = boxNo.Value; string blNo = BLNo.Value; if (string.IsNullOrWhiteSpace(containerNo) && string.IsNullOrWhiteSpace(blNo)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.alert('箱号和提单号条件至少须输入一个!');", true); return; } QGCostcoSoapClient client = new QGCostcoSoapClient(); string errorMsg = ""; string errorCode = ""; string result = ""; string reserved = isReserved.Checked ? "Y" : "N"; result = client.reserve(containerNo, blNo, reserved, "", out errorMsg, out errorCode); if (errorCode == "0") { customsInspections = com.GetCustomsInspections(result); DataSourceList.DataSource = customsInspections.CONTAINER.Take(20); DataSourceList.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();", true); } else { DataSourceList.DataSource = null; DataSourceList.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.alert('" + errorMsg + "');", true); } }
protected void BindDataSourceList() { ViewState["id"] = null; int i, j; string SourceName = txtSourceName.Text.Trim(); ViewState["txtSourceName"] = SourceName; string SourceIP = txtSourceIP.Text.Trim(); ViewState["txtSourceIP"] = SourceIP; string DBName = txtDBName.Text.Trim(); ViewState["txtDBName"] = DBName; string ObjectType = ""; if (!string.IsNullOrWhiteSpace(hidisdefault.Value)) { ObjectType = (ddlDataType.SelectedValue == "all" ? "" : ddlDataType.SelectedValue); } ViewState["ddlDataType"] = ObjectType; string ObjectName = txtObjectName.Text; ViewState["txtObjectName"] = ObjectName; string SourceStatus = ""; if (!string.IsNullOrWhiteSpace(hidisdefault.Value)) { SourceStatus = (ddlStatus.SelectedValue == "all" ? "" : ddlStatus.SelectedValue); } ViewState["ddlStatus"] = SourceStatus; int startIndex = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int PageSize = AspNetPager1.PageSize; string bigcate = (ddlCATEGORY.SelectedValue == "all" ? "" : ddlCATEGORY.SelectedValue); ViewState["ddlCATEGORY"] = bigcate; string smallcate = (ddlsmallcategory.SelectedValue == "all" ? "" : ddlsmallcategory.SelectedValue); ViewState["ddlsmallcategory"] = smallcate; DataSourceConfigComponent tmbll = new DataSourceConfigComponent(); DataTable dt = tmbll.GetDataSourceList(SourceName, SourceIP, DBName, ObjectType, ObjectName, SourceStatus, bigcate, smallcate, "", AspNetPager1.CurrentPageIndex, PageSize, out i, out j); AspNetPager1.RecordCount = i; DataSourceList.DataSource = dt; DataSourceList.DataBind(); if (dt == null || dt.Rows.Count == 0) { lblnodata.Visible = true; } else { lblnodata.Visible = false; } ReCodePager(); //ViewState["TemplateList"] = dt; }
protected void BindDataSourceList() { int i, j; string SourceName = txtSourceName.Text.Trim(); string SourceIP = txtSourceIP.Text.Trim(); string DBName = txtDBName.Text.Trim(); string ObjectType = ddlDataType.SelectedValue; string ObjectName = txtObjectName.Text; int startIndex = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int PageSize = AspNetPager1.PageSize; DataSourceConfigComponent tmbll = new DataSourceConfigComponent(); DataTable dt = tmbll.GetDataSourceList(SourceName, SourceIP, DBName, ObjectType, ObjectName, "", AspNetPager1.CurrentPageIndex, PageSize, out i, out j); AspNetPager1.RecordCount = i; DataSourceList.DataSource = dt; DataSourceList.DataBind(); }
protected void BindDataSourceListByOrderBy(string orderby) { int i, j; string SourceName = (ViewState["txtSourceName"] == null?txtSourceName.Text.Trim():ViewState["txtSourceName"].ToString()); string SourceIP = (ViewState["txtSourceIP"] == null?txtSourceIP.Text.Trim():ViewState["txtSourceIP"].ToString()); string DBName = (ViewState["txtDBName"] == null?txtDBName.Text.Trim():ViewState["txtDBName"].ToString()); string ObjectType = (ViewState["ddlDataType"] == null?ddlDataType.SelectedValue:ViewState["ddlDataType"].ToString()); string ObjectName = (ViewState["txtObjectName"] == null?txtObjectName.Text.Trim():ViewState["txtObjectName"].ToString()); string SourceStatus = (ViewState["ddlStatus"] == null?ddlStatus.SelectedValue:ViewState["ddlStatus"].ToString()); int startIndex = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int PageSize = AspNetPager1.PageSize; string bigcate = (ViewState["ddlCATEGORY"] == null?ddlCATEGORY.SelectedValue:ViewState["ddlCATEGORY"].ToString()); string smallcate = (ViewState["ddlsmallcategory"] == null?ddlsmallcategory.SelectedValue:ViewState["ddlsmallcategory"].ToString()); DataSourceConfigComponent tmbll = new DataSourceConfigComponent(); DataTable dt = tmbll.GetDataSourceList(SourceName, SourceIP, DBName, ObjectType, ObjectName, SourceStatus, bigcate, smallcate, orderby, AspNetPager1.CurrentPageIndex, PageSize, out i, out j); AspNetPager1.RecordCount = i; DataSourceList.DataSource = dt; DataSourceList.DataBind(); //ViewState["TemplateList"] = dt; ReCodePager(); }
protected void BindDataSourceList() { try { AspNetPager1.PageSize = Convert.ToInt32(hidpagesize.Value); int recordCount; string pageName = txtPageName.Text.Trim(); string useCompany = txtUseCompany.Text.Trim(); string creater = txtCreater.Text.Trim(); int startIndex = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1; int PageSize = AspNetPager1.PageSize; RightsManagementComponent rightBll = new RightsManagementComponent(); DataTable dt = rightBll.GetAllPages(SPContext.Current.Site.Url, out recordCount, pageName, useCompany, creater, AspNetPager1.CurrentPageIndex, PageSize); ViewState["AuthorationDataSource"] = dt; if (recordCount == 0) { lblnodata.Visible = true; } else { lblnodata.Visible = false; } AspNetPager1.CurrentPageIndex = 1; AspNetPager1.RecordCount = recordCount; DataSourceList.DataSource = dt; DataSourceList.DataBind(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setAllsel", "BindSelectAllEvent();", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setsel", "BindEachCboEvent();", true); } catch (Exception ex) { BaseComponent.Error("授权首页数据绑定: " + ex.Message + "--------" + ex.StackTrace); } }
protected void btn_Search_Click(object sender, EventArgs e) { string containerNo = boxNo.Value; string blNo = BLNo.Value; if (string.IsNullOrWhiteSpace(containerNo) && string.IsNullOrWhiteSpace(blNo)) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.alert('请输入正确的箱号或提单号!');", true); return; } QGCostcoSoapClient client = new QGCostcoSoapClient(); string errorMsg = ""; string errorCode = ""; string result = ""; //string reserved = isReserved.Checked ? "Y" : "N"; string reserved = "Y"; result = client.reserve(containerNo, blNo, reserved, "", out errorMsg, out errorCode); BaseComponent.Info("WebService Paras reserve Y:containerNo " + containerNo + ";blNo " + blNo + ";reserved " + reserved + ";errorMsg " + errorMsg + ";errorCode " + errorCode); customsInspections = null; if (errorCode == "0") { customsInspections = com.GetCustomsInspections(result); //if (isReserved.Checked) if (customsInspections != null && customsInspections.CONTAINER.Count > 0) { DataSourceList.Visible = false; DataSourceList2.Visible = true; DataSourceList2.DataSource = customsInspections.CONTAINER; DataSourceList2.DataBind(); } else { DataSourceList.Visible = false; DataSourceList2.Visible = true; DataSourceList2.DataSource = null; DataSourceList2.DataBind(); } //if (customsInspections != null && customsInspections.CONTAINER.Count > 0 && !string.IsNullOrWhiteSpace(blNo) && string.IsNullOrWhiteSpace(containerNo) && !string.IsNullOrWhiteSpace(inspectionTime.Value) && !isReserved.Checked) if (customsInspections != null && customsInspections.CONTAINER.Count > 0 && reserved == "N") { btn_Booking.Visible = true; } else { btn_Booking.Visible = false; } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();", true); } else { reserved = "N"; result = client.reserve(containerNo, blNo, reserved, "", out errorMsg, out errorCode); BaseComponent.Info("WebService Paras reserve N:containerNo " + containerNo + ";blNo " + blNo + ";reserved " + reserved + ";errorMsg " + errorMsg + ";errorCode " + errorCode); customsInspections = null; if (errorCode == "0") { customsInspections = com.GetCustomsInspections(result); if (customsInspections != null && customsInspections.CONTAINER.Count > 0) { DataSourceList.Visible = true; DataSourceList2.Visible = false; DataSourceList.DataSource = customsInspections.CONTAINER; DataSourceList.DataBind(); } else { DataSourceList.Visible = true; DataSourceList2.Visible = false; DataSourceList.DataSource = null; DataSourceList.DataBind(); } if (customsInspections != null && customsInspections.CONTAINER.Count > 0) { btn_Booking.Visible = true; } else { btn_Booking.Visible = false; } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsucclose", "layer.closeAll();", true); } else { if (reserved == "N") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();layer.alert('如果无法查询出数据,请在“海关查验进度查询”中查看是否已经预约');", true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();layer.alert('" + errorMsg + "');", true); } btn_Booking.Visible = false; DataSourceList.DataSource = null; DataSourceList.DataBind(); DataSourceList2.DataSource = null; DataSourceList2.DataBind(); } //if (reserved == "N") // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();layer.alert('如果无法查询出数据,请在“海关查验进度查询”中查看是否已经预约');", true); //else // ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "connsuc", "layer.closeAll();layer.alert('" + errorMsg + "');", true); //btn_Booking.Visible = false; //DataSourceList.DataSource = null; //DataSourceList.DataBind(); //DataSourceList2.DataSource = null; //DataSourceList2.DataBind(); } }
protected void DataSourceList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { LinkButton lkbtnSort = (LinkButton)e.Item.FindControl(e.CommandName.Trim()); if (ViewState[e.CommandName.Trim()] == null) { ViewState[e.CommandName.Trim()] = "ASC"; lkbtnSort.Text = lkbtnSort.Text + "▲"; } else { if (ViewState[e.CommandName.Trim()].ToString().Trim() == "ASC") { ViewState[e.CommandName.Trim()] = "DESC"; if (lkbtnSort.Text.IndexOf("▲") != -1) { lkbtnSort.Text = lkbtnSort.Text.Replace("▲", "▼"); } else { lkbtnSort.Text = lkbtnSort.Text + "▼"; } } else { ViewState[e.CommandName.Trim()] = "ASC"; if (lkbtnSort.Text.IndexOf("▼") != -1) { lkbtnSort.Text = lkbtnSort.Text.Trim().Replace("▼", "▲"); } else { lkbtnSort.Text = lkbtnSort.Text + "▲"; } } } ViewState["text"] = lkbtnSort.Text; ViewState["id"] = e.CommandName.Trim(); string orderby = e.CommandName.ToString().Trim() + " " + ViewState[e.CommandName.Trim()].ToString().Trim(); if (ViewState["AuthorationDataSource"] == null) { BindDataSourceList(); } else { DataTable dtSource = (DataTable)ViewState["AuthorationDataSource"]; if (dtSource != null || dtSource.Rows.Count > 0) { DataView view = dtSource.DefaultView; view.Sort = orderby; DataTable dtResult = view.ToTable(); AspNetPager1.CurrentPageIndex = 1; AspNetPager1.RecordCount = dtResult.Rows.Count; DataSourceList.DataSource = dtResult; DataSourceList.DataBind(); } } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setvsel", "layer.closeAll();", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setAllsel", "BindSelectAllEvent();", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setsel", "BindEachCboEvent();", true); } }