public ActionResult Create(Media_Type media_Type) { if (ModelState.IsValid) { list_media.Add(media_Type); return(RedirectToAction("Index", "Home")); } else { return(View(media_Type)); } }
public ActionResult EditMedia(Media_Type myMedia) { var obj = lstMedia_Types.FirstOrDefault(x => x.Media_Code == myMedia.Media_Code); if (obj != null) { obj.Media_Code = myMedia.Media_Code; obj.Media_Desc = myMedia.Media_Desc; } return(RedirectToAction("Index", "Home")); }
public ActionResult AddMedia(Media_Type myMedia) { if (ModelState.IsValid) { lstMedia_Types.Add(myMedia); return(RedirectToAction("Index", "Home")); } else { return(View(myMedia)); } }
public ActionResult Edit(Media_Type media) { if (ModelState.IsValid) {/* * var obj = list_media.FirstOrDefault(x => x.Meida_code == media.Meida_code); * if (obj != null) * { * obj = media; * }*/ list_media.RemoveAt(pos); list_media.Insert(pos, media); return(RedirectToAction("Index", "Home")); } else { return(View(media)); } }
public WebMedia(DataRow myDR) { // //TODO: 在此处添加构造函数逻辑 // if (myDR != null) { _webmediaid = myDR["WebMediaID"].ToString(); _productid = myDR["ProductID"].ToString(); _media_type = (Media_Type)StringEnum.Parse(typeof(Media_Type), myDR["Media_Type"].ToString(), true); _media_title = myDR["Media_Title"].ToString(); _media_value = myDR["Media_Value"].ToString(); _media_description = myDR["Media_Description"].ToString(); _sortorder = Convert.ToInt16(myDR["SortOrder"]); switch (_media_type) { case Media_Type.Picture: if (DataEval.IsEmptyQuery(_media_value)) { _default_photourl = "/App_Control_Style/Nexus_Shop/Images/NoImg.png"; } else { _default_photourl = _media_value; } break; case Media_Type.Flash: _default_photourl = "/App_Control_Style/Nexus_Shop/Images/Movie.png"; break; case Media_Type.Youtube: _default_photourl = "/App_Control_Style/Nexus_Shop/Images/Movie.png"; break; } } }
public Product_Search(DataRow myDR, string target_currencyid, string itemdetailurl) { // //TODO: 在此处添加构造函数逻辑 // if (myDR != null) { // Product Variant _product_variantid = myDR["Product_VariantID"].ToString(); _variant_name = myDR["Variant_Name"].ToString(); _variant_type = (Variant_Type)StringEnum.Parse(typeof(Variant_Type), myDR["Variant_Type"].ToString(), true); _table_name = myDR["Table_Name"].ToString(); // Product Index _product_indexid = myDR["Product_IndexID"].ToString(); _title = myDR["Title"].ToString(); _short_description = myDR["Short_Description"].ToString(); _admin_comment = myDR["Admin_Comment"].ToString(); _isactiveindex = Convert.ToBoolean(myDR["IsActiveIndex"]); // Product _productid = myDR["ProductID"].ToString(); _product_indexid = myDR["Product_IndexID"].ToString(); _product_title = myDR["Product_Title"].ToString(); _title_type = (Title_Type)StringEnum.Parse(typeof(Title_Type), myDR["Title_Type"].ToString(), true); _product_sku = myDR["Product_SKU"].ToString(); _manufacturerid = myDR["ManufacturerID"].ToString(); _manufacturer_sku = myDR["Manufacturer_SKU"].ToString(); _webmediaid = myDR["WebMediaID"].ToString(); _product_variantid = myDR["Product_VariantID"].ToString(); _currencyid = myDR["CurrencyID"].ToString(); _rrp_price = Convert.ToDecimal(myDR["RRP_Price"]); _sortorder = Convert.ToInt16(myDR["SortOrder"]); _isactive = Convert.ToBoolean(myDR["IsActive"]); _create_date = Convert.ToDateTime(myDR["Create_Date"]); _lastupdate_date = Convert.ToDateTime(myDR["LastUpdate_Date"]); _lastupdate_userid = myDR["LastUpdate_UserID"].ToString(); _username = myDR["UserName"].ToString(); switch (_title_type) { case Title_Type.Prefix: _product_full_title = string.Format("{0} {1}", _product_title, _title); break; case Title_Type.Suffix: _product_full_title = string.Format("{0} {1}", _title, _product_title); break; case Title_Type.Override: _product_full_title = _product_title; break; default: _product_full_title = _product_title; break; } // Product Mapping _product_mappingid = myDR["Product_MappingID"].ToString(); _categoryid = myDR["Product_Title"].ToString(); _isfeatured = Convert.ToBoolean(myDR["IsFeatured"]); _category_sortorder = Convert.ToInt16(myDR["Category_SortOrder"]); // Manufacturer _manufacturer_name = myDR["Manufacturer_Name"].ToString(); _manufacturer_logo = myDR["Manufacturer_Logo"].ToString(); _manufacturer_url = myDR["Manufacturer_URL"].ToString(); __manufacturer_isactive = Convert.ToBoolean(myDR["Manufacturer_IsActive"]); // Web Media try { _media_type = (Media_Type)StringEnum.Parse(typeof(Media_Type), myDR["Media_Type"].ToString(), true); } catch { _media_type = Media_Type.Picture; } _media_value = myDR["Media_Value"].ToString(); switch (_media_type) { case Media_Type.Picture: if (DataEval.IsEmptyQuery(_media_value)) { _default_photourl = "/App_Control_Style/Nexus_Shop/Images/NoImg.png"; } else { _default_photourl = _media_value; } break; case Media_Type.Flash: _default_photourl = "/App_Control_Style/Nexus_Shop/Images/Movie.png"; break; case Media_Type.Youtube: _default_photourl = "/App_Control_Style/Nexus_Shop/Images/Movie.png"; break; } // Currency _currencyid = myDR["CurrencyID"].ToString(); _currency_name = myDR["Currency_Name"].ToString(); _currency_shortname = myDR["Currency_ShortName"].ToString(); _currency_webcode = myDR["Currency_WebCode"].ToString(); // Web UI _itemdetailurl = itemdetailurl; _target_currencyid = target_currencyid; if (_currencyid == target_currencyid) { _target_rrp_price = string.Format("{0}{1:#,##0}", _currency_webcode, _rrp_price); } else { Misc.CurrencyMgr myCurrencyMgr = new Misc.CurrencyMgr(); Misc.Currency myTarget_Currency = myCurrencyMgr.Get_Currency(_target_currencyid); _target_rrp_price = string.Format("{0}{1:#,##0}", myTarget_Currency.Currency_WebCode, myCurrencyMgr.Currency_Converter( Convert.ToDecimal(_rrp_price), _currencyid, _target_currencyid)); } } }
public ActionResult EditMedia(string sCode) { Media_Type oMedia = lstMedia_Types.Find(x => x.Media_Code == sCode); return(View(oMedia)); }