0601-001
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.FL
|
||||
{
|
||||
public partial class PressurePackageList : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnGet_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var HJGL_FL_PressurePackageLists = from x in db.HJGL_FL_PressurePackageList where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||
if (HJGL_FL_PressurePackageLists.Count() > 0)
|
||||
{
|
||||
db.HJGL_FL_PressurePackageList.DeleteAllOnSubmit(HJGL_FL_PressurePackageLists);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
var project = db.Base_Project.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId);
|
||||
if (project != null && !string.IsNullOrEmpty(project.HJProjectCode))
|
||||
{
|
||||
//项目试压包量
|
||||
var str4 = APIGetHttpService.Http("http://221.232.143.174:8102/csm/third/getPressurePackageList/" + project.HJProjectCode, "GET");
|
||||
if (!string.IsNullOrEmpty(str4))
|
||||
{
|
||||
JArray arr1 = JArray.Parse(str4);
|
||||
foreach (var item1 in arr1)
|
||||
{
|
||||
Model.HJGL_FL_PressurePackageList tq = new Model.HJGL_FL_PressurePackageList();
|
||||
tq.PressurePackageListId = SQLHelper.GetNewID();
|
||||
tq.ProjectId = project.ProjectId;
|
||||
tq.DeviceName = item1["deviceName"].ToString();
|
||||
tq.DeviceNumber = item1["deviceNumber"].ToString();
|
||||
tq.UnitName = item1["unitName"].ToString();
|
||||
tq.PressurePackageTotalNum = item1["pressurePackageTotalNum"].ToString();
|
||||
tq.CompletePressurePackageNum = item1["completePressurePackageNum"].ToString();
|
||||
tq.WaterPressurePackageTotalNum = item1["waterPressurePackageTotalNum"].ToString();
|
||||
tq.CompleteWaterPressurePackageCompleteNum = item1["completeWaterPressurePackageCompleteNum"].ToString();
|
||||
tq.ObservePackageTotalNum = item1["observePackageTotalNum"].ToString();
|
||||
tq.CompleteObservePackageNum = item1["completeObservePackageNum"].ToString();
|
||||
tq.RunPackageTotalNum = item1["runPackageTotalNum"].ToString();
|
||||
tq.CompleteRunPackageNum = item1["completeRunPackageNum"].ToString();
|
||||
tq.AlternativePackageTotalNum = item1["alternativePackageTotalNum"].ToString();
|
||||
tq.CompleteAlternativePackageNum = item1["completeAlternativePackageNum"].ToString();
|
||||
db.HJGL_FL_PressurePackageList.InsertOnSubmit(tq);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
ShowNotify("获取成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请确认项目已使用4D系统,并已在项目信息中设置了对应的焊接软件项目编号!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"select *
|
||||
from dbo.HJGL_FL_PressurePackageList c
|
||||
where c.ProjectId=@ProjectId order by c.DeviceName,DeviceNumber";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 分页
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user