using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Person
{
public partial class PersonTotalEdit : PageBase
{
#region 定义项
///
/// 用户主键
///
public string PersonTotalId
{
get
{
return (string)ViewState["PersonTotalId"];
}
set
{
ViewState["PersonTotalId"] = value;
}
}
#endregion
///
/// 用户编辑页面
///
///
///
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.PersonTotalId = Request.Params["PersonTotalId"];
BLL.UserService.InitUserUnitIdDropDownList(drpUser, Const.UnitId_TCC, true);
if (!string.IsNullOrEmpty(this.PersonTotalId))
{
var totle = BLL.PersonTotalService.GetPersonByPersonTotalId(this.PersonTotalId);
if (totle != null)
{
if (!string.IsNullOrEmpty(totle.UserId))
{
this.drpUser.SelectedValue = totle.UserId;
}
if (totle.StartTime.HasValue)
{
this.txtStartTime.Text = string.Format("{0:yyyy-MM-dd}", totle.StartTime);
}
if (totle.EndTime.HasValue)
{
this.txtEndTime.Text = string.Format("{0:yyyy-MM-dd}", totle.EndTime);
}
var roleId = BLL.UserService.GetUserByUserId(totle.UserId);
if (roleId != null)
{
this.txtRoleName.Text = BLL.RoleService.getRoleNamesRoleIds(roleId.RoleId);
}
this.txtContents.Text = HttpUtility.HtmlDecode(totle.Content);
}
}
else
{
this.txtContents.Text = HttpUtility.HtmlDecode("<p style="margin: 8px 0px; text-align: center; text-indent: 0px; -ms-layout-grid-mode: both;"><strong><span style="line-height: 150%; font-family: 黑体; font-size: 21px;">工作总结</span></strong></p><p style="margin: 0px 0px 0px 24px; line-height: normal; -ms-layout-grid-mode: both;"><strong><span style="font-family:;"><span>1<span times="" new=""> </span></span></span></strong><strong><span style="font-family: 宋体; font-size: 14px;">员工年度工作情况</span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><strong><span style="line-height: 150%; font-family:;"> 1.1<span></span></span></strong><strong><span style="line-height: 150%; font-family: 宋体; font-size: 14px;">基本情况</span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"> (</span><span style="line-height: 150%; font-family:;">1</span><span style="line-height: 150%; font-family: 宋体; font-size: 14px;">)所在项目名称(或本部),工作岗位及职责,工作分管范围。</span></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"> (</span><span style="line-height: 150%; font-family:;">2</span><span style="line-height: 150%; font-family: 宋体; font-size: 14px;">)一年来,所在项目工程进展概述或本部工作进展概述。</span></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><strong><span style="line-height: 150%; font-family:;"> 1.2<span></span></span></strong><strong><span style="line-height: 150%; font-family: 宋体; font-size: 14px;">工作详述</span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><strong> </strong><span style="font-family: 宋体; font-size: 14px;">(1)一年来,在项目施工质量管理、</span><span style="font-family:;">HSE</span><span style="font-family: 宋体; font-size: 14px;">管理、进度管理、费用管理、技术管理、分包管理、组织协调上开展的工 作或在项目试车技术服务上开展的工作。或者一年来,在部室基础业务建设、精细化</span><span style="font-family:;">/</span><span style="font-family: 宋体; font-size: 14px;">信息化建设、施工招投标、施工合同、党建、群团等开展的工作。</span></span></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"> (2)<span style="font-family: 宋体; font-size: 14px;">兼职非施工管理部职责岗位开展的工作。</span></span></span></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"> (3)<span style="font-family: 宋体; font-size: 14px;">工作重点、难点、亮点,开展的创新措施及取得的效果,收获(经验和教训)等。 </span></span></span></span><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"><span style="font-family: 宋体; font-size: 14px;"> <strong><span style="line-height: 150%; font-family:;">1.3<span></span></span></strong><strong><span style="line-height: 150%; font-family: 宋体; font-size: 14px;">工作中发现的问题及建议</span></strong></span></span></span></span></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"> <strong>2 <span style="font-family: 宋体; font-size: 14px;">个人自我综合评价</span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><strong><span style="font-family: 宋体; font-size: 14px;"> <span style="line-height: 150%; font-family: 宋体; font-size: 14px;">在自我学习、工作绩效、工作态度、廉洁自律、团队协作上分别做出自我评价。</span></span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><strong><span style="font-family: 宋体; font-size: 14px;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><br/></span></span></strong></p><p style="text-indent: 0px; -ms-layout-grid-mode: both;"><span style="font-family: 宋体; font-size: 14px;"><span style="line-height: 150%; font-family: 宋体; font-size: 14px;"><strong> </strong> <strong>3 <span style="font-family: 宋体; font-size: 14px;">对公司或部门下一年度工作建议或诉求</span></strong></span></span></p><p></p></p>");
}
}
}
///
/// 保存按钮
///
///
///
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.drpUser.SelectedValue == Const._Null)
{
Alert.ShowInParent("请选择人员!", MessageBoxIcon.Warning);
return;
}
Model.PersonTotal newTotal = new Model.PersonTotal
{
UserId = this.drpUser.SelectedValue,
Content = HttpUtility.HtmlEncode(this.txtContents.Text),
CompiledManId = this.CurrUser.UserId,
CompiledDate = DateTime.Now
};
if (!string.IsNullOrEmpty(txtStartTime.Text.Trim()))
{
newTotal.StartTime = Funs.GetNewDateTime(this.txtStartTime.Text.Trim());
}
if (!string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
{
newTotal.EndTime = Convert.ToDateTime(this.txtEndTime.Text.Trim());
}
if (string.IsNullOrEmpty(this.PersonTotalId))
{
this.PersonTotalId = SQLHelper.GetNewID(typeof(Model.PersonTotal));
newTotal.PersonTotalId = this.PersonTotalId;
PersonTotalService.AddPersonTotal(newTotal);
}
else
{
var Total = BLL.PersonTotalService.GetPersonByPersonTotalId(this.PersonTotalId);
if (Total == null)
{
newTotal.PersonTotalId = this.PersonTotalId;
PersonTotalService.AddPersonTotal(newTotal);
}
else {
PersonTotalService.UpdatePersonTotal(newTotal);
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void drpUser_SelectedIndexChanged(object sender, EventArgs e)
{
if (this.drpUser.SelectedValue != Const._Null)
{
var roleId = BLL.UserService.GetUserByUserId(this.drpUser.SelectedValue).RoleId;
if (!string.IsNullOrEmpty(roleId))
{
var roleName = BLL.RoleService.getRoleNamesRoleIds(roleId);
this.txtRoleName.Text = roleName;
}
}
}
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.PersonTotalId))
{
this.PersonTotalId = SQLHelper.GetNewID(typeof(Model.PersonTotal));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Person&menuId={1}&type=0", PersonTotalId, BLL.Const.PersonTotalMenuId)));
}
}
}