public long Save(CLayer.Condition Condition) { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pConditionId", DataPlug.DataType._BigInt, Condition.ConditionId)); param.Add(Connection.GetParameter("pAccommodationId", DataPlug.DataType._BigInt, Condition.AccommodationId)); param.Add(Connection.GetParameter("pConditionText", DataPlug.DataType._Varchar, Condition.ConditionText)); object result = Connection.ExecuteQueryScalar("condition_Save", param); return(Connection.ToLong(Condition)); }
public ActionResult Details(long ConditionId) { Models.ConditionModel search = new Models.ConditionModel(); CLayer.Condition get = BLayer.Condition.GetOnebyConditionId(ConditionId); if (get != null) { search = new Models.ConditionModel { AccommodationId = get.AccommodationId, ConditionId = get.ConditionId, ConditionText = get.ConditionText }; } return(PartialView("_Details", search)); }
public CLayer.Condition Get(long ConditionId) { CLayer.Condition con = null; List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pConditionId", DataPlug.DataType._BigInt, ConditionId)); DataTable dt = Connection.GetTable("Condition_Details", param); if (dt.Rows.Count > 0) { con = new CLayer.Condition(); con.AccommodationId = Connection.ToLong(dt.Rows[0]["AccommodationId"]); con.ConditionId = Connection.ToLong(dt.Rows[0]["ConditionId"]); con.ConditionText = Connection.ToString(dt.Rows[0]["ConditionText"]); } return(con); }
public List <CLayer.Condition> GetAllForAccommodations(string accommodationIds) { List <DataPlug.Parameter> param = new List <DataPlug.Parameter>(); param.Add(Connection.GetParameter("pAccIds", DataPlug.DataType._Varchar, accommodationIds)); DataTable dt = Connection.GetTable("accommodation_GetAllConditions", param); List <CLayer.Condition> result = new List <CLayer.Condition>(); CLayer.Condition cond; foreach (DataRow dr in dt.Rows) { cond = new CLayer.Condition(); cond.AccommodationId = Connection.ToLong(dr["AccommodationId"]); cond.ConditionText = Connection.ToString(dr["ConditionText"]); result.Add(cond); } return(result); }
public ActionResult Save(Models.ConditionModel data) { try { CLayer.Condition d = new CLayer.Condition() { AccommodationId = data.AccommodationId, ConditionId = data.ConditionId, ConditionText = data.ConditionText }; data.AccommodationId = BLayer.Condition.Save(d); return(RedirectToAction("index", new { id = data.AccommodationId })); } catch (Exception ex) { Common.LogHandler.HandleError(ex); return(RedirectToAction("index", new { id = data.AccommodationId })); } }
public static long Save(CLayer.Condition data) { DataLayer.Condition task = new DataLayer.Condition(); return(task.Save(data)); }