提交代码
This commit is contained in:
@@ -52,6 +52,24 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
if (QuantityCompletion != null)
|
||||
{
|
||||
this.ProjectId = QuantityCompletion.ProjectId;
|
||||
if (QuantityCompletion.StartDate != null)
|
||||
{
|
||||
this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", QuantityCompletion.StartDate);
|
||||
}
|
||||
if (QuantityCompletion.EndDate != null)
|
||||
{
|
||||
this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", QuantityCompletion.EndDate);
|
||||
}
|
||||
Model.JDGL_QuantityList list = BLL.QuantityListService.GetQuantityListById(QuantityCompletion.QuantityListId);
|
||||
if (list != null)
|
||||
{
|
||||
this.txtName.Text = list.Name;
|
||||
this.txtUnit.Text = list.Unit;
|
||||
if (list.DesignNum != null)
|
||||
{
|
||||
this.txtDesignNum.Text = list.DesignNum.ToString();
|
||||
}
|
||||
}
|
||||
if (QuantityCompletion.PlanNum != null)
|
||||
{
|
||||
this.txtPlanNum.Text = QuantityCompletion.PlanNum.ToString();
|
||||
@@ -60,6 +78,10 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
{
|
||||
this.txtRealNum.Text = QuantityCompletion.RealNum.ToString();
|
||||
}
|
||||
if (QuantityCompletion.NextNum != null)
|
||||
{
|
||||
this.txtNextNum.Text = QuantityCompletion.NextNum.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,6 +95,26 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
private void SaveData(bool bl)
|
||||
{
|
||||
string QuantityCompletionId = Request.Params["QuantityCompletionId"];
|
||||
string quantityListId = string.Empty;
|
||||
var oldQuantityList = Funs.DB.JDGL_QuantityList.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.Name == this.txtName.Text.Trim());
|
||||
if (oldQuantityList == null)
|
||||
{
|
||||
Model.JDGL_QuantityList newQuantityList = new Model.JDGL_QuantityList();
|
||||
quantityListId = SQLHelper.GetNewID(typeof(Model.JDGL_QuantityList));
|
||||
newQuantityList.QuantityListId = quantityListId;
|
||||
newQuantityList.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newQuantityList.Name = this.txtName.Text.Trim();
|
||||
newQuantityList.Unit = this.txtUnit.Text.Trim();
|
||||
newQuantityList.DesignNum = Convert.ToDecimal(this.txtDesignNum.Text.Trim());
|
||||
BLL.QuantityListService.AddQuantityList(newQuantityList);
|
||||
}
|
||||
else
|
||||
{
|
||||
quantityListId = oldQuantityList.QuantityListId;
|
||||
oldQuantityList.Unit = this.txtUnit.Text.Trim();
|
||||
oldQuantityList.DesignNum = Convert.ToDecimal(this.txtDesignNum.Text.Trim());
|
||||
BLL.QuantityListService.UpdateQuantityList(oldQuantityList);
|
||||
}
|
||||
Model.JDGL_QuantityCompletion QuantityCompletion = new Model.JDGL_QuantityCompletion();
|
||||
if (!string.IsNullOrEmpty(this.txtPlanNum.Text.Trim()))
|
||||
{
|
||||
@@ -82,6 +124,15 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
{
|
||||
QuantityCompletion.RealNum = Convert.ToDecimal(this.txtRealNum.Text.Trim());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtNextNum.Text.Trim()))
|
||||
{
|
||||
QuantityCompletion.NextNum = Convert.ToDecimal(this.txtNextNum.Text.Trim());
|
||||
}
|
||||
QuantityCompletion.QuantityListId = quantityListId;
|
||||
QuantityCompletion.CompileMan = this.CurrUser.UserId;
|
||||
QuantityCompletion.CompileDate = DateTime.Now;
|
||||
QuantityCompletion.StartDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
QuantityCompletion.EndDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(QuantityCompletionId))
|
||||
{
|
||||
QuantityCompletion.QuantityCompletionId = QuantityCompletionId;
|
||||
@@ -90,6 +141,7 @@ namespace FineUIPro.Web.JDGL.Check
|
||||
else
|
||||
{
|
||||
QuantityCompletion.QuantityCompletionId = SQLHelper.GetNewID(typeof(Model.JDGL_QuantityCompletion));
|
||||
QuantityCompletion.ProjectId = this.CurrUser.LoginProjectId;
|
||||
BLL.QuantityCompletionService.AddQuantityCompletion(QuantityCompletion);
|
||||
}
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
Reference in New Issue
Block a user