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 TotalQuantity : 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)
|
|
|
|
|
{
|
2022-06-16 17:34:24 +08:00
|
|
|
|
var HJGL_FL_TotalQuantitys = from x in Funs.DB.HJGL_FL_TotalQuantity where x.ProjectId == this.CurrUser.LoginProjectId select x;
|
2022-06-06 11:23:24 +08:00
|
|
|
|
if (HJGL_FL_TotalQuantitys.Count() > 0)
|
|
|
|
|
{
|
2022-06-16 17:34:24 +08:00
|
|
|
|
Funs.DB.HJGL_FL_TotalQuantity.DeleteAllOnSubmit(HJGL_FL_TotalQuantitys);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
2022-06-06 11:23:24 +08:00
|
|
|
|
}
|
2022-06-16 17:34:24 +08:00
|
|
|
|
var project = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId);
|
2022-06-06 11:23:24 +08:00
|
|
|
|
if (project != null && !string.IsNullOrEmpty(project.HJProjectCode))
|
|
|
|
|
{
|
|
|
|
|
//项目管道焊接工程量
|
2022-06-07 16:22:51 +08:00
|
|
|
|
var str1 = APIGetHttpService.Http("http://192.168.30.40:8102/csm/third/getPipelineWeldingQuantities/" + project.HJProjectCode, "GET");
|
2022-06-06 11:23:24 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(str1))
|
|
|
|
|
{
|
|
|
|
|
JArray arr1 = JArray.Parse(str1);
|
|
|
|
|
foreach (var item1 in arr1)
|
|
|
|
|
{
|
|
|
|
|
Model.HJGL_FL_TotalQuantity tq = new Model.HJGL_FL_TotalQuantity();
|
|
|
|
|
tq.TotalQuantityId = SQLHelper.GetNewID();
|
|
|
|
|
tq.ProjectId = project.ProjectId;
|
|
|
|
|
tq.DeviceName = item1["deviceName"].ToString();
|
|
|
|
|
tq.DeviceCode = item1["zoneCode"].ToString();
|
|
|
|
|
tq.Unit = item1["unitName"].ToString();
|
|
|
|
|
tq.TotalWeldQuantity = item1["totalWeldingAmount"].ToString();
|
|
|
|
|
tq.TotalCompleted = item1["finishedAmount"].ToString();
|
2022-06-16 17:34:24 +08:00
|
|
|
|
Funs.DB.HJGL_FL_TotalQuantity.InsertOnSubmit(tq);
|
|
|
|
|
Funs.DB.SubmitChanges();
|
2022-06-06 11:23:24 +08:00
|
|
|
|
}
|
|
|
|
|
ShowNotify("获取成功!", MessageBoxIcon.Success);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ShowNotify("请确认项目已使用4D系统,并已在项目信息中设置了对应的焊接软件项目编号!", MessageBoxIcon.Warning);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
{
|
|
|
|
|
string strSql = @"select *
|
|
|
|
|
from dbo.HJGL_FL_TotalQuantity c
|
|
|
|
|
where c.ProjectId=@ProjectId order by c.DeviceName,DeviceCode ";
|
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
2022-06-16 17:34:24 +08:00
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId ?? ""));
|
2022-06-06 11:23:24 +08:00
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|