Beispiel #1
0
        public ActionResult Details(string id)
        {
            NuclearGrowthEditModel            model = new NuclearGrowthEditModel();
            List <NuclearGrowthEditInfoModel> list  = new List <NuclearGrowthEditInfoModel>();

            model.infoModel = new List <NuclearGrowthEditInfoModel>();
            try
            {
                //权限验证
                //this.HasActionPower();

                if (!string.IsNullOrWhiteSpace(id))
                {
                    DataTable in_head = new DataTable();
                    DataTable in_list = new DataTable();
                    this.facadeVHz.GetDetailsData(id, out in_head, out in_list);
                    if (in_head != null && in_head.Rows.Count > 0)
                    {
                        model = in_head.ToList <NuclearGrowthEditModel>().First();
                        if (in_list != null && in_list.Rows.Count > 0)
                        {
                            foreach (DataRow row in in_list.Rows)
                            {
                                NuclearGrowthEditInfoModel infoModel = new NuclearGrowthEditInfoModel();
                                infoModel.code_t         = row["code_t"].ToString();
                                infoModel.mg_name        = row["mg_name"].ToString();
                                infoModel.mg_spec        = row["mg_spec"].ToString();
                                infoModel.g_qty          = Convert.ToDecimal(row["g_qty"]);
                                infoModel.g_unit         = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["g_unit"].ToString());
                                infoModel.curr_code      = Universal.GetStatusName(_Dictionary.ParaExchrate, row["curr_code"].ToString());
                                infoModel.unit_price     = Convert.ToDecimal(row["unit_price"]);
                                infoModel.trade_ttl      = Convert.ToDecimal(row["trade_ttl"]);
                                infoModel.orign_coun     = Universal.GetCcodesDisplayName(_Pccode.SourceDestination, row["orign_coun"].ToString());
                                infoModel.zm_code        = Universal.GetCcodesDisplayName(_Pccode.ExemptWay, row["zm_code"].ToString());
                                infoModel.baxh           = row["baxh"].ToString();
                                infoModel.code_s         = row["code_s"].ToString();
                                infoModel.rate           = Convert.ToDecimal(row["rate"]);
                                infoModel.rate_id        = row["rate_id"].ToString();
                                infoModel.pkgs           = Convert.ToDecimal(row["pkgs"]);
                                infoModel.gross          = Convert.ToDecimal(row["gross"]);
                                infoModel.net            = Convert.ToDecimal(row["net"]);
                                infoModel.qty_1          = Convert.ToDecimal(row["qty_1"]);
                                infoModel.unit_code1     = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["unit_code1"].ToString());
                                infoModel.usd_unit_price = Convert.ToDecimal(row["usd_unit_price"]);
                                infoModel.usd_trade_ttl  = Convert.ToDecimal(row["usd_trade_ttl"]);
                                infoModel.version_num    = row["version_num"].ToString();
                                infoModel.qty_2          = Convert.ToDecimal(row["qty_2"]);
                                infoModel.unit_code2     = Universal.GetStatusName(_Dictionary.CreatStoreUnit, row["unit_code2"].ToString());
                                infoModel.mass_no        = Convert.ToDecimal(row["mass_no"]);
                                infoModel.pcs            = row["pcs"].ToString();
                                list.Add(infoModel);
                            }
                            model.infoModel = list;
                            JavaScriptSerializer json = new JavaScriptSerializer();
                            model.jsonList = json.Serialize(list);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                var       msgT = Server.UrlEncode("系统出现错误,请联系客服或管理员处理!");
                var       msgD = Server.UrlEncode(ex.Message);
                UrlHelper url  = new UrlHelper(this.Request.RequestContext);
                this.Response.Redirect(url.Action("Index", "Error", new { msgTitle = msgT, msgDetail = msgD }));
            }


            return(View(model));
        }