bool searchstore(thismanagestore curitem, decimal cur_storeid) { foreach (TB_STORE myStore in db2.TB_STORE) { if (myStore.ID == cur_storeid) { curitem.db_store = new TB_STORE(); curitem.db_store.ID = myStore.ID; curitem.db_store.NAME = myStore.NAME; curitem.db_store.QUALITY_RATING = myStore.QUALITY_RATING; return true; } } return false; }
bool searchstore(thismanagestore curitem, decimal cur_storeid) { foreach (TB_STORE myStore in db2.TB_STORE) { if (myStore.ID == cur_storeid) { curitem.db_store = new TB_STORE(); curitem.db_store.ID = myStore.ID; curitem.db_store.NAME = myStore.NAME; curitem.db_store.QUALITY_RATING = myStore.QUALITY_RATING; return(true); } } return(false); }
// GET: CreateStore public ActionResult MyShop() { //ViewData["uid"] = cur_userid; decimal cur_userid = (Session["UserMessage"] as UserMessage).id; en_user_st.c_man_st = new List<thismanagestore>(); en_user_st.deci_user = cur_userid; foreach (TB_MANAGE myMag in db1.TB_MANAGE) { if (myMag.U_ID == cur_userid) { thismanagestore newitem = new thismanagestore(); newitem.db_manage = new TB_MANAGE(); newitem.db_manage.U_ID = myMag.U_ID; newitem.db_manage.S_ID = myMag.S_ID; newitem.db_manage.AUTHORITY = myMag.AUTHORITY; searchstore(newitem, myMag.S_ID); en_user_st.c_man_st.Add(newitem); } } return View(en_user_st.c_man_st); }
// GET: CreateStore public ActionResult MyShop() //显示我的店铺,我是店主 { //ViewData["uid"] = cur_userid; decimal cur_userid = (Session["UserMessage"] as UserMessage).id; en_user_st.c_man_st = new List <thismanagestore>(); en_user_st.deci_user = cur_userid; foreach (TB_MANAGE myMag in db1.TB_MANAGE) { if (myMag.U_ID == cur_userid) { thismanagestore newitem = new thismanagestore(); newitem.db_manage = new TB_MANAGE(); newitem.managers = new List <string>(); TB_MANAGE tempUser = new TB_MANAGE(); newitem.db_manage.U_ID = myMag.U_ID; newitem.db_manage.S_ID = myMag.S_ID; newitem.db_manage.AUTHORITY = myMag.AUTHORITY; if (myMag.AUTHORITY == true) { MyStore = myMag.S_ID; setManageList(myMag.S_ID, newitem.managers); } searchstore(newitem, myMag.S_ID); en_user_st.c_man_st.Add(newitem); } } return(View(en_user_st.c_man_st)); }