bklLiudl
2024-07-23 277bbae216debe7e6c04e8cc6ee6e1ba9763e14b
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
using BLL;
using Model;
using Lib;
using System.Data;
using System.Web.Mvc;
using FastReport.Web;
using System;
using BLL.DAL;
using FastReport;
 
namespace WMS.Areas.Data.Controllers
{
    public class StoreController : MasterPage
    {
 
        // GET: Data/Stroe
        [LoginFilter]
        public ActionResult StoreBasic()
        {
            //ViewBag.AreaList = LocalHelper.GetAreaList(string.Empty);
            //ViewBag.AddreList = LocalHelper.GetAddreList(string.Empty,string.Empty);
            ViewBag.MatType = LocalHelper.GetDictionaryHtml("MatType");
            ViewBag.Brand = LocalHelper.GetBrandItemsHtml();
 
            return View();
        }
 
        public ActionResult StoreDetail()
        {
            ViewBag.MatNo = Request.QueryString.Get("MatNo");
 
            if (Request.QueryString.Get("MatNo") != "")
            {
                DALStore dALStore = new DALStore();
                DataTable dt = dALStore.GetStoreDetail(Request.QueryString.Get("MatNo"), this.LoginDepartNum);
                string json = Common.JsonHelper.DataTableToJson(dt);
 
                ViewBag.Detail = json;
            }
            return View();
        }
 
        public ActionResult ReportShow()
        {
            string statu = Request.QueryString.Get("type");
 
            WebReport webReport = new WebReport();
            webReport.Width = System.Web.UI.WebControls.Unit.Percentage(150);
            webReport.Height = System.Web.UI.WebControls.Unit.Percentage(100);
            webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black;
            webReport.PrintInBrowser = false;
            webReport.PrintInPdf = false;
            webReport.ShowExports = false;
            webReport.SinglePage = false;
            //webReport.ToolbarStyle = ToolbarStyle.Small;
            webReport.PrintInPdf = true;
            webReport.ShowPrint = true;
            webReport.PreviewMode = true;
 
            if (statu == "A")
            {
                StroeItems models = Session["Stitems"] as StroeItems;
                string path = "~/Report/库存明细报表.frx";
                path = Server.MapPath(path);
                webReport.Report.Load(path);
 
                DALStroeMat dALStroeMat = new DALStroeMat();
                DataSet ds = new DataSet();
                DataTable dt1 = new DataTable();
                dt1.Columns.Add("UserName");
                dt1.Columns.Add("CreatTime");
                DataRow row = dt1.NewRow();
                row["UserName"] = this.LoginName;
                row["CreatTime"] = DateTime.Now.ToString("yyyy-MM-dd");
                dt1.Rows.Add(row);
                dt1.TableName = "TbTitle";
                DataTable dt = dALStroeMat.GetStroeItems(models);
                ds.Tables.Add(dt);
                ds.Tables.Add(dt1);
                if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
                {
                    webReport.Report.RegisterData(ds);
 
                    webReport.Report.GetDataSource("TbTitle").Enabled = true;
                    webReport.Report.GetDataSource("TbItems").Enabled = true;
                }
                webReport.ID = "库存明细报表";
                ViewBag.WebReport = webReport;
            }
            else
            {
                #region 库存报表
                StroeMat models = Session["Stm"] as StroeMat;
 
                string path = "~/Report/库存统计.frx";
                path = Server.MapPath(path);
                webReport.Report.Load(path);
 
                DALStroeMat dALStroeMat = new DALStroeMat();
                DataSet ds = new DataSet();
                DataTable dt1 = new DataTable();
                dt1.Columns.Add("UserName");
                dt1.Columns.Add("CreatTime");
                DataRow row = dt1.NewRow();
                row["UserName"] = this.LoginName;
                row["CreatTime"] = DateTime.Now.ToString("yyyy-MM-dd");
                dt1.Rows.Add(row);
                dt1.TableName = "UserInfo";
                DataTable dt = dALStroeMat.GetStroeMatDetail(models);
                ds.Tables.Add(dt);
                ds.Tables.Add(dt1);
                if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
                {
                    webReport.Report.RegisterData(ds);
 
                    webReport.Report.GetDataSource("UserInfo").Enabled = true;
                    webReport.Report.GetDataSource("View_StroeMat_Material").Enabled = true;
                }
                webReport.ID = "库存统计";
                ViewBag.WebReport = webReport;
                #endregion
            }
 
            return View();
        }
 
        public ActionResult Dialog()
        {
            if (Request.QueryString.Get("type") == "2")
            {
                //ViewBag.PackFormat = LocalHelper.GetDictionaryHtml("Type");
                ViewBag.PackFormat = LocalHelper.PalletStore("Type");
                ViewBag.type = Request.QueryString.Get("type");
            }
            else
            {
                ViewBag.type = "1";
            }
            return View();
        }
    }
}