0813
This commit is contained in:
@@ -30,11 +30,13 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", cnProfession.EndDate);
|
||||
}
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
else if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
{
|
||||
txtCode.Text = GetNewCode(unitProject.UnitProjectCode, 0, "wbsSet");
|
||||
this.txtCode.Readonly = true;
|
||||
if (unitProject.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.StartDate);
|
||||
@@ -47,6 +49,8 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
txtCode.Text = GetNewCode(wbsSet.WbsSetCode, 0, "wbsSet");
|
||||
this.txtCode.Readonly = true;
|
||||
if (wbsSet.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", wbsSet.StartDate);
|
||||
@@ -54,48 +58,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "installation")
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
|
||||
if (installation != null)
|
||||
{
|
||||
if (installation.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", installation.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", installation.EndDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else //修改
|
||||
{
|
||||
if (type == "installation")
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(id);
|
||||
if (installation != null)
|
||||
{
|
||||
txtCode.Text = installation.InstallationCode;
|
||||
txtName.Text = installation.InstallationName;
|
||||
if (installation.StartDate != null)
|
||||
{
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", installation.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", installation.EndDate);
|
||||
}
|
||||
txtRemark.Text = installation.Def;
|
||||
this.trSortIndex.Hidden = true;
|
||||
this.trUnit.Hidden = false;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(installation.ProjectId);
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
if (!string.IsNullOrEmpty(installation.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = installation.UnitId;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
@@ -107,6 +73,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.StartDate);
|
||||
txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", unitProject.EndDate);
|
||||
}
|
||||
if (unitProject.SortIndex != null)
|
||||
{
|
||||
txtSortIndex.Text = unitProject.SortIndex.ToString();
|
||||
}
|
||||
txtRemark.Text = unitProject.Remark;
|
||||
}
|
||||
}
|
||||
@@ -126,13 +96,16 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (BLL.WbsSetService.GetWbsSetsBySuperWbsSetId(id).Count == 0) //末级节点
|
||||
{
|
||||
this.trWbsSet2.Hidden = false;
|
||||
txtControlItemDef.Text = wbsSet.ControlItemDef;
|
||||
if (wbsSet.Weights != null)
|
||||
{
|
||||
txtWeights.Text = wbsSet.Weights.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type == "cnProfession")
|
||||
{
|
||||
this.trUnit.Hidden = false;
|
||||
//this.trUnit.Hidden = false;
|
||||
Model.WBS_CnProfession cnProfession = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(id);
|
||||
if (cnProfession != null)
|
||||
{
|
||||
@@ -145,21 +118,72 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
this.trSortIndex.Hidden = true;
|
||||
this.txtRemark.Hidden = true;
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
this.drpUnit.DataValueField = "UnitId";
|
||||
this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(cnProfession.ProjectId);
|
||||
this.drpUnit.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
if (!string.IsNullOrEmpty(cnProfession.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = cnProfession.UnitId;
|
||||
}
|
||||
//this.drpUnit.DataTextField = "UnitName";
|
||||
//this.drpUnit.DataValueField = "UnitId";
|
||||
//this.drpUnit.DataSource = BLL.UnitService.GetUnitByProjectIdList(cnProfession.ProjectId);
|
||||
//this.drpUnit.DataBind();
|
||||
//Funs.FineUIPleaseSelect(this.drpUnit);
|
||||
//if (!string.IsNullOrEmpty(cnProfession.UnitId))
|
||||
//{
|
||||
// this.drpUnit.SelectedValue = cnProfession.UnitId;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 获取编号
|
||||
/// <summary>
|
||||
/// 获取编号
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="i"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
private string GetNewCode(string code, int i, string type)
|
||||
{
|
||||
string newCode = string.Empty;
|
||||
string testCode = string.Empty;
|
||||
string istr = string.Empty;
|
||||
i++;
|
||||
if (i < 10)
|
||||
{
|
||||
istr = "0" + i.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
istr = i.ToString();
|
||||
}
|
||||
testCode = string.Empty;
|
||||
|
||||
|
||||
testCode = code + istr;
|
||||
if (BLL.WbsSetService.GetWbsSetByWbsSetCode(testCode, this.CurrUser.LoginProjectId) == null)
|
||||
{
|
||||
newCode = testCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
i++;
|
||||
if (i < 10)
|
||||
{
|
||||
istr = "0" + i.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
istr = i.ToString();
|
||||
}
|
||||
testCode = code + istr;
|
||||
} while (BLL.WbsSetInitService.GetWbsSetInitByWbsSetCode(testCode) != null);
|
||||
newCode = testCode;
|
||||
}
|
||||
return newCode;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
@@ -206,7 +230,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
BLL.UnitProjectService.AddUnitProject(unitProject);
|
||||
}
|
||||
else if (type == "unitProject" || type == "childUnitProject")
|
||||
else if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
@@ -232,7 +256,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.AddWbsSet(wbsSet);
|
||||
}
|
||||
else if (type == "wbsSet")
|
||||
@@ -261,7 +288,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.AddWbsSet(wbsSet);
|
||||
}
|
||||
else if (type == "installation")
|
||||
@@ -295,7 +325,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
}
|
||||
else //修改
|
||||
{
|
||||
if (type == "unitProject" || type == "childUnitProject")
|
||||
if (type == "unitProject")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(id);
|
||||
if (unitProject != null)
|
||||
@@ -326,7 +356,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
wbsSet.SortIndex = Convert.ToInt32(txtSortIndex.Text.Trim());
|
||||
}
|
||||
wbsSet.ControlItemDef = this.txtControlItemDef.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtWeights.Text.Trim()))
|
||||
{
|
||||
wbsSet.Weights = Funs.GetNewDecimal(this.txtWeights.Text.Trim());
|
||||
}
|
||||
BLL.WbsSetService.UpdateWbsSet(wbsSet);
|
||||
}
|
||||
}
|
||||
@@ -339,10 +372,10 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
cnProfession.CnProfessionName = txtName.Text.Trim();
|
||||
cnProfession.StartDate = Convert.ToDateTime(txtStartDate.Text.Trim());
|
||||
cnProfession.EndDate = Convert.ToDateTime(txtEndDate.Text.Trim());
|
||||
if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
cnProfession.UnitId = this.drpUnit.SelectedValue;
|
||||
}
|
||||
//if (this.drpUnit.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// cnProfession.UnitId = this.drpUnit.SelectedValue;
|
||||
//}
|
||||
BLL.CnProfessionService.UpdateCnProfession(cnProfession);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user