using iWareCommon.Common.Entity;
|
using iWareDataCore.BASE.Entity;
|
using iWareDataCore.BASE.Service;
|
using iWareWms;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
|
|
namespace iWareWms.View.FM.Place
|
{
|
public partial class PlaceDetail : PageBase
|
{
|
protected override void Save(out string msg)
|
{
|
|
PlaceService.GetInstance().Save(GetPlace(), out msg);
|
WriteLog("库位删除" + msg, "库位管理");
|
}
|
|
protected override void Update(out string msg)
|
{
|
|
|
var role = GetPlace();
|
role.Id = Convert.ToInt32(Request.QueryString["Id"]);
|
PlaceService.GetInstance().Update(role, out msg);
|
WriteLog("库位更新" + msg, "库位管理");
|
}
|
|
|
private PlaceEntity GetPlace()
|
{
|
|
|
return new PlaceEntity
|
{
|
Code = tbCode.Text.Trim(),
|
TypeId = Convert.ToInt32(ddlTypeId.SelectedValue),
|
Row = Convert.ToInt32(nbRow.Text),
|
Col = Convert.ToInt32(nbCol.Text),
|
Layer = Convert.ToInt32(nbLayer.Text),
|
Length = Convert.ToDecimal(nbLength.Text),
|
Width = Convert.ToDecimal(nbWidth.Text),
|
Height = Convert.ToDecimal(nbHeight.Text),
|
Posx = Convert.ToInt32(nbX.Text),
|
Posy = Convert.ToInt32(nbY.Text),
|
Posz = Convert.ToInt32(nbZ.Text),
|
MaxWeight=Convert.ToDecimal(nbMaxWeight.Text),
|
HeightLevel = Convert.ToInt32(nbHeightLevel.Text),
|
};
|
}
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
|
|
if (!IsPostBack)
|
{
|
string msg;
|
|
var types = PlaceTypeService.GetInstance().QueryByParam(new QueryParam(), out msg);
|
types.ForEach(x => ddlTypeId.Items.Add(x.Name, x.Id.ToString()));
|
|
if (!string.IsNullOrEmpty(Request.QueryString["IsEdit"]))
|
{
|
var places = PlaceService.GetInstance().QueryByParam(new QueryParam { Filter = new Dictionary<string, object> { { "Id", Request.QueryString["Id"] } } }, out msg);
|
|
if (!string.IsNullOrEmpty(msg))
|
{
|
return;
|
}
|
|
|
tbCode.Text = places.Count > 0 ? places[0].Code : "";
|
ddlTypeId.SelectedValue=places.Count > 0 ? places[0].TypeId.ToString() : "";
|
nbRow.Text= places.Count > 0 ? places[0].Row.ToString() : "";
|
nbCol.Text= places.Count > 0 ? places[0].Col.ToString() : "";
|
nbLayer.Text= places.Count > 0 ? places[0].Layer.ToString() : "";
|
nbLength.Text= places.Count > 0 ? places[0].Length.ToString() : "";
|
nbWidth.Text= places.Count > 0 ? places[0].Width.ToString() : "";
|
nbHeight.Text= places.Count > 0 ? places[0].Height.ToString() : "";
|
nbX.Text= places.Count > 0 ? places[0].Posx.ToString() : "";
|
nbY.Text= places.Count > 0 ? places[0].Posy.ToString() : "";
|
nbZ.Text= places.Count > 0 ? places[0].Posz.ToString() : "";
|
nbMaxWeight.Text= places.Count > 0 ? places[0].MaxWeight.ToString() : "";
|
nbHeightLevel.Text= places.Count > 0 ? places[0].HeightLevel.ToString() : "";
|
|
}
|
|
}
|
}
|
}
|
}
|