예제 #1
0
        public override ActionResult EditMasterDataByID(int id)
        {
            operationMode = OperationMode.EditModify;
            ac            = new a_PageContext()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };;

            RunOneDataEnd <m_PageContext> HResult = ac.GetDataMaster(id, LoginUserId);

            md          = HResult.SearchData;
            md.EditType = EditModeType.Modify;
            HandleResultCheck(HResult);
            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.Remove("id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;

            return(View("EditData", md));
        }
예제 #2
0
        public override ActionResult EditMasterNewData()
        {
            operationMode = OperationMode.EditInsert;
            md            = new m_Message();

            //設定預設值

            //如有在模組做Log記錄,請加logPlamInfo = plamInfo
            ac = new a_Message()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            md.id       = ac.GetIDX();
            md.isopen   = true;
            md.set_date = DateTime.Now;
            md.sort     = 1;
            md.EditType = EditModeType.Insert;

            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;
            return(View("EditData", md));
        }
예제 #3
0
        public override ActionResult EditMasterNewData()
        {
            operationMode = OperationMode.EditInsert;


            ac = new a_PageContext()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            md = new m_PageContext()
            {
                id = ac.GetIDX()
            };
            md.EditType = EditModeType.Insert;
            #region 新增欄位預設值設定
            //md.SetDate = DateTime.Now;
            #endregion
            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString
            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;

            return(View("EditData", md));
        }
예제 #4
0
        public override ActionResult EditMasterNewData()
        {
            operationMode = OperationMode.EditInsert;
            md            = new m_ProgData();

            //設定預設值

            ac            = new a_ProgData();
            ac.Connection = getSQLConnection();

            md.EditType  = EditModeType.Insert;
            md.PowerItem = new PowerManagement(0);
            md.id        = ac.GetIDX();

            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;

            return(View("EditData", md));
        }
예제 #5
0
        public override ActionResult EditMasterNewData()
        {
            operationMode = OperationMode.EditInsert;
            md            = new m__CodeHead();

            //設定預設值

            ac = new a__CodeHead()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };;
            md.id       = ac.GetIDX();
            md.IsEdit   = false;
            md.EditType = EditModeType.Insert;

            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;

            return(View("EditData", md));
        }
        public override ActionResult EditMasterDataByID(int id)
        {
            #region GetKinds
            //gg
            a_ProductKind c = new a_ProductKind()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            RunQueryPackage <m_ProductKind> hResult = c.SearchMaster(new q_ProductKind(), LoginUserId);
            HandleResultCheck(hResult);
            List <SelectListItem> New_Kinds    = new List <SelectListItem>();
            List <SelectListItem> Second_Kinds = new List <SelectListItem>();
            #endregion

            operationMode = OperationMode.EditModify;
            ac            = new a_ProductData()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };

            RunOneDataEnd <m_ProductData> HResult = ac.GetDataMaster(id, LoginUserId);
            md = HResult.SearchData;

            int sid = hResult.SearchData.Where(m_ProductData => m_ProductData.ID == md.Kind).First().Series;
            foreach (var item in hResult.SearchData.Where(x => x.Series == sid))
            {
                if (item.IsSecond == true)
                {
                    Second_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
                else
                {
                    New_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
            }
            ViewBag.NewKind_Option    = New_Kinds;
            ViewBag.SecondKind_Option = Second_Kinds;

            md.Series   = sid;
            md.EditType = EditModeType.Modify;
            HandleResultCheck(HResult);
            HandleCollectDataToOptions();

            ViewBag.Caption = GetSystemInfo().prog_name;

            HandleRequest HRq = new HandleRequest(); //記錄QueryString
            HRq.Remove("id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            ViewBag.id          = id;
            HRq = null;

            return(View("EditData", md));
        }
        public override ActionResult EditMasterNewData()
        {
            #region GetKinds
            //gg
            a_ProductKind c = new a_ProductKind()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            RunQueryPackage <m_ProductKind> hResult = c.SearchMaster(new q_ProductKind(), LoginUserId);
            HandleResultCheck(hResult);
            List <SelectListItem> All_Kinds    = new List <SelectListItem>();
            List <SelectListItem> New_Kinds    = new List <SelectListItem>();
            List <SelectListItem> Second_Kinds = new List <SelectListItem>();
            foreach (var item in hResult.SearchData.Where(x => x.Series == 12))//預設為 新進商品 SID=12
            {
                All_Kinds.Add(new SelectListItem()
                {
                    Text = item.Name, Value = item.ID.ToString()
                });
                if (item.IsSecond == true)
                {
                    Second_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
                else
                {
                    New_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
            }
            ViewBag.NewKind_Option    = New_Kinds;
            ViewBag.SecondKind_Option = Second_Kinds;
            ViewBag.AllKind_Option    = All_Kinds;
            #endregion

            operationMode = OperationMode.EditInsert;
            HandleCollectDataToOptions();
            ViewBag.Caption = GetSystemInfo().prog_name;
            HandleRequest HRq = new HandleRequest(); //記錄QueryString
            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;
            ac  = new a_ProductData()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            return(View("EditData", new m_ProductData()
            {
                ID = ac.GetIDX(),
                IsSecond = true,
                EditType = EditModeType.Insert,
                IsOpen = true
            }));
        }
        public override ActionResult ListGrid(q_ProductData sh)
        {
            #region GetKinds
            //gg
            a_ProductKind c = new a_ProductKind()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            RunQueryPackage <m_ProductKind> hResult = c.SearchMaster(new q_ProductKind(), LoginUserId);
            HandleResultCheck(hResult);
            List <SelectListItem> All_Kinds    = new List <SelectListItem>();
            List <SelectListItem> New_Kinds    = new List <SelectListItem>();
            List <SelectListItem> Second_Kinds = new List <SelectListItem>();
            Second_Kinds.Add(new SelectListItem()
            {
                Text = "不分類", Value = null
            });
            New_Kinds.Add(new SelectListItem()
            {
                Text = "不分類", Value = null
            });
            foreach (var item in hResult.SearchData)
            {
                All_Kinds.Add(new SelectListItem()
                {
                    Text = item.Name, Value = item.ID.ToString()
                });
                if (item.IsSecond == true)
                {
                    Second_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
                else
                {
                    New_Kinds.Add(new SelectListItem()
                    {
                        Text = item.Name, Value = item.ID.ToString()
                    });
                }
            }
            ViewBag.NewKind_Option    = New_Kinds;
            ViewBag.SecondKind_Option = Second_Kinds;
            #endregion

            operationMode = OperationMode.EnterList;
            HandleRequest HRq = new HandleRequest(); //記錄QueryString
            HRq.encodeURIComponent = true;
            HRq.Remove("page");

            ViewBag.Page              = QueryGridPage();
            ViewBag.Caption           = GetSystemInfo().prog_name;
            ViewBag.AppendQuertString = HRq.ToQueryString();
            HRq = null;

            return(View("ListData", sh));
        }
예제 #9
0
        public override ActionResult ListGrid(q_PageContext sh)
        {
            operationMode = OperationMode.EnterList;
            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.encodeURIComponent = true;
            HRq.Remove("page");

            ViewBag.Page              = QueryGridPage();
            ViewBag.Caption           = GetSystemInfo().prog_name;
            ViewBag.AppendQuertString = HRq.ToQueryString();
            HRq = null;

            return(View("ListData", sh));
        }
예제 #10
0
        public override ActionResult EditMasterNewData()
        {
            operationMode = OperationMode.EditInsert;
            HandleCollectDataToOptions();
            ViewBag.Caption = GetSystemInfo().prog_name;
            HandleRequest HRq = new HandleRequest(); //記錄QueryString

            HRq.Remove("Id");                        //不需記ID
            ViewBag.QueryString = HRq.ToQueryString();
            HRq = null;
            ac  = new a_ProductKind()
            {
                Connection = getSQLConnection(), logPlamInfo = plamInfo
            };
            return(View("EditData", new m_ProductKind()
            {
                ID = ac.GetIDX(),
                EditType = EditModeType.Insert,
                IsOpen = true
            }));
        }