1212
This commit is contained in:
@@ -30,57 +30,60 @@ namespace FineUIPro.Web.Transfer
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"select*from Transfer_PunchlistFrom
|
||||
string strSql = @"select *
|
||||
,(CASE isnull(IsEng,0) WHEN 1 THEN 'Y' ELSE 'N' END) IsEngStr
|
||||
,(CASE isnull(IsMatI,0) WHEN 1 THEN 'Y' ELSE 'N' END) IsMatIStr
|
||||
from Transfer_PunchlistFrom
|
||||
where ProjectId = @ProjectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtPunch_No.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtNum_NO.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Punch_No like @Punch_No";
|
||||
listStr.Add(new SqlParameter("@Punch_No", "%" + this.txtPunch_No.Text.Trim() + "%"));
|
||||
strSql += " AND Num_NO like @Num_NO";
|
||||
listStr.Add(new SqlParameter("@Num_NO", "%" + this.txtNum_NO.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSYSTEM.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtSystem_No.Text.Trim()))
|
||||
{
|
||||
strSql += " AND SystemName like @SystemName";
|
||||
listStr.Add(new SqlParameter("@SystemName", "%" + this.txtSYSTEM.Text.Trim() + "%"));
|
||||
strSql += " AND System_No like @System_No";
|
||||
listStr.Add(new SqlParameter("@System_No", "%" + this.txtSystem_No.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtSUBSYSTEM.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtSub_Sys_No.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Subsystem like @Subsystem";
|
||||
listStr.Add(new SqlParameter("@Subsystem", "%" + this.txtSUBSYSTEM.Text.Trim() + "%"));
|
||||
strSql += " AND Sub_Sys_No like @Sub_Sys_No";
|
||||
listStr.Add(new SqlParameter("@Sub_Sys_No", "%" + this.txtSub_Sys_No.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtStartDate_Raised.Text.Trim()))
|
||||
{
|
||||
strSql += " AND PUNCH_ITEM_FINISH_DATE >= @InspectionDateA";
|
||||
listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
|
||||
strSql += " AND Date_Raised >= @StartDate_Raised";
|
||||
listStr.Add(new SqlParameter("@StartDate_Raised", Funs.GetNewDateTime(txtStartDate_Raised.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtEndDate_Raised.Text.Trim()))
|
||||
{
|
||||
strSql += " AND PUNCH_ITEM_FINISH_DATE <= @InspectionDateZ";
|
||||
listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
|
||||
strSql += " AND Date_Raised <= @EndDate_Raised";
|
||||
listStr.Add(new SqlParameter("@EndDate_Raised", Funs.GetNewDateTime(txtEndDate_Raised.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtTestPackage.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtStartRequired_Date.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Test_Package like @Test_Package";
|
||||
listStr.Add(new SqlParameter("@Test_Package", "%" + this.txtTestPackage.Text.Trim() + "%"));
|
||||
strSql += " AND Required_Date >= @Required_Date";
|
||||
listStr.Add(new SqlParameter("@Required_Date", Funs.GetNewDateTime(txtStartRequired_Date.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtDiscipline.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtEndRequired_Date.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Discipline like @Discipline";
|
||||
listStr.Add(new SqlParameter("@Discipline", "%" + this.txtDiscipline.Text.Trim() + "%"));
|
||||
strSql += " AND Required_Date <= @Required_Date";
|
||||
listStr.Add(new SqlParameter("@Required_Date", Funs.GetNewDateTime(txtEndRequired_Date.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtIdentified.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtStartActual_Date.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Identified like @Identified";
|
||||
listStr.Add(new SqlParameter("@Identified", "%" + this.txtIdentified.Text.Trim() + "%"));
|
||||
strSql += " AND Actual_Date >= @Actual_Date";
|
||||
listStr.Add(new SqlParameter("@Actual_Date", Funs.GetNewDateTime(txtStartActual_Date.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtCategory.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(txtEndActual_Date.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Category like @Category";
|
||||
listStr.Add(new SqlParameter("@Category", "%" + this.txtCategory.Text.Trim() + "%"));
|
||||
strSql += " AND Actual_Date <= @Actual_Date";
|
||||
listStr.Add(new SqlParameter("@Actual_Date", Funs.GetNewDateTime(txtEndActual_Date.Text.Trim())));
|
||||
}
|
||||
strSql += " order by Punch_No ";
|
||||
strSql += " order by Num_No ";
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -175,6 +178,56 @@ namespace FineUIPro.Web.Transfer
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Photoes附件
|
||||
/// <summary>
|
||||
/// 右键附件上传功能
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuAttachA_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?type=0&toKeyId={0}_A&path=FileUpload/Transfer/PunchlistFrom&menuId={1}", Grid1.SelectedRowID, BLL.Const.PunchlistFromMenuId)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Corrected_Photos附件
|
||||
/// <summary>
|
||||
/// 右键附件上传功能
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuAttachB_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader.aspx?type=0&toKeyId={0}_B&path=FileUpload/Transfer/PunchlistFrom&menuId={1}", Grid1.SelectedRowID, BLL.Const.PunchlistFromMenuId)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 获取附件(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="Id_type"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImageUrlByImage(object Id_type)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (Id_type != null)
|
||||
{
|
||||
var registration = BLL.AttachFileService.GetAttachFile(Id_type.ToString(), BLL.Const.PunchlistFromMenuId);
|
||||
if (registration != null)
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowImage("../../", registration.AttachUrl);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
@@ -205,11 +258,15 @@ namespace FineUIPro.Web.Transfer
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
//this.btnNew.Hidden = false;
|
||||
btnMenuAttachA.Hidden=false;
|
||||
btnMenuAttachB.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
//this.btnMenuModify.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
btnMenuAttachA.Hidden = false;
|
||||
btnMenuAttachB.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user