schangxiang@126.com
2025-09-17 60dd1afc3e8f94aa1b23211b6738d35b47294382
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
using FineUIPro;
using iWareCommon.Common.Entity;
using iWareDataCore.BASE.Service;
using iWareDataCore.Check.Entity;
using iWareDataCore.Check.EnumType;
using iWareDataCore.Check.Service;
using iWareWms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace iWareWms.View.CHECK.Plan
{
    
    public partial class PlanDetail : PageBase
    {
 
        protected override void Update(out string msg)
        {
            var plan = GetPlan();
            plan.Id = Convert.ToInt32(Request.QueryString["Id"]);
            PlanMaterialPlaceService.GetInstance().UpdatePlan(plan, out msg);
        }
 
 
        private PlanMaterialPlaceEntity GetPlan()
        {
            string msg;
            var materialId = MaterialService.GetInstance().QueryByParam(new QueryParam
            {
            }, out msg);
 
            var placeId = PlaceService.GetInstance().QueryByParam(new QueryParam
            {
            }, out msg);
            string chackmaterial=tbCheckMaterialCode.Text.Trim();
            string chackplacecoe = tbCheckPlaceCode.Text.Trim();
            string spcode = tbPlaceCode.Text.Trim();
            string smcode = tbMaterialCode.Text.Trim();
            var smaterialid = materialId.FirstOrDefault(x => x.Code == smcode);
            var splaceid = placeId.FirstOrDefault(x => x.Code == spcode);
            int plid = 0;
            int mid = 0;
            if (!string.IsNullOrEmpty(chackmaterial))
            {
                var materialid = materialId.FirstOrDefault(x => x.Code == chackmaterial);
                if (materialid != null)
                {
                    mid = materialid.Id;
                }
            }
            if (!string.IsNullOrEmpty(chackplacecoe))
            {
 
                var placeid = placeId.FirstOrDefault(x => x.Code == chackplacecoe);
 
                if (placeid != null)
                {
                    plid = placeid.Id;
                }
 
            }
        
            return new PlanMaterialPlaceEntity
            {
                PlaceId = splaceid.Id,
                MaterialId = smaterialid.Id,
                CheckPlaceId = plid,
                CheckMaterialId = mid,
                Quantity = 1
            };
        }
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
 
            if (!IsPostBack)
            {
                string msg;
 
                if (!string.IsNullOrEmpty(Request.QueryString["IsEdit"]))
                {
                    var planViews = PlanViewService.GetInstance().QueryByParam(new QueryParam { Filter = new Dictionary<string, object> { { "Id", Request.QueryString["Id"] } } }, out msg);
 
                    if (!string.IsNullOrEmpty(msg))
                    {
                        return;
                    }
 
 
                    tbPlanNo.Text = planViews.Count > 0 ? planViews[0].PlanNo : "";
                    tbMaterialCode.Text = planViews.Count > 0 ? planViews[0].MaterialCode : "";
                    tbPlaceCode.Text = planViews.Count > 0 ? planViews[0].PlaceCode : "";
 
                    foreach (var status in Enum.GetValues(typeof(EPlanStatus)))
                    {
                        ddlPlanStatus.Items.Add(status.ToString(), ((int)status).ToString());
                    }
 
                }
 
            }
        } 
    }
}