private CookbookSetInDateInfo GetInfo() { var loginedUser = PageUtility.User; var ret = new CookbookSetInDateInfo { Id = 0, CreatedByID = loginedUser.ID, CreatedByName = loginedUser.Alias, CreatedDate = DateTime.Now }; // 如果是修改,则获取要修改的对象 if (!string.IsNullOrEmpty(Request["id"])) { var cbsInfo = _cookbookBLL.GetCookbookSetInDate(Convert.ToInt32(Request["id"])); if (cbsInfo == null) { return(null); } ret = cbsInfo; } ret.CafeteriaId = Convert.ToInt32(this.ddlCafeteria.SelectedValue); ret.CafeteriaName = this.ddlCafeteria.SelectedItem.Text; ret.ChooseDate = Calendar1.SelectedDate; //订餐日期 ret.CookbookEnum = (CookbookEnum)Enum.Parse(typeof(CookbookEnum), ddlCookbookEnum.SelectedValue); //订餐时段 if (!loginedUser.IsSystem) { if (loginedUser.OrganizationId != null) { ret.OrganizationId = loginedUser.OrganizationId.Value; } ret.OrganizationName = loginedUser.OrganizationName; } ////获取食堂信息 //var id = Convert.ToInt32(ddlCafeteria.SelectedValue); //var cafeInfo = GetCafeteria(id); ret.Price = pnlPrice.Visible ? (decimal?)Convert.ToDecimal(tbxPrice.Text.Trim()) : null; ret.DisplayOrder = int.Parse(txtOrder.Text.Trim()); ret.LastUpdByID = loginedUser.ID; ret.LastUpdByName = loginedUser.Alias; ret.LastUpdDate = DateTime.Now; return(ret); }
/// <summary> /// 修改排餐 /// </summary> public void ModifyCookbookSetInDate(CookbookSetInDateInfo info) { StaticCookbookSetInDateDAL.Update(info); }
/// <summary> /// 添加排餐 /// </summary> public void AddCookbookSetInDate(CookbookSetInDateInfo info) { StaticCookbookSetInDateDAL.Insert(info); }