public override bool UpdateClassConfiguration(ClassConfigurationInfo entity) { DbCommand cmd = SqlHelpers.CreateCommand(DataHelpers.ConnectionString, "dbo.MON_ELRN_UPDATE_CLASS_CONFIGURATION"); cmd.AddInputParam("@CourseId", DbType.Int32, entity.CourseId); cmd.AddInputParam("@ClassId", DbType.Int32, entity.ClassId); cmd.AddInputParam("@Sku", DbType.AnsiString, entity.Sku); cmd.AddInputParam("@DelayDays", DbType.AnsiString, entity.DelayDays); int result; result = Convert.ToInt32(SqlHelpers.ExecuteNonQuery(cmd)); if (result > 0) return true; else return false; }
public override List<ClassConfigurationInfo> GetClassConfiguration(ClassConfigurationInfo entity) { DbCommand cmd = SqlHelpers.CreateCommand(DataHelpers.ConnectionString, "dbo.MON_ELRN_GET_CLASS_CONFIGURATION"); cmd.AddInputParam("@CourseId", DbType.Int32, entity.CourseId); cmd.AddInputParam("@ClassId", DbType.Int32, entity.ClassId); // cmd.AddInputParam("@Sku", DbType.AnsiString, entity.Sku)); return DataHelpers.ToClassConfiguration(cmd.ExecuteSelectTable()); }
public abstract bool UpdateClassConfiguration(ClassConfigurationInfo entity);
public abstract List<ClassConfigurationInfo> GetClassConfiguration(ClassConfigurationInfo entity);
protected void UpdateClassConfiguration() { Repeater PaymentOptionRepeater = (Repeater)EditClassConfigurationDialog.FindControl("PaymentOptionRepeater"); foreach (RepeaterItem item in PaymentOptionRepeater.Items) { TextBox DelayDaysTextBox = (TextBox)item.FindControl("DelayDaysTextBox"); Literal SKULiteral = (Literal)item.FindControl("SKULiteral"); ClassConfigurationInfo entity = new ClassConfigurationInfo(); entity.CourseId = Convert.ToInt32(ViewState["CourseId"]); entity.ClassId = this.Id; entity.Sku = SKULiteral.Text; int DelayDays; if (Int32.TryParse(DelayDaysTextBox.Text, out DelayDays)) entity.DelayDays = DelayDays; else entity.DelayDays = 0; //entity.DelayDays = Convert.ToInt32(DelayDaysTextBox.Text); bool result = ClassroomController.UpdateClassConfiguration(entity); if (result) { entity = null; } } }
public abstract bool InsertClassConfiguration(ref ClassConfigurationInfo entity);
protected void BindEntities() { _paymentoptionEntity = ProductController.GetProductsByRefId(Convert.ToInt32(ViewState["CourseId"])); ClassConfigurationInfo obj = new ClassConfigurationInfo(); obj.ClassId = this.Id; obj.CourseId = Convert.ToInt32(ViewState["CourseId"]); if (obj != null) { _classconfigurationEntity = ClassroomController.GetClassConfiguration(obj); obj = null; } }
public static List<ClassConfigurationInfo> GetClassConfiguration(ClassConfigurationInfo entity){return Instance.GetClassConfiguration(entity); }
public static bool UpdateClassConfiguration(ClassConfigurationInfo entity) { return Instance.UpdateClassConfiguration(entity); }
// Class Configuration Function public static bool InsertClassConfiguration(ref ClassConfigurationInfo entity) { return Instance.InsertClassConfiguration(ref entity); }
protected void InsertClassConfiguration(int ClassId) { foreach (RepeaterItem item in PaymentOptionRepeater.Items) { TextBox DelayDaysTextBox = (TextBox)item.FindControl("DelayDaysTextBox"); Literal SKULiteral = (Literal)item.FindControl("SKULiteral"); bool result = false; ClassConfigurationInfo entity = new ClassConfigurationInfo(); entity.CourseId = this.CourseId; ; entity.ClassId = ClassId; entity.Sku = SKULiteral.Text; entity.DelayDays = Convert.ToInt32(DelayDaysTextBox.Text); if (entity.DelayDays > 0) { result = ClassroomController.InsertClassConfiguration(ref entity); } else { entity = null; } if (result) { entity = null; } } }