public ActionResult CustomRequirements(Model.FlowerDemand FlowerDemand) { ViewData["deptSelectItems"] = GetdeptSelectItems(); FlowerDemand.FlowerCategoryType = Request["deptSelectItems"]; Business.Sys_FlowerDemand Sys_FlowerDemand = new Business.Sys_FlowerDemand(); if (Sys_FlowerDemand.InsertFlowerDemand(FlowerDemand)) { ViewData["success"] = "添加成功"; } return(View()); }
/// <summary> /// 写入一条需求记录 /// </summary> /// <param name="FlowerDemand"></param> /// <returns></returns> public bool InsertFlowerDemand(Model.FlowerDemand FlowerDemand) { const string sql = @"INSERT INTO FlowerDemand(FlowerCategoryType,ContactsName,ContactsPhone,ContactsAddress,ContentMsg,State) VALUES(@FlowerCategoryType,@ContactsName,@ContactsPhone,@ContactsAddress,@ContentMsg,@State)"; return(Factory.DBHelper.ExecSQL(SQLConString, sql.ToString(), new DynamicParameters(new { FlowerDemand.FlowerCategoryType, FlowerDemand.ContactsName, FlowerDemand.ContactsPhone, FlowerDemand.ContactsAddress, FlowerDemand.ContentMsg, FlowerDemand.State }))); }