质量资料收发文调整
This commit is contained in:
@@ -20,6 +20,10 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.UnitService.GetUnit(this.drpSendUnitId, this.CurrUser.LoginProjectId, true);//发件单位
|
||||
BLL.UnitService.GetUnit(this.drpReceiveUnit, this.CurrUser.LoginProjectId, true);//接收单位
|
||||
BLL.ReceivingDocTypeService.InitReceivingDocType(this.drpFileType, true);//文件类别
|
||||
BLL.CNProfessionalService.InitCNProfessionalDocDownList(this.drpCNProfessionalId, true);//专业
|
||||
GetButtonPower();
|
||||
BindGrid();
|
||||
}
|
||||
@@ -62,15 +66,55 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
|
||||
if (!string.IsNullOrEmpty(this.stxtFileCode.Text.Trim()))
|
||||
//if (!string.IsNullOrEmpty(this.stxtFileName.Text.Trim()))
|
||||
//{
|
||||
// strSql += " AND doc.FileName LIKE @stxtFileName";
|
||||
// listStr.Add(new SqlParameter("@stxtFileName", "%" + stxtFileName.Text.Trim() + "%"));
|
||||
//}
|
||||
if (!string.IsNullOrEmpty(this.txtFile.Text.Trim()))
|
||||
{
|
||||
strSql += " AND doc.FileCode LIKE @stxtFileCode";
|
||||
listStr.Add(new SqlParameter("@stxtFileCode", "%" + stxtFileCode.Text.Trim() + "%"));
|
||||
strSql += " AND (doc.FileCode LIKE @txtFile or doc.FileName LIKE @txtFile)";
|
||||
listStr.Add(new SqlParameter("@txtFile", "%" + txtFile.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.stxtFileName.Text.Trim()))
|
||||
if (this.drpFileType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND doc.FileName LIKE @stxtFileName";
|
||||
listStr.Add(new SqlParameter("@stxtFileName", "%" + stxtFileName.Text.Trim() + "%"));
|
||||
strSql += " AND doc.FileType =@FileType";
|
||||
listStr.Add(new SqlParameter("@FileType", drpFileType.SelectedValue));
|
||||
}
|
||||
if (this.drpCNProfessionalId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND doc.CNProfessionalId =@CNProfessionalId";
|
||||
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessionalId.SelectedValue));
|
||||
}
|
||||
if (this.drpSendUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND doc.SendUnit = @SendUnit";
|
||||
listStr.Add(new SqlParameter("@SendUnit", this.drpSendUnitId.SelectedValue));
|
||||
}
|
||||
if (this.drpReceiveUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND doc.ReceiveUnit like @ReceiveUnit";
|
||||
listStr.Add(new SqlParameter("@ReceiveUnit", "%" + this.drpReceiveUnit.SelectedValue + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtReceiveDateStart.Text.Trim()))
|
||||
{
|
||||
strSql += " AND doc.ReceiveDate >= @ReceiveDateStart";
|
||||
listStr.Add(new SqlParameter("@ReceiveDateStart", Funs.GetNewDateTime(this.txtReceiveDateStart.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtReceiveDateEnd.Text.Trim()))
|
||||
{
|
||||
strSql += " AND doc.ReceiveDate <= @ReceiveDateEnd";
|
||||
listStr.Add(new SqlParameter("@ReceiveDateEnd", Funs.GetNewDateTime(this.txtReceiveDateEnd.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSendDateStart.Text.Trim()))
|
||||
{
|
||||
strSql += " AND doc.SendDate >= @SendDateStart";
|
||||
listStr.Add(new SqlParameter("@SendDateStart", Funs.GetNewDateTime(txtSendDateStart.Text.Trim())));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtSendDateEnd.Text.Trim()))
|
||||
{
|
||||
strSql += " AND doc.SendDate <= @SendDateEnd";
|
||||
listStr.Add(new SqlParameter("@SendDateEnd", Funs.GetNewDateTime(txtSendDateEnd.Text.Trim())));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
@@ -339,14 +383,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
var lists = (from x in Funs.DB.Comprehensive_DataReceivingDoc
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x);
|
||||
if (!string.IsNullOrEmpty(this.stxtFileCode.Text.Trim()))
|
||||
if (!string.IsNullOrEmpty(this.txtFile.Text.Trim()))
|
||||
{
|
||||
lists = lists.Where(x => x.FileCode.Contains(stxtFileCode.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.stxtFileName.Text.Trim()))
|
||||
{
|
||||
lists = lists.Where(x => x.FileName.Contains(this.stxtFileName.Text.Trim()));
|
||||
lists = lists.Where(x => x.FileCode.Contains(txtFile.Text.Trim()) || x.FileName.Contains(txtFile.Text.Trim()));
|
||||
}
|
||||
//if (!string.IsNullOrEmpty(this.stxtFileName.Text.Trim()))
|
||||
//{
|
||||
// lists = lists.Where(x => x.FileName.Contains(this.stxtFileName.Text.Trim()));
|
||||
//}
|
||||
lists = lists.OrderBy(x => x.RemarkCode);
|
||||
if (lists != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user