當前位置: 首頁>>代碼示例>>C#>>正文


C# DataManager.TaskSetTaskDescription方法代碼示例

本文整理匯總了C#中WindowsFormsApplication13.DataManager.TaskSetTaskDescription方法的典型用法代碼示例。如果您正苦於以下問題:C# DataManager.TaskSetTaskDescription方法的具體用法?C# DataManager.TaskSetTaskDescription怎麽用?C# DataManager.TaskSetTaskDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WindowsFormsApplication13.DataManager的用法示例。


在下文中一共展示了DataManager.TaskSetTaskDescription方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TaskSetTaskDescriptionTest

 public void TaskSetTaskDescriptionTest()
 {
     DataManager target = new DataManager(); // TODO: Initialize to an appropriate value
     int expected = 0;
     int actual;
     actual = target.TaskSetTaskDescription(1,"hz");
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
開發者ID:AntonLitovka,項目名稱:Backlog,代碼行數:9,代碼來源:DataManagerTest.cs

示例2: TaskToDB

        private void TaskToDB()
        {
            if (!IfTaskGreedChanged())
                return;

            DataManager dm = new DataManager();
            MathManager mm = new MathManager();
            //int col = 4;
            //int rows = taskDataGridView.Rows.Count;
            //int col;
            int rows;

            if (Convert.ToInt32(updatedTaskIndexes.Count.ToString()) == 0) // no changes were found, there fore no need to save any data
                return;

            //string[] read = new string[4];

            for(int i = 0; i < Convert.ToInt32(updatedTaskIndexes.Count.ToString()); i++)
                {
                    rows = updatedTaskIndexes.ElementAt(i).getRow();
                    int task_ID = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[1].Value.ToString());
                    if (mm.isTask_Id_Exist(task_ID) >= 0)
                    { //     task already exist, therefore we need only to update
                        int storyId = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[0].Value.ToString());
                        if (mm.isTask_Story_IDValid(storyId) >= 0)
                        {
                            int ans = dm.TaskSetTaskStoryID(task_ID, storyId);
                        }
                        else
                        {
                            MessageBox.Show("Invalid Story id at line:" + (rows + 1));
                            updatedTaskIndexes.RemoveAt(i);
                            return;
                        }

                        int priority = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[2].Value.ToString());
                        if (mm.isTask_PriorityValid(priority) >= 0)
                        {
                            dm.TaskSetTaskPriority(task_ID, priority);
                        }
                        else
                        {
                            MessageBox.Show("Invalid Priority value at line:" + (rows + 1));
                            updatedTaskIndexes.RemoveAt(i);
                            return;
                        }

                        string descriptions = taskDataGridView.Rows[rows].Cells[5].Value.ToString();
                        dm.TaskSetTaskDescription(task_ID, descriptions);

                        int ownerId = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[3].Value.ToString());
                        if (mm.isTask_Ovner_IdValid(ownerId) >= 0)
                        {
                            dm.TaskSetTaskOwner(task_ID, ownerId);
                        }
                        else
                        {
                            MessageBox.Show("Invalid Owner Id at line:" + (rows + 1));
                            updatedTaskIndexes.RemoveAt(i);
                            return;
                        }
                    }
                    else
                    {
                        int storyId = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[0].Value.ToString());
                        int priority = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[2].Value.ToString());
                        string descriptions = taskDataGridView.Rows[rows].Cells[5].Value.ToString();
                        int ownerId = Convert.ToInt32(taskDataGridView.Rows[rows].Cells[3].Value.ToString());

                        int ans = dm.TaskAddNewTask(storyId, priority, descriptions,
                                                    ownerId);

                        MessageBox.Show("Added");
                        if (ans == -1)
                        {
                            MessageBox.Show("Error while creating new task");
                            updatedTaskIndexes.RemoveAt(i);
                            return;
                        }
                    }
            }
            int size = Convert.ToInt32(updatedTaskIndexes.Count.ToString());
            for (int i = 0; i < size; i++)
            {
                updatedTaskIndexes.RemoveAt(0);
            }
        }
開發者ID:AntonLitovka,項目名稱:Backlog,代碼行數:87,代碼來源:Form1.cs


注:本文中的WindowsFormsApplication13.DataManager.TaskSetTaskDescription方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。