2022-06-06 11:23:24 +08:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-14 16:38:27 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 内网进入软件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnUrlN_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(String.Format("window.open('http://192.168.30.40:8102/pcms/');"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 外网进入软件
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnUrlW_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
PageContext.RegisterStartupScript(String.Format("window.open('http://221.232.143.174:8102/pcms');"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-06 11:23:24 +08:00
|
|
|
|
/// <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))
|
|
|
|
|
{
|
|
|
|
|
//项目试压包量
|
2022-06-07 16:22:51 +08:00
|
|
|
|
var str4 = APIGetHttpService.Http("http://192.168.30.40:8102/csm/third/getPressurePackageList/" + project.HJProjectCode, "GET");
|
2022-06-06 11:23:24 +08:00
|
|
|
|
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()
|
|
|
|
|
{
|
2022-09-19 09:35:49 +08:00
|
|
|
|
string strSql = @"select *,
|
|
|
|
|
cast((case when c.PressurePackageTotalNum='0' or c.PressurePackageTotalNum='' then 0 when c.CompletePressurePackageNum='0' or c.CompletePressurePackageNum='' then 0 else 100.0 * cast(c.CompletePressurePackageNum as DECIMAL(9,2))/(1.0 * cast(c.PressurePackageTotalNum as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate1,
|
|
|
|
|
cast((case when c.WaterPressurePackageTotalNum='0' or c.WaterPressurePackageTotalNum='' then 0 when c.CompleteWaterPressurePackageCompleteNum='0' or c.CompleteWaterPressurePackageCompleteNum='' then 0 else 100.0 * cast(c.CompleteWaterPressurePackageCompleteNum as DECIMAL(9,2))/(1.0 * cast(c.WaterPressurePackageTotalNum as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate2,
|
|
|
|
|
cast((case when c.RunPackageTotalNum='0' or c.RunPackageTotalNum='' then 0 when c.CompleteRunPackageNum='0' or c.CompleteRunPackageNum='' then 0 else 100.0 * cast(c.CompleteRunPackageNum as DECIMAL(9,2))/(1.0 * cast(c.RunPackageTotalNum as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate3,
|
|
|
|
|
cast((case when c.AlternativePackageTotalNum='0' or c.AlternativePackageTotalNum='' then 0 when c.CompleteAlternativePackageNum='0' or c.CompleteAlternativePackageNum='' then 0 else 100.0 * cast(c.CompleteAlternativePackageNum as DECIMAL(9,2))/(1.0 * cast(c.AlternativePackageTotalNum as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate4,
|
|
|
|
|
cast((case when c.ObservePackageTotalNum='0' or c.ObservePackageTotalNum='' then 0 when c.CompleteObservePackageNum='0' or c.CompleteObservePackageNum='' then 0 else 100.0 * cast(c.CompleteObservePackageNum as DECIMAL(9,2))/(1.0 * cast(c.ObservePackageTotalNum as DECIMAL(9,2))) end) AS DECIMAL(9,2)) as Rate5
|
2022-06-06 11:23:24 +08:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|