public static void DeleteCheckList(CheckListProp checkListProp)
 {
     using (IDbConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString))
     {
         connection.Open();
         connection.Execute("DeleteCheckList", new { CheckList_ID = checkListProp.CheckList_ID }, commandType: CommandType.StoredProcedure);
     }
 }
Exemple #2
0
        private void SpawnCheckListUserControl()
        {
            Data.CheckListProp checkListProp = new Data.CheckListProp();
            checkListProp.Card_ID            = cardProp.Card_ID;
            checkListProp.CheckList_Name     = $"Checklist ({checkListProps.Count})";
            checkListProp.CheckList_Position = checkListProps.Count;
            Data.DataService.InsertCheckList(checkListProp);

            checkListProps = Data.DataService.GetCheckListByCardID(cardProp.Card_ID);
            SpawnCheckListUserControl(checkListProps[checkListProps.Count - 1], true);
        }
 public static void InsertCheckList(CheckListProp checkListProp)
 {
     using (IDbConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString))
     {
         connection.Open();
         DynamicParameters dp = new DynamicParameters();
         dp.AddDynamicParams(new
         {
             Card_ID            = checkListProp.Card_ID,
             CheckList_Name     = checkListProp.CheckList_Name,
             CheckList_Position = checkListProp.CheckList_Position
         });
         connection.Execute("InsertCheckList", dp, commandType: CommandType.StoredProcedure);
     }
 }
Exemple #4
0
        private void SpawnCheckListUserControl(Data.CheckListProp clProp, bool focus)
        {
            CheckListUserControl checkListUserControl = new CheckListUserControl();

            checkListUserControl.AutoSize          = true;
            checkListUserControl.AutoSizeMode      = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            checkListUserControl.BackColor         = System.Drawing.Color.Teal;
            checkListUserControl.Location          = new System.Drawing.Point(5, 5);
            checkListUserControl.Margin            = new System.Windows.Forms.Padding(5, 10, 5, 10);
            checkListUserControl.Name              = "checkListUserControl";
            checkListUserControl.Size              = new System.Drawing.Size(693, 130);
            checkListUserControl.CheckListDeleted += CheckListUserControl_CheckListDeleted;
            checkListUserControl.Reset            += CheckListUserControl_Reset;
            checkListUserControl.LoadData(clProp);
            checkListPanel.Controls.Add(checkListUserControl);
            checkListPanel.Controls.SetChildIndex(checkListUserControl, clProp.CheckList_Position);

            if (focus == true)
            {
                checkListUserControl.OnSpawned();
            }
        }