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)); }
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)); }
public override ActionResult EditMasterNewData() { operationMode = OperationMode.EditInsert; md = new m_Unit(); //設定預設值 md.EditType = EditModeType.Insert; ac = new a_Unit(); ac.Connection = getSQLConnection(); 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 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 })); }
public override ActionResult EditMasterDataByID(int id) { operationMode = OperationMode.EditModify; ac = new a_ProgData(); ac.Connection = getSQLConnection(); RunOneDataEnd <m_ProgData> 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)); }