Exemplo n.º 1
0
        private void FillModel(CM_Vehicle m)
        {
            if (m == null) return;

            ID = m.ID;
            VehicleNo = m.VehicleNo;
            RelateStaff = m.RelateStaff;
            RelateWareHouse = m.RelateWareHouse;

            if (RelateStaff != 0)
            {
                Org_Staff s = new Org_StaffBLL(RelateStaff).Model;
                if (s != null) RelateStaffName = s.RealName;
            }

            if (RelateWareHouse != 0)
            {
                CM_WareHouse w = new CM_WareHouseBLL(RelateWareHouse).Model;
                if (w != null) RelateWareHouseName = w.Name;
            }

            #region 获取字典表名称
            try
            {
                if (m.VehicleClassify > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("CM_VehicleClassify")[m.VehicleClassify.ToString()];
                    if (dic != null) VehicleClassifyName = dic.Name;
                }
            }
            catch (System.Exception err)
            {
                LogWriter.WriteLog("MCSFramework.WSI.Vehicle", err);
            }
            #endregion
        }
Exemplo n.º 2
0
 public Vehicle(CM_Vehicle m)
 {
     FillModel(m);
 }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数

            int ID = Request.QueryString["ID"] != null && int.TryParse(Request.QueryString["ID"].ToString(), out ID) ? ID : 0;
            ViewState["ID"] = ID;

            #endregion

            BindDropDown();

            if ((int)ViewState["ID"] != 0)
            {
                //修改
                BindData();
            }
            else
            {
                //新增
                CM_Vehicle v = new CM_Vehicle();
                v.VehicleClassify = 2;
                v.State = 1;
                pl_detail.BindData(v);

                bt_Approve.Visible = false;
            }
        }
    }