20241227 新增support document

This commit is contained in:
毕文静 2024-12-27 23:42:33 +08:00
parent c64319cbe7
commit 782619de37
14 changed files with 2075 additions and 174 deletions

View File

@ -226,6 +226,8 @@
<Compile Include="SoftRegeditService.cs" />
<Compile Include="SQLHelper.cs" />
<Compile Include="Common\UploadFileService.cs" />
<Compile Include="SupportDocument\GuideManualService.cs" />
<Compile Include="SupportDocument\TemplateService.cs" />
<Compile Include="SysManage\Sys_ButtonPowerService.cs" />
<Compile Include="SysManage\Sys_LogService.cs" />
<Compile Include="SysManage\Sys_RolePowerService.cs" />

View File

@ -165,6 +165,11 @@ namespace BLL
/// </summary>
public const string BtnBatchDownload = "BatchDownload";
/// <summary>
/// 下载
/// </summary>
public const string BtnDownload = "Download";
/// <summary>
/// 发送
/// </summary>
@ -464,6 +469,18 @@ namespace BLL
/// </summary>
public const string IncidentInvestigationMenuId = "493D726E-FF86-4A76-A65B-CB14F02195D2";
#endregion
#region
/// <summary>
/// 模板
/// </summary>
public const string TemplateMenuId = "BD66323D-7257-4D9D-8F4A-7D0F8724AB79";
/// <summary>
/// 指导手册
/// </summary>
public const string GuideManualMenuId = "4B9183A5-35CB-4FED-BFA9-E0869684B1B4";
#endregion
#endregion
#region

View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 指导手册
/// </summary>
public class GuideManualService
{
/// <summary>
/// 根据Id获取指导手册
/// </summary>
/// <param name="guideManualId"></param>
/// <returns></returns>
public static Model.SupportDocument_GuideManual GetGuideManualById(string guideManualId)
{
return Funs.DB.SupportDocument_GuideManual.FirstOrDefault(e => e.GuideManualId == guideManualId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="guideManual"></param>
public static void AddGuideManual(Model.SupportDocument_GuideManual guideManual)
{
Model.SupportDocument_GuideManual newGuideManual = new Model.SupportDocument_GuideManual
{
GuideManualId = guideManual.GuideManualId,
GuideManual = guideManual.GuideManual,
UploadBy = guideManual.UploadBy,
UploadDate = guideManual.UploadDate,
AttachUrl = guideManual.AttachUrl
};
Funs.DB.SupportDocument_GuideManual.InsertOnSubmit(newGuideManual);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="guideManual"></param>
public static void UpdateGuideManual(Model.SupportDocument_GuideManual guideManual)
{
Model.SupportDocument_GuideManual newGuideManual = Funs.DB.SupportDocument_GuideManual.FirstOrDefault(e => e.GuideManualId == guideManual.GuideManualId);
if (newGuideManual == null)
{
newGuideManual.GuideManual = guideManual.GuideManual;
newGuideManual.UploadBy = guideManual.UploadBy;
newGuideManual.UploadDate = guideManual.UploadDate;
newGuideManual.AttachUrl = guideManual.AttachUrl;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除指导手册
/// </summary>
/// <param name="guideManualId"></param>
public static void DeleteGuideManualById(string guideManualId)
{
Model.SupportDocument_GuideManual guideManual = Funs.DB.SupportDocument_GuideManual.FirstOrDefault(e => e.GuideManualId == guideManualId);
if (guideManual!=null)
{
BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, guideManualId, BLL.Const.GuideManualMenuId);//删除附件
Funs.DB.SupportDocument_GuideManual.DeleteOnSubmit(guideManual);
Funs.DB.SubmitChanges();
}
}
}
}

View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 模板
/// </summary>
public class TemplateService
{
/// <summary>
/// 根据主键获取模板
/// </summary>
/// <param name="templateId"></param>
/// <returns></returns>
public static Model.SupportDocument_Template GetTemplateById(string templateId)
{
return Funs.DB.SupportDocument_Template.FirstOrDefault(e => e.TemplateId == templateId);
}
/// <summary>
/// 添加
/// </summary>
/// <param name="template"></param>
public static void AddTemplate(Model.SupportDocument_Template template)
{
Model.SupportDocument_Template newTemplate = new Model.SupportDocument_Template
{
TemplateId = template.TemplateId,
Template = template.Template,
UploadBy = template.UploadBy,
UploadDate = template.UploadDate,
AttachUrl = template.AttachUrl,
};
Funs.DB.SupportDocument_Template.InsertOnSubmit(newTemplate);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改
/// </summary>
/// <param name="template"></param>
public static void UpdateTemplate(Model.SupportDocument_Template template)
{
Model.SupportDocument_Template newTemplate = Funs.DB.SupportDocument_Template.FirstOrDefault(e => e.TemplateId == template.TemplateId);
if (newTemplate!=null)
{
newTemplate.Template = template.Template;
newTemplate.UploadBy = template.UploadBy;
newTemplate.UploadDate = template.UploadDate;
newTemplate.AttachUrl = template.AttachUrl;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除
/// </summary>
/// <param name="templateId"></param>
public static void DeleteTemplateById(string templateId)
{
Model.SupportDocument_Template template = Funs.DB.SupportDocument_Template.FirstOrDefault(e => e.TemplateId == templateId);
if (template != null)
{
BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, templateId, BLL.Const.TemplateMenuId);//删除附件
Funs.DB.SupportDocument_Template.DeleteOnSubmit(template);
Funs.DB.SubmitChanges();
}
}
}
}

View File

@ -236,6 +236,7 @@ namespace FineUIPro.Web.AttachFile
JObject item = source[i] as JObject;
string attachUrl = AttachPath + "\\" + item.Value<string>("savedName").Replace('/', '\\');
string fileName = item.Value<string>("name");
string name = fileName.Substring(0, fileName.LastIndexOf("."));
string Id = string.Empty;
if (MenuId == BLL.Const.StandardTemplateMenuId)
{
@ -249,7 +250,6 @@ namespace FineUIPro.Web.AttachFile
BLL.StandardTemplateService.AddStandardTemplate(temp);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Standard Template!");
}
if (MenuId == BLL.Const.SESRelatedDateMenuId)
{
if (AttachPath.Contains("SignedContracts"))
@ -312,7 +312,6 @@ namespace FineUIPro.Web.AttachFile
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add One Time Contracts Contract Management!");
}
}
if (MenuId == BLL.Const.CTSalesContractsMenuId)
{
if (AttachPath.Contains("SignedContracts"))
@ -344,6 +343,30 @@ namespace FineUIPro.Web.AttachFile
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add CT Sales Contracts Signed Contract Management!");
}
}
if (MenuId==BLL.Const.TemplateMenuId)
{
Model.SupportDocument_Template temp = new Model.SupportDocument_Template();
Id = ToKeyId;
temp.TemplateId = Id;
temp.Template = name;
temp.UploadDate = DateTime.Now;
temp.UploadBy = this.CurrUser.UserId;
temp.AttachUrl = attachUrl;
BLL.TemplateService.AddTemplate(temp);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Template!");
}
if (MenuId==BLL.Const.GuideManualMenuId)
{
Model.SupportDocument_GuideManual temp = new Model.SupportDocument_GuideManual();
Id = ToKeyId;
temp.GuideManualId = Id;
temp.GuideManual = name;
temp.UploadDate = DateTime.Now;
temp.UploadBy = this.CurrUser.UserId;
temp.AttachUrl = attachUrl;
BLL.GuideManualService.AddGuideManual(temp);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Guide Manual!");
}
Model.AttachFile att = new Model.AttachFile();
att.AttachFileId = BLL.SQLHelper.GetNewID(typeof(Model.AttachFile));
@ -465,6 +488,30 @@ namespace FineUIPro.Web.AttachFile
}
}
if (MenuId==BLL.Const.TemplateMenuId)
{
Model.SupportDocument_Template temp = new Model.SupportDocument_Template();
temp.TemplateId = ToKeyId;
temp.Template = fileName;
temp.UploadDate = DateTime.Now;
temp.AttachUrl = attachUrl;
temp.UploadBy = this.CurrUser.UserId;
BLL.TemplateService.UpdateTemplate(temp);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Template!");
}
if (MenuId==BLL.Const.GuideManualMenuId)
{
Model.SupportDocument_GuideManual temp = new Model.SupportDocument_GuideManual();
temp.GuideManualId = ToKeyId;
temp.GuideManual = fileName;
temp.UploadDate = DateTime.Now;
temp.AttachUrl = attachUrl;
temp.UploadBy = this.CurrUser.UserId;
BLL.GuideManualService.UpdateGuideManual(temp);
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Guide Manual!");
}
var sour = from x in db.AttachFile where x.ToKeyId == ToKeyId select x;
Model.AttachFile att = db.AttachFile.FirstOrDefault(x => x.AttachFileId == sour.First().AttachFileId);
if (att != null)

View File

@ -171,7 +171,7 @@ namespace FineUIPro.Web.Evaluation
Funs.DB.SubmitChanges();
#region
percentIn[UserId] = (int)(100 / 5);
percentIn[UserId] = (int)(100 / 6);
List<Model.FC_OverviewReport> ovList = new List<Model.FC_OverviewReport>();
List<SqlParameter> overParam = new List<SqlParameter>();
@ -372,8 +372,8 @@ namespace FineUIPro.Web.Evaluation
#endregion
#region
percentIn[UserId] = (int)((100 * 2) / 5);
#region
percentIn[UserId] = (int)((100 * 2) / 6);
List<Model.FC_OverviewReport> ovList1 = new List<Model.FC_OverviewReport>();
List<SqlParameter> overParam1 = new List<SqlParameter>();
@ -386,62 +386,62 @@ namespace FineUIPro.Web.Evaluation
for (int i = 0; i < OverviewReport1.Rows.Count; i++)
{
Model.FC_OverviewReport ov = new Model.FC_OverviewReport();
ov.ReportMonth = OverviewReport.Rows[i]["ReportMonth"].ToString();
ov.FO_NO = OverviewReport.Rows[i]["FO_NO"].ToString();
ov.Work_Description = OverviewReport.Rows[i]["Work_Description"].ToString();
ov.Contractor = OverviewReport.Rows[i]["Contractor"].ToString();
ov.ContractorCN = OverviewReport.Rows[i]["ContractorCN"].ToString();
ov.ContractorEN = OverviewReport.Rows[i]["ContractorEN"].ToString();
ov.ContractorShortName = OverviewReport.Rows[i]["ContractorShortName"].ToString();
ov.Main_Coordinator = OverviewReport.Rows[i]["Main_Coordinator"].ToString();
ov.Total = Convert.ToDecimal(OverviewReport.Rows[i]["Total"]);
ov.Participation_Rate = Convert.ToDecimal(OverviewReport.Rows[i]["Participation_Rate"]);
ov.EvaluateNum = Convert.ToInt32(OverviewReport.Rows[i]["EvaluateNum"]);
ov.UserNum = Convert.ToInt32(OverviewReport.Rows[i]["UserNum"]);
ov.ReportMonth = OverviewReport1.Rows[i]["ReportMonth"].ToString();
ov.FO_NO = OverviewReport1.Rows[i]["FO_NO"].ToString();
ov.Work_Description = OverviewReport1.Rows[i]["Work_Description"].ToString();
ov.Contractor = OverviewReport1.Rows[i]["Contractor"].ToString();
ov.ContractorCN = OverviewReport1.Rows[i]["ContractorCN"].ToString();
ov.ContractorEN = OverviewReport1.Rows[i]["ContractorEN"].ToString();
ov.ContractorShortName = OverviewReport1.Rows[i]["ContractorShortName"].ToString();
ov.Main_Coordinator = OverviewReport1.Rows[i]["Main_Coordinator"].ToString();
ov.Total = Convert.ToDecimal(OverviewReport1.Rows[i]["Total"]);
ov.Participation_Rate = Convert.ToDecimal(OverviewReport1.Rows[i]["Participation_Rate"]);
ov.EvaluateNum = Convert.ToInt32(OverviewReport1.Rows[i]["EvaluateNum"]);
ov.UserNum = Convert.ToInt32(OverviewReport1.Rows[i]["UserNum"]);
if (OverviewReport.Rows[i]["AvgEvaScore1"] != null && OverviewReport.Rows[i]["AvgEvaScore1"].ToString() != "")
if (OverviewReport1.Rows[i]["AvgEvaScore1"] != null && OverviewReport1.Rows[i]["AvgEvaScore1"].ToString() != "")
{
ov.AvgEvaScore1 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore1"]);
ov.AvgEvaScore1 = Convert.ToDecimal(OverviewReport1.Rows[i]["AvgEvaScore1"]);
}
else
{
ov.AvgEvaScore1 = null;
}
if (OverviewReport.Rows[i]["TotalAvgScore1"] != null && OverviewReport.Rows[i]["TotalAvgScore1"].ToString() != "")
if (OverviewReport1.Rows[i]["TotalAvgScore1"] != null && OverviewReport1.Rows[i]["TotalAvgScore1"].ToString() != "")
{
ov.TotalAvgScore1 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore1"]);
ov.TotalAvgScore1 = Convert.ToDecimal(OverviewReport1.Rows[i]["TotalAvgScore1"]);
}
else
{
ov.TotalAvgScore1 = null;
}
if (OverviewReport.Rows[i]["AvgEvaScore2"] != null && OverviewReport.Rows[i]["AvgEvaScore2"].ToString() != "")
if (OverviewReport1.Rows[i]["AvgEvaScore2"] != null && OverviewReport1.Rows[i]["AvgEvaScore2"].ToString() != "")
{
ov.AvgEvaScore2 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore2"]);
ov.AvgEvaScore2 = Convert.ToDecimal(OverviewReport1.Rows[i]["AvgEvaScore2"]);
}
else
{
ov.AvgEvaScore2 = null;
}
if (OverviewReport.Rows[i]["TotalAvgScore2"] != null && OverviewReport.Rows[i]["TotalAvgScore2"].ToString() != "")
if (OverviewReport1.Rows[i]["TotalAvgScore2"] != null && OverviewReport1.Rows[i]["TotalAvgScore2"].ToString() != "")
{
ov.TotalAvgScore2 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore2"]);
ov.TotalAvgScore2 = Convert.ToDecimal(OverviewReport1.Rows[i]["TotalAvgScore2"]);
}
else
{
ov.TotalAvgScore2 = null;
}
if (OverviewReport.Rows[i]["AvgEvaScore3"] != null && OverviewReport.Rows[i]["AvgEvaScore3"].ToString() != "")
if (OverviewReport1.Rows[i]["AvgEvaScore3"] != null && OverviewReport1.Rows[i]["AvgEvaScore3"].ToString() != "")
{
ov.AvgEvaScore3 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore3"]);
ov.AvgEvaScore3 = Convert.ToDecimal(OverviewReport1.Rows[i]["AvgEvaScore3"]);
}
else
{
ov.AvgEvaScore3 = null;
}
if (OverviewReport.Rows[i]["TotalAvgScore3"] != null && OverviewReport.Rows[i]["TotalAvgScore3"].ToString() != "")
if (OverviewReport1.Rows[i]["TotalAvgScore3"] != null && OverviewReport1.Rows[i]["TotalAvgScore3"].ToString() != "")
{
ov.TotalAvgScore3 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore3"]);
}
@ -467,99 +467,99 @@ namespace FineUIPro.Web.Evaluation
// ov.TotalAvgScore4 = null;
//}
if (OverviewReport.Rows[i]["AvgEvaScore5"] != null && OverviewReport.Rows[i]["AvgEvaScore5"].ToString() != "")
if (OverviewReport1.Rows[i]["AvgEvaScore5"] != null && OverviewReport1.Rows[i]["AvgEvaScore5"].ToString() != "")
{
ov.AvgEvaScore5 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore5"]);
ov.AvgEvaScore5 = Convert.ToDecimal(OverviewReport1.Rows[i]["AvgEvaScore5"]);
}
else
{
ov.AvgEvaScore5 = null;
}
if (OverviewReport.Rows[i]["TotalAvgScore5"] != null && OverviewReport.Rows[i]["TotalAvgScore5"].ToString() != "")
if (OverviewReport1.Rows[i]["TotalAvgScore5"] != null && OverviewReport1.Rows[i]["TotalAvgScore5"].ToString() != "")
{
ov.TotalAvgScore5 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore5"]);
ov.TotalAvgScore5 = Convert.ToDecimal(OverviewReport1.Rows[i]["TotalAvgScore5"]);
}
else
{
ov.TotalAvgScore5 = null;
}
if (OverviewReport.Rows[i]["AvgEvaScore6"] != null && OverviewReport.Rows[i]["AvgEvaScore6"].ToString() != "")
if (OverviewReport1.Rows[i]["AvgEvaScore6"] != null && OverviewReport1.Rows[i]["AvgEvaScore6"].ToString() != "")
{
ov.AvgEvaScore6 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore6"]);
ov.AvgEvaScore6 = Convert.ToDecimal(OverviewReport1.Rows[i]["AvgEvaScore6"]);
}
else
{
ov.AvgEvaScore6 = null;
}
if (OverviewReport.Rows[i]["TotalAvgScore6"] != null && OverviewReport.Rows[i]["TotalAvgScore6"].ToString() != "")
if (OverviewReport1.Rows[i]["TotalAvgScore6"] != null && OverviewReport1.Rows[i]["TotalAvgScore6"].ToString() != "")
{
ov.TotalAvgScore6 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore6"]);
ov.TotalAvgScore6 = Convert.ToDecimal(OverviewReport1.Rows[i]["TotalAvgScore6"]);
}
else
{
ov.TotalAvgScore6 = null;
}
if (OverviewReport.Rows[i]["TimelyAvgSocre"] != null && OverviewReport.Rows[i]["TimelyAvgSocre"].ToString() != "")
if (OverviewReport1.Rows[i]["TimelyAvgSocre"] != null && OverviewReport1.Rows[i]["TimelyAvgSocre"].ToString() != "")
{
ov.TimelyAvgSocre = Convert.ToDecimal(OverviewReport.Rows[i]["TimelyAvgSocre"]);
ov.TimelyAvgSocre = Convert.ToDecimal(OverviewReport1.Rows[i]["TimelyAvgSocre"]);
}
else
{
ov.TimelyAvgSocre = null;
}
if (OverviewReport.Rows[i]["HonestyAvgScore"] != null && OverviewReport.Rows[i]["HonestyAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["HonestyAvgScore"] != null && OverviewReport1.Rows[i]["HonestyAvgScore"].ToString() != "")
{
ov.HonestyAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["HonestyAvgScore"]);
ov.HonestyAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["HonestyAvgScore"]);
}
else
{
ov.HonestyAvgScore = null;
}
if (OverviewReport.Rows[i]["CTSSAvgScore"] != null && OverviewReport.Rows[i]["CTSSAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["CTSSAvgScore"] != null && OverviewReport1.Rows[i]["CTSSAvgScore"].ToString() != "")
{
ov.CTSSAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["CTSSAvgScore"]);
ov.CTSSAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["CTSSAvgScore"]);
}
else
{
ov.CTSSAvgScore = null;
}
if (OverviewReport.Rows[i]["CTSCAvgScore"] != null && OverviewReport.Rows[i]["CTSCAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["CTSCAvgScore"] != null && OverviewReport1.Rows[i]["CTSCAvgScore"].ToString() != "")
{
ov.CTSCAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["CTSCAvgScore"]);
ov.CTSCAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["CTSCAvgScore"]);
}
else
{
ov.CTSCAvgScore = null;
}
if (OverviewReport.Rows[i]["MainCoordinatorAvgScore"] != null && OverviewReport.Rows[i]["MainCoordinatorAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["MainCoordinatorAvgScore"] != null && OverviewReport1.Rows[i]["MainCoordinatorAvgScore"].ToString() != "")
{
ov.MainCoordinatorAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["MainCoordinatorAvgScore"]);
ov.MainCoordinatorAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["MainCoordinatorAvgScore"]);
}
else
{
ov.MainCoordinatorAvgScore = null;
}
if (OverviewReport.Rows[i]["UserRepresentativeAvgScore"] != null && OverviewReport.Rows[i]["UserRepresentativeAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["UserRepresentativeAvgScore"] != null && OverviewReport1.Rows[i]["UserRepresentativeAvgScore"].ToString() != "")
{
ov.UserRepresentativeAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["UserRepresentativeAvgScore"]);
ov.UserRepresentativeAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["UserRepresentativeAvgScore"]);
}
else
{
ov.UserRepresentativeAvgScore = null;
}
if (OverviewReport.Rows[i]["CTSTAvgScore"] != null && OverviewReport.Rows[i]["CTSTAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["CTSTAvgScore"] != null && OverviewReport1.Rows[i]["CTSTAvgScore"].ToString() != "")
{
ov.CTSTAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["CTSTAvgScore"]);
ov.CTSTAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["CTSTAvgScore"]);
}
else
{
ov.CTSTAvgScore = null;
}
if (OverviewReport.Rows[i]["CTEDAvgScore"] != null && OverviewReport.Rows[i]["CTEDAvgScore"].ToString() != "")
if (OverviewReport1.Rows[i]["CTEDAvgScore"] != null && OverviewReport1.Rows[i]["CTEDAvgScore"].ToString() != "")
{
ov.CTEDAvgScore = Convert.ToDecimal(OverviewReport.Rows[i]["CTEDAvgScore"]);
ov.CTEDAvgScore = Convert.ToDecimal(OverviewReport1.Rows[i]["CTEDAvgScore"]);
}
else
{
@ -573,8 +573,9 @@ namespace FineUIPro.Web.Evaluation
Funs.DB.SubmitChanges();
#endregion
#region
percentIn[UserId] = (int)((100 * 3) / 5);
#region
#region -
percentIn[UserId] = (int)((100 * 3) / 6);
List<Model.FC_NoEvaluatedUser> NoEvalUserList = new List<Model.FC_NoEvaluatedUser>();
List<SqlParameter> param = new List<SqlParameter>();
@ -771,8 +772,8 @@ namespace FineUIPro.Web.Evaluation
}
#endregion
#region
percentIn[UserId] = (int)((100 * 4) / 5);
#region -
percentIn[UserId] = (int)((100 * 4) / 6);
List<Model.FC_NoEvaluatedUser> NoEvalUserList1 = new List<Model.FC_NoEvaluatedUser>();
List<SqlParameter> param1 = new List<SqlParameter>();
@ -966,12 +967,12 @@ namespace FineUIPro.Web.Evaluation
Funs.DB.FC_NoEvaluatedUser.InsertAllOnSubmit(NoEvalUserList1);
Funs.DB.SubmitChanges();
}
percentIn[UserId] = (int)((100 * 4) / 4);
#endregion
#endregion
#region
percentIn[UserId] = (int)((100 * 5) / 5);
percentIn[UserId] = (int)((100 * 5) / 6);
List<Model.FC_BigDepartEvaRate> departEvaRateList = new List<Model.FC_BigDepartEvaRate>();
List<SqlParameter> departEvaRateParam1 = new List<SqlParameter>();
departEvaRateParam1.Add(new SqlParameter("@StartTime", sTime));
@ -995,12 +996,49 @@ namespace FineUIPro.Web.Evaluation
{
ov.Participation_Rate_Type = "部门参与率";
}
ov.IsSafe = true;
ov.IsSafe = false;
departEvaRateList.Add(ov);
}
}
Funs.DB.FC_BigDepartEvaRate.InsertAllOnSubmit(departEvaRateList);
Funs.DB.SubmitChanges();
if (departEvaRateList.Count > 0)
{
Funs.DB.FC_BigDepartEvaRate.InsertAllOnSubmit(departEvaRateList);
Funs.DB.SubmitChanges();
}
percentIn[UserId] = (int)((100 * 6) / 6);
List<Model.FC_BigDepartEvaRate> departEvaRateList2 = new List<Model.FC_BigDepartEvaRate>();
List<SqlParameter> departEvaRateParam2 = new List<SqlParameter>();
departEvaRateParam2.Add(new SqlParameter("@StartTime", sTime));
departEvaRateParam2.Add(new SqlParameter("@EndTime", eTime));
SqlParameter[] departEvaRateParamList2 = departEvaRateParam2.ToArray();
DataTable departEvaRate2 = SQLHelper.GetDataTableRunProc("sp_Safety_DepParticipationRate", departEvaRateParamList2);
if (departEvaRate2.Rows.Count > 0)
{
for (int i = 0; i < departEvaRate2.Rows.Count; i++)
{
Model.FC_BigDepartEvaRate ov = new Model.FC_BigDepartEvaRate();
ov.ReportMonth = departEvaRate2.Rows[i]["ReportMonth"].ToString();
ov.Depart = departEvaRate2.Rows[i]["DepartCode"].ToString().Replace("Z", "");
ov.Team = departEvaRate2.Rows[i]["SubDepartCode"].ToString();
ov.Participation_Rate = Convert.ToDecimal(departEvaRate2.Rows[i]["Rate"]);
if (ov.Team != null && !string.IsNullOrEmpty(ov.Team))
{
ov.Participation_Rate_Type = "团队参与率";
}
else
{
ov.Participation_Rate_Type = "部门参与率";
}
ov.IsSafe = true;
departEvaRateList2.Add(ov);
}
}
if (departEvaRateList2.Count > 0)
{
Funs.DB.FC_BigDepartEvaRate.InsertAllOnSubmit(departEvaRateList2);
Funs.DB.SubmitChanges();
}
#endregion
}
#endregion
@ -1053,7 +1091,7 @@ namespace FineUIPro.Web.Evaluation
#region
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)(100 * (j + 1) / (toDiff * 5));
percentIn[UserId] = (int)(100 * (j + 1) / (toDiff * 6));
List<Model.FC_OverviewReport> ovList = new List<Model.FC_OverviewReport>();
List<SqlParameter> overParam = new List<SqlParameter>();
@ -1253,10 +1291,10 @@ namespace FineUIPro.Web.Evaluation
Funs.DB.SubmitChanges();
}
#endregion
#region
#region
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)((100 * (j + 1+ toDiff)) / (toDiff * 5));
percentIn[UserId] = (int)((100 * (j + 1+ toDiff)) / (toDiff * 6));
List<Model.FC_OverviewReport> ovList = new List<Model.FC_OverviewReport>();
List<SqlParameter> overParam = new List<SqlParameter>();
@ -1332,24 +1370,6 @@ namespace FineUIPro.Web.Evaluation
{
ov.TotalAvgScore3 = null;
}
//if (OverviewReport.Rows[i]["AvgEvaScore4"] != null && OverviewReport.Rows[i]["AvgEvaScore4"].ToString() != "")
//{
// ov.AvgEvaScore4 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore4"]);
//}
//else
//{
// ov.AvgEvaScore4 = null;
//}
//if (OverviewReport.Rows[i]["TotalAvgScore4"] != null && OverviewReport.Rows[i]["TotalAvgScore4"].ToString() != "")
//{
// ov.TotalAvgScore4 = Convert.ToDecimal(OverviewReport.Rows[i]["TotalAvgScore4"]);
//}
//else
//{
// ov.TotalAvgScore4 = null;
//}
if (OverviewReport.Rows[i]["AvgEvaScore5"] != null && OverviewReport.Rows[i]["AvgEvaScore5"].ToString() != "")
{
ov.AvgEvaScore5 = Convert.ToDecimal(OverviewReport.Rows[i]["AvgEvaScore5"]);
@ -1460,7 +1480,7 @@ namespace FineUIPro.Web.Evaluation
#region
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 2)) / (toDiff * 5));
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 2)) / (toDiff * 6));
List<Model.FC_NoEvaluatedUser> NoEvalUserList = new List<Model.FC_NoEvaluatedUser>();
List<SqlParameter> param = new List<SqlParameter>();
@ -1660,7 +1680,7 @@ namespace FineUIPro.Web.Evaluation
#region
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 3)) / (toDiff * 5));
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 3)) / (toDiff * 6));
List<Model.FC_NoEvaluatedUser> NoEvalUserList = new List<Model.FC_NoEvaluatedUser>();
List<SqlParameter> param = new List<SqlParameter>();
@ -1858,31 +1878,10 @@ namespace FineUIPro.Web.Evaluation
}
#endregion
#region
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)(100 * (j + 4) / (toDiff * 5));
//List<Model.FC_BigDepartEvaRate> ovList = new List<Model.FC_BigDepartEvaRate>();
//List<SqlParameter> overParam = new List<SqlParameter>();
//overParam.Add(new SqlParameter("@StartTime", sTime.AddMonths(j)));
//overParam.Add(new SqlParameter("@EndTime", eTime.AddMonths(j)));
//SqlParameter[] overParList = overParam.ToArray();
//DataTable OverviewReport = SQLHelper.GetDataTableRunProc("sp_DepParticipationRate", overParList);
//if (OverviewReport.Rows.Count > 0)
//{
// for (int i = 0; i < OverviewReport.Rows.Count; i++)
// {
// Model.FC_OverviewReport ov = new Model.FC_OverviewReport();
// ov.ReportMonth = OverviewReport.Rows[i]["ReportMonth"].ToString();
// ov.Participation_Rate = Convert.ToDecimal(OverviewReport.Rows[i]["Participation_Rate"]);
// ov.IsSafe = false;
// ovList.Add(ov);
// }
//}
//Funs.DB.FC_OverviewReport.InsertAllOnSubmit(ovList);
//Funs.DB.SubmitChanges();
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 4)) / (toDiff * 6));
List<Model.FC_BigDepartEvaRate> departEvaRateList = new List<Model.FC_BigDepartEvaRate>();
List<SqlParameter> departEvaRateParam1 = new List<SqlParameter>();
@ -1914,20 +1913,43 @@ namespace FineUIPro.Web.Evaluation
Funs.DB.SubmitChanges();
}
}
//if (j == 0)
//{
// NewOverviewReport = OverviewReport.Copy();
//}
//else
//{
// foreach (DataRow dr in OverviewReport.Rows)
// {
// NewOverviewReport.ImportRow(dr);
// }
//}
for (int j = 0; j < toDiff; j++)
{
percentIn[UserId] = (int)((100 * (j + 1 + toDiff * 5)) / (toDiff * 6));
List<Model.FC_BigDepartEvaRate> departEvaRateList = new List<Model.FC_BigDepartEvaRate>();
List<SqlParameter> departEvaRateParam2 = new List<SqlParameter>();
departEvaRateParam2.Add(new SqlParameter("@StartTime", sTime.AddMonths(j)));
departEvaRateParam2.Add(new SqlParameter("@EndTime", eTime.AddMonths(j)));
SqlParameter[] departEvaRateList2 = departEvaRateParam2.ToArray();
DataTable departEvaRate = SQLHelper.GetDataTableRunProc("sp_Safety_DepParticipationRate", departEvaRateList2);
if (departEvaRate.Rows.Count > 0)
{
for (int i = 0; i < departEvaRate.Rows.Count; i++)
{
Model.FC_BigDepartEvaRate ov = new Model.FC_BigDepartEvaRate();
ov.ReportMonth = departEvaRate.Rows[i]["ReportMonth"].ToString();
ov.Depart = departEvaRate.Rows[i]["DepartCode"].ToString().Replace("Z", "");
ov.Team = departEvaRate.Rows[i]["SubDepartCode"].ToString();
ov.Participation_Rate = Convert.ToDecimal(departEvaRate.Rows[i]["Rate"]);
if (ov.Team != null && !string.IsNullOrEmpty(ov.Team))
{
ov.Participation_Rate_Type = "团队参与率";
}
else
{
ov.Participation_Rate_Type = "部门参与率";
}
ov.IsSafe = true;
departEvaRateList.Add(ov);
}
Funs.DB.FC_BigDepartEvaRate.InsertAllOnSubmit(departEvaRateList);
Funs.DB.SubmitChanges();
}
}
#endregion
}
#endregion
#region
@ -1941,12 +1963,12 @@ namespace FineUIPro.Web.Evaluation
percent = 0;
url = "";
List<Model.View_EMC_Punishment> punishList = (from x in Funs.DB.View_EMC_Punishment where x.Flag == "1" select x).ToList();
List<Model.View_FC_ContractManagement> cmList = (from x in Funs.DB.View_FC_ContractManagement where x.IsExport==true orderby x.FO_NO, x.FileType select x).ToList();
List<Model.View_FC_Contractor> conList = (from x in Funs.DB.View_FC_Contractor where x.FC_Status=="Valid" || x.FC_Status == "Expired Soon" orderby x.Contractor, x.Expire_Date select x).ToList();
List<Model.View_FC_ContractManagement> cmList = (from x in Funs.DB.View_FC_ContractManagement where x.FileType == "NCR" || x.FileType == "合同约谈" || x.FileType == "停工整改报告" orderby x.FO_NO, x.FileType select x).ToList();
List<Model.View_FC_Contractor> conList = (from x in Funs.DB.View_FC_Contractor orderby x.Contractor, x.Expire_Date select x).ToList();
List<Model.FC_OverviewReport> overviewReport = (from x in Funs.DB.FC_OverviewReport where x.IsSafe == false orderby x.ReportMonth, x.FO_NO select x).ToList();
List<Model.FC_OverviewReport> safeOverviewReport = (from x in Funs.DB.FC_OverviewReport where x.IsSafe == true orderby x.ReportMonth, x.FO_NO select x).ToList();
List<Model.FC_NoEvaluatedUser> noEvaluatedUser= (from x in Funs.DB.FC_NoEvaluatedUser orderby x.ReportMonth, x.IsSafe select x).ToList();
List<Model.FC_BigDepartEvaRate> participationRateReport = (from x in Funs.DB.FC_BigDepartEvaRate orderby x.ReportMonth,x.Team select x).ToList();
List<Model.FC_BigDepartEvaRate> participationRateReport = (from x in Funs.DB.FC_BigDepartEvaRate orderby x.ReportMonth, x.Team select x).ToList();
List<Model.FC_SESReport> sesReportList = (from x in Funs.DB.FC_SESReport where x.Accepted != "" && x.Accepted != null select x).ToList();
Thread t = new Thread(new ThreadStart(() => { ExportCN(punishList, cmList, conList, overviewReport , safeOverviewReport, noEvaluatedUser, participationRateReport, sesReportList); }));
@ -2526,7 +2548,7 @@ namespace FineUIPro.Web.Evaluation
wsevalu.GetRow(rowEvalIndex).GetCell(0).CellStyle = fontStyle;
//合同类型
if (wsevalu.GetRow(rowEvalIndex).GetCell(1) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(1);
wsevalu.GetRow(rowEvalIndex).GetCell(1).SetCellValue(item.IsSafe == false ? "非安全" : "安全");
wsevalu.GetRow(rowEvalIndex).GetCell(1).SetCellValue(item.IsSafe == false ? "常规" : "安全");
wsevalu.GetRow(rowEvalIndex).GetCell(1).CellStyle = fontStyle;
//姓名
if (wsevalu.GetRow(rowEvalIndex).GetCell(2) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(2);
@ -2545,13 +2567,29 @@ namespace FineUIPro.Web.Evaluation
wsevalu.GetRow(rowEvalIndex).GetCell(5).SetCellValue(item.RoleName);
wsevalu.GetRow(rowEvalIndex).GetCell(5).CellStyle = fontStyle;
//部门
if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName.Substring(0, item.DepartName.LastIndexOf("/")));
wsevalu.GetRow(rowEvalIndex).GetCell(6).CellStyle = fontStyle;
if (item.DepartName != null && !string.IsNullOrEmpty(item.DepartName))
{
if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
int index = item.DepartName.IndexOf('/');
if (index > 0)
{
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName.Substring(0, index));
}
else
{
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName);
}
wsevalu.GetRow(rowEvalIndex).GetCell(6).CellStyle = fontStyle;
}
//团队
if (wsevalu.GetRow(rowEvalIndex).GetCell(7) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(7);
wsevalu.GetRow(rowEvalIndex).GetCell(7).SetCellValue(item.DepartName);
wsevalu.GetRow(rowEvalIndex).GetCell(7).CellStyle = fontStyle;
if (item.DepartName != null && !string.IsNullOrEmpty(item.DepartName) && item.DepartName.Contains("/"))
{
if (wsevalu.GetRow(rowEvalIndex).GetCell(7) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(7);
wsevalu.GetRow(rowEvalIndex).GetCell(7).SetCellValue(item.DepartName);
wsevalu.GetRow(rowEvalIndex).GetCell(7).CellStyle = fontStyle;
}
//if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
//wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.NotEvaluatedFoNo);
@ -2718,8 +2756,8 @@ namespace FineUIPro.Web.Evaluation
percent = 0;
url = "";
List<Model.View_EMC_Punishment> punishList = (from x in Funs.DB.View_EMC_Punishment where x.Flag == "1" select x).ToList();
List<Model.View_FC_ContractManagement> cmList = (from x in Funs.DB.View_FC_ContractManagement where x.IsExport == true orderby x.FO_NO, x.FileType select x).ToList();
List<Model.View_FC_Contractor> conList = (from x in Funs.DB.View_FC_Contractor where x.FC_Status == "Valid" || x.FC_Status == "Expired Soon" orderby x.Contractor, x.Expire_Date select x).ToList();
List<Model.View_FC_ContractManagement> cmList = (from x in Funs.DB.View_FC_ContractManagement where x.FileType == "NCR" || x.FileType == "合同约谈" || x.FileType == "停工整改报告" orderby x.FO_NO, x.FileType select x).ToList();
List<Model.View_FC_Contractor> conList = (from x in Funs.DB.View_FC_Contractor orderby x.Contractor, x.Expire_Date select x).ToList();
List<Model.FC_OverviewReport> overviewReport = (from x in Funs.DB.FC_OverviewReport where x.IsSafe == false orderby x.ReportMonth, x.FO_NO select x).ToList();
List<Model.FC_OverviewReport> safeOverviewReport = (from x in Funs.DB.FC_OverviewReport where x.IsSafe == true orderby x.ReportMonth, x.FO_NO select x).ToList();
List<Model.FC_NoEvaluatedUser> noEvaluatedUser = (from x in Funs.DB.FC_NoEvaluatedUser orderby x.ReportMonth, x.IsSafe select x).ToList();
@ -3298,7 +3336,7 @@ namespace FineUIPro.Web.Evaluation
wsevalu.GetRow(rowEvalIndex).GetCell(0).SetCellValue(item.ReportMonth);
wsevalu.GetRow(rowEvalIndex).GetCell(0).CellStyle = fontStyle;
if (wsevalu.GetRow(rowEvalIndex).GetCell(1) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(1);
wsevalu.GetRow(rowEvalIndex).GetCell(1).SetCellValue(item.IsSafe == false ? "非安全" : "安全");
wsevalu.GetRow(rowEvalIndex).GetCell(1).SetCellValue(item.IsSafe == false ? "常规" : "安全");
wsevalu.GetRow(rowEvalIndex).GetCell(1).CellStyle = fontStyle;
if (wsevalu.GetRow(rowEvalIndex).GetCell(2) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(2);
wsevalu.GetRow(rowEvalIndex).GetCell(2).SetCellValue(item.UserName);
@ -3312,12 +3350,27 @@ namespace FineUIPro.Web.Evaluation
if (wsevalu.GetRow(rowEvalIndex).GetCell(5) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(5);
wsevalu.GetRow(rowEvalIndex).GetCell(5).SetCellValue(item.RoleName);
wsevalu.GetRow(rowEvalIndex).GetCell(5).CellStyle = fontStyle;
if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName.Substring(0, item.DepartName.LastIndexOf("/")));
wsevalu.GetRow(rowEvalIndex).GetCell(6).CellStyle = fontStyle;
if (wsevalu.GetRow(rowEvalIndex).GetCell(7) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(7);
wsevalu.GetRow(rowEvalIndex).GetCell(7).SetCellValue(item.DepartName);
wsevalu.GetRow(rowEvalIndex).GetCell(7).CellStyle = fontStyle;
if (!string.IsNullOrEmpty(item.DepartName) && item.DepartName != null)
{
if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
int index = item.DepartName.IndexOf('/');
if (index > 0)
{
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName.Substring(0, index));
}
else
{
wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.DepartName);
}
wsevalu.GetRow(rowEvalIndex).GetCell(6).CellStyle = fontStyle;
}
if (!string.IsNullOrEmpty(item.DepartName) && item.DepartName != null && item.DepartName.Contains("/"))
{
if (wsevalu.GetRow(rowEvalIndex).GetCell(7) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(7);
wsevalu.GetRow(rowEvalIndex).GetCell(7).SetCellValue(item.DepartName);
wsevalu.GetRow(rowEvalIndex).GetCell(7).CellStyle = fontStyle;
}
//if (wsevalu.GetRow(rowEvalIndex).GetCell(6) == null) wsevalu.GetRow(rowEvalIndex).CreateCell(6);
//wsevalu.GetRow(rowEvalIndex).GetCell(6).SetCellValue(item.NotEvaluatedFoNo);
//wsevalu.GetRow(rowEvalIndex).GetCell(6).CellStyle = fontStyle;

View File

@ -2678,6 +2678,8 @@
<Content Include="SES\StandardTemplateEdit.aspx" />
<Content Include="ssocallback.aspx" />
<Content Include="Styles\index.aspx" />
<Content Include="SupportDocument\GuideManual.aspx" />
<Content Include="SupportDocument\Template.aspx" />
<Content Include="SysManage\DataBackup.aspx" />
<Content Include="SysManage\LogList.aspx" />
<Content Include="SysManage\RoleList.aspx" />
@ -3629,6 +3631,20 @@
<Compile Include="Styles\index.aspx.designer.cs">
<DependentUpon>index.aspx</DependentUpon>
</Compile>
<Compile Include="SupportDocument\GuideManual.aspx.cs">
<DependentUpon>GuideManual.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportDocument\GuideManual.aspx.designer.cs">
<DependentUpon>GuideManual.aspx</DependentUpon>
</Compile>
<Compile Include="SupportDocument\Template.aspx.cs">
<DependentUpon>Template.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportDocument\Template.aspx.designer.cs">
<DependentUpon>Template.aspx</DependentUpon>
</Compile>
<Compile Include="SysManage\DataBackup.aspx.cs">
<DependentUpon>DataBackup.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -0,0 +1,81 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GuideManual.aspx.cs" Inherits="FineUIPro.Web.SupportDocument.GuideManual" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Guide Manual</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel ID="Panel2" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="Guide Manual" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="GuideManualId" AllowCellEditing="true" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
ClicksToEdit="2" DataIDField="GuideManualId" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill2" runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="Add" Text="Add" Icon="Add" OnClick="btnAdd_Click" runat="server" Hidden="true">
</f:Button>
<f:Button ID="btnEdit" ToolTip="Modify" Text="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnDelete" ToolTip="Delete" Text="Delete" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
runat="server" Hidden="true">
</f:Button>
<f:Button ID="btnBatchDownload" ToolTip="Batch Download" Text="Batch Download" Icon="ArrowDown" EnableAjax="false" OnClick="btnBatchDownload_Click" runat="server" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField Width="50px" TextAlign="Center" HeaderText="No.">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="260px" ColumnID="GuideManual" DataField="GuideManual" FieldType="String" HeaderText="Guide Manual" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="UploadByName" DataField="UploadByName" FieldType="String" HeaderText="Uploaded by" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="UploadDate" DataField="UploadDate" FieldType="Date" Renderer="Date" HeaderText="Uploaded Date" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:TemplateField HeaderText="Attach View" Width="350px" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
<ItemTemplate>
<asp:LinkButton ID="lbtnUrl1" runat="server" CommandArgument='<%# Bind("AttachUrl") %>'
ToolTip="Attach View" EnableAjax="false" Height="20px"></asp:LinkButton>
</ItemTemplate>
</f:TemplateField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" OnClose="Window1_Close"
Height="500px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,329 @@
using BLL;
using ICSharpCode.SharpZipLib.Zip;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.SupportDocument
{
public partial class GuideManual : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();//按钮权限
BindGrid();
}
}
private void BindGrid()
{
string strSql = @"SELECT t.GuideManualId,
t.GuideManual,
t.UploadBy,
t.UploadDate,
t.AttachUrl,
U.UserName AS UploadByName
FROM dbo.SupportDocument_GuideManual AS t
LEFT JOIN Sys_User AS U ON U.UserId = t.UploadBy
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (tvStandardTemp.SelectedNodeID != "0" && tvStandardTemp.SelectedNodeID != null)
//{
// strSql += " AND t.TemplateTypeId = @TemplateTypeId";
// listStr.Add(new SqlParameter("@TemplateTypeId", tvStandardTemp.SelectedNodeID));
//}
strSql += " ORDER BY t.UploadDate DESC";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
System.Web.UI.WebControls.LinkButton lbtnUrl = ((System.Web.UI.WebControls.LinkButton)(this.Grid1.Rows[i].FindControl("lbtnUrl1")));
string url = lbtnUrl.CommandArgument.ToString();
if (!string.IsNullOrEmpty(url))
{
url = url.Replace('\\', '/');
lbtnUrl.Text = BLL.UploadAttachmentService.ShowAttachment("../", url);
}
}
}
//protected void btnSearch_Click(object sender, EventArgs e)
//{
// if (!string.IsNullOrEmpty(this.tvStandardTemp.SelectedNodeID))
// {
// BindGrid(this.tvStandardTemp.SelectedNodeID);
// }
//}
protected void btnAdd_Click(object sender, EventArgs e)
{
string id = SQLHelper.GetNewID(typeof(Model.SupportDocument_GuideManual));
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=add&toKeyId={0}&path=FileUpload/SupportDocument/GuideManual&menuId={1}", id, BLL.Const.GuideManualMenuId)));
}
protected void btnEdit_Click(object sender, EventArgs e)
{
string rowId = Grid1.SelectedRowID;
if (!string.IsNullOrEmpty(rowId))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=edit&toKeyId={0}&path=FileUpload/SupportDocument/GuideManual&menuId={1}", rowId, BLL.Const.GuideManualMenuId)));
}
else
{
Alert.ShowInTop("Please select the record to modify", MessageBoxIcon.Warning);
return;
}
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StandardTemplateEdit.aspx?templateId={0}", rowId, "编辑 - ")));
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var t = BLL.GuideManualService.GetGuideManualById(rowID);
if (t != null)
{
BLL.GuideManualService.DeleteGuideManualById(rowID);
}
}
BindGrid();
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete Guide Manual");
ShowNotify("Deleted successfully!");
}
else
{
Alert.ShowInTop("Please select the record to Delete", MessageBoxIcon.Warning);
return;
}
}
protected void Grid1_RowDoubleClick(object sender, EventArgs e)
{
string rowId = Grid1.SelectedRowID;
if (!string.IsNullOrEmpty(rowId))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=edit&toKeyId={0}&path=FileUpload/SupportDocument/GuideManual&menuId={1}", rowId, BLL.Const.GuideManualMenuId)));
}
else
{
Alert.ShowInTop("Please select the record to modify", MessageBoxIcon.Warning);
return;
}
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StandardTemplateEdit.aspx?templateId={0}", rowId, "编辑 - ")));
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
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();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#region
/// <summary>
/// 菜单按钮权限
/// </summary>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.GuideManualMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDownload))
{
this.btnBatchDownload.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnDelete.Hidden = false;
}
}
}
#endregion
protected void btnBatchDownload_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/").Replace('\\', '/');
if (Grid1.SelectedRowIDArray.Count() == 0)
{
Alert.ShowInParent("Please select Download Row!");
return;
}
else
{
string[] rowList = Grid1.SelectedRowIDArray;
List<string> durl = new List<string>();
List<string> urlList = (from x in Funs.DB.SupportDocument_GuideManual where rowList.Contains(x.GuideManualId) && x.AttachUrl != null && x.AttachUrl != "" select x.AttachUrl).ToList();
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
string destFile = rootPath + "FileUpload\\Temp\\GuideManual" + date;
string zipFileName = "GuideManual_" + date;
if (!Directory.Exists(destFile))
{
Directory.CreateDirectory(destFile);
}
foreach (string url in urlList)
{
string sourceFileName = rootPath + url.Replace('\\', '/');
string[] subUrl = sourceFileName.Split('/');
string fileName = subUrl[subUrl.Count() - 1];
string newFileName = fileName.Substring(fileName.IndexOf("~") + 1);
if (newFileName.Contains("_"))
{
if (newFileName.Substring(0, 1) == "_")
{
newFileName = newFileName.Substring(1, newFileName.Length - 1);
}
else
{
newFileName = newFileName.Replace(newFileName.Split('_')[0], "");
newFileName = newFileName.Substring(1);
}
}
string destFileName = destFile + "/" + newFileName;
if (File.Exists(sourceFileName))
{
File.Copy(sourceFileName, destFileName, true);
}
}
FileZipDownload(destFile.Replace('\\', '/'), zipFileName);
}
}
public string DownloadFileByHttpUrl(List<string> HttpUrlList)
{
if (HttpUrlList == null || HttpUrlList.Count == 0)
{
return "没有附件";
}
try
{
var random = new Random();
var zipMs = new MemoryStream();
ZipOutputStream zipStream = new ZipOutputStream(zipMs);
zipStream.SetLevel(6);//压缩率0~9
foreach (var url in HttpUrlList)
{
if (!string.IsNullOrWhiteSpace(url))
{
string rootPath = System.Configuration.ConfigurationManager.AppSettings["RootUrl"];
string surl = rootPath + url.Replace('\\', '/');
var urlStr = HttpUtility.UrlDecode(surl);
Console.WriteLine(urlStr);
string fileExt = Path.GetExtension(urlStr).ToLower();
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(urlStr);
var strName = fileNameWithoutExtension.Substring(fileNameWithoutExtension.LastIndexOf("/") + 1) + random.Next(1000, 9999) + fileExt;
zipStream.PutNextEntry(new ZipEntry(strName));
ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlStr);
request.AllowAutoRedirect = true;
WebProxy proxy = new WebProxy();
proxy.BypassProxyOnLocal = true;
proxy.UseDefaultCredentials = true;
request.Proxy = proxy;
WebResponse response = request.GetResponse();
using (Stream streams = response.GetResponseStream())
{
Byte[] buffer = new Byte[1024];
int current = 0;
while ((current = streams.Read(buffer, 0, buffer.Length)) != 0)
{
zipStream.Write(buffer, 0, current);
}
zipStream.Flush();
}
}
}
zipStream.Finish();
zipMs.Position = 0;
//下边为打包压缩
MemoryStream stream = zipMs;
byte[] srcBuf = new Byte[stream.Length];
stream.Read(srcBuf, 0, srcBuf.Length);
stream.Seek(0, SeekOrigin.Begin);
string filePath = "C:/DownLoad";//Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
string con = "GuideManual";
var file_name = con + "_" + date + ".zip";
using (FileStream fs = new FileStream(filePath + "\\" + file_name, FileMode.Create, FileAccess.Write))
{
fs.Write(srcBuf, 0, srcBuf.Length);
fs.Close();
return "已下载到C盘Download文件下";
}
}
catch (Exception ex)
{
return "下载失败:" + ex.ToString();
}
}
private void FileZipDownload(string destFilePath, string zipFileName)
{
string zipFilePath = destFilePath + ".zip";
System.IO.Compression.ZipFile.CreateFromDirectory(destFilePath, zipFilePath);
FileInfo info = new FileInfo(zipFilePath);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(zipFileName + ".zip", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(zipFilePath, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
Funs.DeleteDir(destFilePath);
File.Delete(zipFilePath);
}
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.SupportDocument
{
public partial class GuideManual
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Panel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// btnBatchDownload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnBatchDownload;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// lbtnUrl1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtnUrl1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -0,0 +1,81 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Template.aspx.cs" Inherits="FineUIPro.Web.SupportDocument.Template" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Template</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel ID="Panel2" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="Template" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="TemplateId" AllowCellEditing="true" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
ClicksToEdit="2" DataIDField="TemplateId" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"
EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
<Items>
<f:ToolbarFill ID="ToolbarFill2" runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="Add" Text="Add" Icon="Add" OnClick="btnAdd_Click" runat="server" Hidden="true">
</f:Button>
<f:Button ID="btnEdit" ToolTip="Modify" Text="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
</f:Button>
<f:Button ID="btnDelete" ToolTip="Delete" Text="Delete" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
runat="server" Hidden="true">
</f:Button>
<f:Button ID="btnBatchDownload" ToolTip="Batch Download" Text="Batch Download" Icon="ArrowDown" EnableAjax="false" OnClick="btnBatchDownload_Click" runat="server" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField Width="50px" TextAlign="Center" HeaderText="No.">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="260px" ColumnID="Template" DataField="Template" FieldType="String" HeaderText="Template" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="UploadByName" DataField="UploadByName" FieldType="String" HeaderText="Uploaded by" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="130px" ColumnID="UploadDate" DataField="UploadDate" FieldType="Date" Renderer="Date" HeaderText="Uploaded Date" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:TemplateField HeaderText="Attach View" Width="350px" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
<ItemTemplate>
<asp:LinkButton ID="lbtnUrl1" runat="server" CommandArgument='<%# Bind("AttachUrl") %>'
ToolTip="Attach View" EnableAjax="false" Height="20px"></asp:LinkButton>
</ItemTemplate>
</f:TemplateField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px" OnClose="Window1_Close"
Height="500px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,329 @@
using BLL;
using ICSharpCode.SharpZipLib.Zip;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.SupportDocument
{
public partial class Template : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();//按钮权限
BindGrid();
}
}
private void BindGrid()
{
string strSql = @"SELECT t.TemplateId,
t.Template,
t.UploadBy,
t.UploadDate,
t.AttachUrl,
U.UserName AS UploadByName
FROM dbo.SupportDocument_Template AS t
LEFT JOIN Sys_User AS U ON U.UserId = t.UploadBy
WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (tvStandardTemp.SelectedNodeID != "0" && tvStandardTemp.SelectedNodeID != null)
//{
// strSql += " AND t.TemplateTypeId = @TemplateTypeId";
// listStr.Add(new SqlParameter("@TemplateTypeId", tvStandardTemp.SelectedNodeID));
//}
strSql += " ORDER BY t.UploadDate DESC";
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
for (int i = 0; i < Grid1.Rows.Count; i++)
{
System.Web.UI.WebControls.LinkButton lbtnUrl = ((System.Web.UI.WebControls.LinkButton)(this.Grid1.Rows[i].FindControl("lbtnUrl1")));
string url = lbtnUrl.CommandArgument.ToString();
if (!string.IsNullOrEmpty(url))
{
url = url.Replace('\\', '/');
lbtnUrl.Text = BLL.UploadAttachmentService.ShowAttachment("../", url);
}
}
}
//protected void btnSearch_Click(object sender, EventArgs e)
//{
// if (!string.IsNullOrEmpty(this.tvStandardTemp.SelectedNodeID))
// {
// BindGrid(this.tvStandardTemp.SelectedNodeID);
// }
//}
protected void btnAdd_Click(object sender, EventArgs e)
{
string id = SQLHelper.GetNewID(typeof(Model.SupportDocument_Template));
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=add&toKeyId={0}&path=FileUpload/SupportDocument/Template&menuId={1}", id, BLL.Const.TemplateMenuId)));
}
protected void btnEdit_Click(object sender, EventArgs e)
{
string rowId = Grid1.SelectedRowID;
if (!string.IsNullOrEmpty(rowId))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=edit&toKeyId={0}&path=FileUpload/SupportDocument/Template&menuId={1}", rowId, BLL.Const.TemplateMenuId)));
}
else
{
Alert.ShowInTop("Please select the record to modify", MessageBoxIcon.Warning);
return;
}
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StandardTemplateEdit.aspx?templateId={0}", rowId, "编辑 - ")));
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var t = BLL.TemplateService.GetTemplateById(rowID);
if (t != null)
{
BLL.TemplateService.DeleteTemplateById(rowID);
}
}
BindGrid();
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete Template");
ShowNotify("Deleted successfully!");
}
else
{
Alert.ShowInTop("Please select the record to Delete", MessageBoxIcon.Warning);
return;
}
}
protected void Grid1_RowDoubleClick(object sender, EventArgs e)
{
string rowId = Grid1.SelectedRowID;
if (!string.IsNullOrEmpty(rowId))
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../AttachFile/webuploader3.aspx?type=edit&toKeyId={0}&path=FileUpload/SupportDocument/Template&menuId={1}", rowId, BLL.Const.TemplateMenuId)));
}
else
{
Alert.ShowInTop("Please select the record to modify", MessageBoxIcon.Warning);
return;
}
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("StandardTemplateEdit.aspx?templateId={0}", rowId, "编辑 - ")));
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
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();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#region
/// <summary>
/// 菜单按钮权限
/// </summary>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.TemplateMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDownload))
{
this.btnBatchDownload.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnDelete.Hidden = false;
}
}
}
#endregion
protected void btnBatchDownload_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/").Replace('\\', '/');
if (Grid1.SelectedRowIDArray.Count() == 0)
{
Alert.ShowInParent("Please select Download Row!");
return;
}
else
{
string[] rowList = Grid1.SelectedRowIDArray;
List<string> durl = new List<string>();
List<string> urlList = (from x in Funs.DB.SupportDocument_Template where rowList.Contains(x.TemplateId) && x.AttachUrl != null && x.AttachUrl != "" select x.AttachUrl).ToList();
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
string destFile = rootPath + "FileUpload\\Temp\\Template" + date;
string zipFileName = "Template_" + date;
if (!Directory.Exists(destFile))
{
Directory.CreateDirectory(destFile);
}
foreach (string url in urlList)
{
string sourceFileName = rootPath + url.Replace('\\', '/');
string[] subUrl = sourceFileName.Split('/');
string fileName = subUrl[subUrl.Count() - 1];
string newFileName = fileName.Substring(fileName.IndexOf("~") + 1);
if (newFileName.Contains("_"))
{
if (newFileName.Substring(0, 1) == "_")
{
newFileName = newFileName.Substring(1, newFileName.Length - 1);
}
else
{
newFileName = newFileName.Replace(newFileName.Split('_')[0], "");
newFileName = newFileName.Substring(1);
}
}
string destFileName = destFile + "/" + newFileName;
if (File.Exists(sourceFileName))
{
File.Copy(sourceFileName, destFileName, true);
}
}
FileZipDownload(destFile.Replace('\\', '/'), zipFileName);
}
}
public string DownloadFileByHttpUrl(List<string> HttpUrlList)
{
if (HttpUrlList == null || HttpUrlList.Count == 0)
{
return "没有附件";
}
try
{
var random = new Random();
var zipMs = new MemoryStream();
ZipOutputStream zipStream = new ZipOutputStream(zipMs);
zipStream.SetLevel(6);//压缩率0~9
foreach (var url in HttpUrlList)
{
if (!string.IsNullOrWhiteSpace(url))
{
string rootPath = System.Configuration.ConfigurationManager.AppSettings["RootUrl"];
string surl = rootPath + url.Replace('\\', '/');
var urlStr = HttpUtility.UrlDecode(surl);
Console.WriteLine(urlStr);
string fileExt = Path.GetExtension(urlStr).ToLower();
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(urlStr);
var strName = fileNameWithoutExtension.Substring(fileNameWithoutExtension.LastIndexOf("/") + 1) + random.Next(1000, 9999) + fileExt;
zipStream.PutNextEntry(new ZipEntry(strName));
ServicePointManager.ServerCertificateValidationCallback += (s, cert, chain, sslPolicyErrors) => true;
ServicePointManager.SecurityProtocol = (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(urlStr);
request.AllowAutoRedirect = true;
WebProxy proxy = new WebProxy();
proxy.BypassProxyOnLocal = true;
proxy.UseDefaultCredentials = true;
request.Proxy = proxy;
WebResponse response = request.GetResponse();
using (Stream streams = response.GetResponseStream())
{
Byte[] buffer = new Byte[1024];
int current = 0;
while ((current = streams.Read(buffer, 0, buffer.Length)) != 0)
{
zipStream.Write(buffer, 0, current);
}
zipStream.Flush();
}
}
}
zipStream.Finish();
zipMs.Position = 0;
//下边为打包压缩
MemoryStream stream = zipMs;
byte[] srcBuf = new Byte[stream.Length];
stream.Read(srcBuf, 0, srcBuf.Length);
stream.Seek(0, SeekOrigin.Begin);
string filePath = "C:/DownLoad";//Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string date = DateTime.Now.ToString("yyyyMMddHHmmss");
string con = "Template";
var file_name = con + "_" + date + ".zip";
using (FileStream fs = new FileStream(filePath + "\\" + file_name, FileMode.Create, FileAccess.Write))
{
fs.Write(srcBuf, 0, srcBuf.Length);
fs.Close();
return "已下载到C盘Download文件下";
}
}
catch (Exception ex)
{
return "下载失败:" + ex.ToString();
}
}
private void FileZipDownload(string destFilePath, string zipFileName)
{
string zipFilePath = destFilePath + ".zip";
System.IO.Compression.ZipFile.CreateFromDirectory(destFilePath, zipFilePath);
FileInfo info = new FileInfo(zipFilePath);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(zipFileName + ".zip", System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(zipFilePath, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
Funs.DeleteDir(destFilePath);
File.Delete(zipFilePath);
}
}
}

View File

@ -0,0 +1,170 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.SupportDocument
{
public partial class Template
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Panel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// btnBatchDownload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnBatchDownload;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// lbtnUrl1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtnUrl1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -170,6 +170,12 @@ namespace Model
partial void InsertStandardTemplate(StandardTemplate instance);
partial void UpdateStandardTemplate(StandardTemplate instance);
partial void DeleteStandardTemplate(StandardTemplate instance);
partial void InsertSupportDocument_GuideManual(SupportDocument_GuideManual instance);
partial void UpdateSupportDocument_GuideManual(SupportDocument_GuideManual instance);
partial void DeleteSupportDocument_GuideManual(SupportDocument_GuideManual instance);
partial void InsertSupportDocument_Template(SupportDocument_Template instance);
partial void UpdateSupportDocument_Template(SupportDocument_Template instance);
partial void DeleteSupportDocument_Template(SupportDocument_Template instance);
partial void InsertSyncDataUserLogs(SyncDataUserLogs instance);
partial void UpdateSyncDataUserLogs(SyncDataUserLogs instance);
partial void DeleteSyncDataUserLogs(SyncDataUserLogs instance);
@ -664,6 +670,22 @@ namespace Model
}
}
public System.Data.Linq.Table<SupportDocument_GuideManual> SupportDocument_GuideManual
{
get
{
return this.GetTable<SupportDocument_GuideManual>();
}
}
public System.Data.Linq.Table<SupportDocument_Template> SupportDocument_Template
{
get
{
return this.GetTable<SupportDocument_Template>();
}
}
public System.Data.Linq.Table<SyncDataUserLogs> SyncDataUserLogs
{
get
@ -23856,6 +23878,404 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SupportDocument_GuideManual")]
public partial class SupportDocument_GuideManual : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _GuideManualId;
private string _GuideManual;
private string _UploadBy;
private System.Nullable<System.DateTime> _UploadDate;
private string _AttachUrl;
private EntityRef<Sys_User> _Sys_User;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnGuideManualIdChanging(string value);
partial void OnGuideManualIdChanged();
partial void OnGuideManualChanging(string value);
partial void OnGuideManualChanged();
partial void OnUploadByChanging(string value);
partial void OnUploadByChanged();
partial void OnUploadDateChanging(System.Nullable<System.DateTime> value);
partial void OnUploadDateChanged();
partial void OnAttachUrlChanging(string value);
partial void OnAttachUrlChanged();
#endregion
public SupportDocument_GuideManual()
{
this._Sys_User = default(EntityRef<Sys_User>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GuideManualId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string GuideManualId
{
get
{
return this._GuideManualId;
}
set
{
if ((this._GuideManualId != value))
{
this.OnGuideManualIdChanging(value);
this.SendPropertyChanging();
this._GuideManualId = value;
this.SendPropertyChanged("GuideManualId");
this.OnGuideManualIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GuideManual", DbType="NVarChar(200)")]
public string GuideManual
{
get
{
return this._GuideManual;
}
set
{
if ((this._GuideManual != value))
{
this.OnGuideManualChanging(value);
this.SendPropertyChanging();
this._GuideManual = value;
this.SendPropertyChanged("GuideManual");
this.OnGuideManualChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UploadBy", DbType="NVarChar(50)")]
public string UploadBy
{
get
{
return this._UploadBy;
}
set
{
if ((this._UploadBy != value))
{
if (this._Sys_User.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnUploadByChanging(value);
this.SendPropertyChanging();
this._UploadBy = value;
this.SendPropertyChanged("UploadBy");
this.OnUploadByChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UploadDate", DbType="DateTime")]
public System.Nullable<System.DateTime> UploadDate
{
get
{
return this._UploadDate;
}
set
{
if ((this._UploadDate != value))
{
this.OnUploadDateChanging(value);
this.SendPropertyChanging();
this._UploadDate = value;
this.SendPropertyChanged("UploadDate");
this.OnUploadDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(500)")]
public string AttachUrl
{
get
{
return this._AttachUrl;
}
set
{
if ((this._AttachUrl != value))
{
this.OnAttachUrlChanging(value);
this.SendPropertyChanging();
this._AttachUrl = value;
this.SendPropertyChanged("AttachUrl");
this.OnAttachUrlChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SupportDocument_GuideManual_Sys_User", Storage="_Sys_User", ThisKey="UploadBy", OtherKey="UserId", IsForeignKey=true)]
public Sys_User Sys_User
{
get
{
return this._Sys_User.Entity;
}
set
{
Sys_User previousValue = this._Sys_User.Entity;
if (((previousValue != value)
|| (this._Sys_User.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Sys_User.Entity = null;
previousValue.SupportDocument_GuideManual.Remove(this);
}
this._Sys_User.Entity = value;
if ((value != null))
{
value.SupportDocument_GuideManual.Add(this);
this._UploadBy = value.UserId;
}
else
{
this._UploadBy = default(string);
}
this.SendPropertyChanged("Sys_User");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SupportDocument_Template")]
public partial class SupportDocument_Template : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _TemplateId;
private string _Template;
private string _UploadBy;
private System.Nullable<System.DateTime> _UploadDate;
private string _AttachUrl;
private EntityRef<Sys_User> _Sys_User;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnTemplateIdChanging(string value);
partial void OnTemplateIdChanged();
partial void OnTemplateChanging(string value);
partial void OnTemplateChanged();
partial void OnUploadByChanging(string value);
partial void OnUploadByChanged();
partial void OnUploadDateChanging(System.Nullable<System.DateTime> value);
partial void OnUploadDateChanged();
partial void OnAttachUrlChanging(string value);
partial void OnAttachUrlChanged();
#endregion
public SupportDocument_Template()
{
this._Sys_User = default(EntityRef<Sys_User>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TemplateId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string TemplateId
{
get
{
return this._TemplateId;
}
set
{
if ((this._TemplateId != value))
{
this.OnTemplateIdChanging(value);
this.SendPropertyChanging();
this._TemplateId = value;
this.SendPropertyChanged("TemplateId");
this.OnTemplateIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Template", DbType="NVarChar(200)")]
public string Template
{
get
{
return this._Template;
}
set
{
if ((this._Template != value))
{
this.OnTemplateChanging(value);
this.SendPropertyChanging();
this._Template = value;
this.SendPropertyChanged("Template");
this.OnTemplateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UploadBy", DbType="NVarChar(50)")]
public string UploadBy
{
get
{
return this._UploadBy;
}
set
{
if ((this._UploadBy != value))
{
if (this._Sys_User.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnUploadByChanging(value);
this.SendPropertyChanging();
this._UploadBy = value;
this.SendPropertyChanged("UploadBy");
this.OnUploadByChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UploadDate", DbType="DateTime")]
public System.Nullable<System.DateTime> UploadDate
{
get
{
return this._UploadDate;
}
set
{
if ((this._UploadDate != value))
{
this.OnUploadDateChanging(value);
this.SendPropertyChanging();
this._UploadDate = value;
this.SendPropertyChanged("UploadDate");
this.OnUploadDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttachUrl", DbType="NVarChar(500)")]
public string AttachUrl
{
get
{
return this._AttachUrl;
}
set
{
if ((this._AttachUrl != value))
{
this.OnAttachUrlChanging(value);
this.SendPropertyChanging();
this._AttachUrl = value;
this.SendPropertyChanged("AttachUrl");
this.OnAttachUrlChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SupportDocument_Template_Sys_User", Storage="_Sys_User", ThisKey="UploadBy", OtherKey="UserId", IsForeignKey=true)]
public Sys_User Sys_User
{
get
{
return this._Sys_User.Entity;
}
set
{
Sys_User previousValue = this._Sys_User.Entity;
if (((previousValue != value)
|| (this._Sys_User.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Sys_User.Entity = null;
previousValue.SupportDocument_Template.Remove(this);
}
this._Sys_User.Entity = value;
if ((value != null))
{
value.SupportDocument_Template.Add(this);
this._UploadBy = value.UserId;
}
else
{
this._UploadBy = default(string);
}
this.SendPropertyChanged("Sys_User");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SyncDataUserLogs")]
public partial class SyncDataUserLogs : INotifyPropertyChanging, INotifyPropertyChanged
{
@ -25873,6 +26293,10 @@ namespace Model
private EntitySet<StandardTemplate> _StandardTemplate;
private EntitySet<SupportDocument_GuideManual> _SupportDocument_GuideManual;
private EntitySet<SupportDocument_Template> _SupportDocument_Template;
private EntityRef<Base_Depart> _Base_Depart;
private EntityRef<Sys_Role> _Sys_Role;
@ -25940,6 +26364,8 @@ namespace Model
this._SSR = new EntitySet<SSR>(new Action<SSR>(this.attach_SSR), new Action<SSR>(this.detach_SSR));
this._SSR_Sys_User1 = new EntitySet<SSR>(new Action<SSR>(this.attach_SSR_Sys_User1), new Action<SSR>(this.detach_SSR_Sys_User1));
this._StandardTemplate = new EntitySet<StandardTemplate>(new Action<StandardTemplate>(this.attach_StandardTemplate), new Action<StandardTemplate>(this.detach_StandardTemplate));
this._SupportDocument_GuideManual = new EntitySet<SupportDocument_GuideManual>(new Action<SupportDocument_GuideManual>(this.attach_SupportDocument_GuideManual), new Action<SupportDocument_GuideManual>(this.detach_SupportDocument_GuideManual));
this._SupportDocument_Template = new EntitySet<SupportDocument_Template>(new Action<SupportDocument_Template>(this.attach_SupportDocument_Template), new Action<SupportDocument_Template>(this.detach_SupportDocument_Template));
this._Base_Depart = default(EntityRef<Base_Depart>);
this._Sys_Role = default(EntityRef<Sys_Role>);
this._Sys_UserToEMial = new EntitySet<Sys_UserToEMial>(new Action<Sys_UserToEMial>(this.attach_Sys_UserToEMial), new Action<Sys_UserToEMial>(this.detach_Sys_UserToEMial));
@ -26541,6 +26967,32 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SupportDocument_GuideManual_Sys_User", Storage="_SupportDocument_GuideManual", ThisKey="UserId", OtherKey="UploadBy", DeleteRule="NO ACTION")]
public EntitySet<SupportDocument_GuideManual> SupportDocument_GuideManual
{
get
{
return this._SupportDocument_GuideManual;
}
set
{
this._SupportDocument_GuideManual.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SupportDocument_Template_Sys_User", Storage="_SupportDocument_Template", ThisKey="UserId", OtherKey="UploadBy", DeleteRule="NO ACTION")]
public EntitySet<SupportDocument_Template> SupportDocument_Template
{
get
{
return this._SupportDocument_Template;
}
set
{
this._SupportDocument_Template.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_User_Base_Depart", Storage="_Base_Depart", ThisKey="DepartId", OtherKey="DepartId", IsForeignKey=true)]
public Base_Depart Base_Depart
{
@ -26870,6 +27322,30 @@ namespace Model
entity.Sys_User = null;
}
private void attach_SupportDocument_GuideManual(SupportDocument_GuideManual entity)
{
this.SendPropertyChanging();
entity.Sys_User = this;
}
private void detach_SupportDocument_GuideManual(SupportDocument_GuideManual entity)
{
this.SendPropertyChanging();
entity.Sys_User = null;
}
private void attach_SupportDocument_Template(SupportDocument_Template entity)
{
this.SendPropertyChanging();
entity.Sys_User = this;
}
private void detach_SupportDocument_Template(SupportDocument_Template entity)
{
this.SendPropertyChanging();
entity.Sys_User = null;
}
private void attach_Sys_UserToEMial(Sys_UserToEMial entity)
{
this.SendPropertyChanging();
@ -31628,8 +32104,6 @@ namespace Model
private string _Remark;
private string _FileType;
private string _Contract_Admin;
private string _Main_Coordinator;
@ -31640,10 +32114,10 @@ namespace Model
private string _BycDept;
private System.Nullable<bool> _IsExport;
private string _ContractorShortName;
private string _FileType;
public View_FC_ContractManagement()
{
}
@ -31792,22 +32266,6 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileType", DbType="NVarChar(50)")]
public string FileType
{
get
{
return this._FileType;
}
set
{
if ((this._FileType != value))
{
this._FileType = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Contract_Admin", DbType="NVarChar(50)")]
public string Contract_Admin
{
@ -31888,22 +32346,6 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsExport", DbType="Bit")]
public System.Nullable<bool> IsExport
{
get
{
return this._IsExport;
}
set
{
if ((this._IsExport != value))
{
this._IsExport = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractorShortName", DbType="NVarChar(50)")]
public string ContractorShortName
{
@ -31919,6 +32361,22 @@ namespace Model
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_FileType", DbType="VarChar(18)")]
public string FileType
{
get
{
return this._FileType;
}
set
{
if ((this._FileType != value))
{
this._FileType = value;
}
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_FC_ContractManagementLists")]