当前位置: 首页>>代码示例>>C#>>正文


C# DataManager.StoryAddNewStory方法代码示例

本文整理汇总了C#中WindowsFormsApplication13.DataManager.StoryAddNewStory方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.StoryAddNewStory方法的具体用法?C# DataManager.StoryAddNewStory怎么用?C# DataManager.StoryAddNewStory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WindowsFormsApplication13.DataManager的用法示例。


在下文中一共展示了DataManager.StoryAddNewStory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StoryToDb

 private void StoryToDb()
 {
     if (!IfStoryGreedChanged())
         return;
     DataManager dm = new DataManager();
     int cols = 6;
     int rows = storyDataGridView.RowCount;
     string[] read = new string[cols];
     for (int i = 0; i < rows - 1; i++)
     {
         for (int j = 0; j < cols; j++)
         {
             read[j] = storyDataGridView.Rows[0].Cells[j + 1].Value.ToString();
         }
         for (int j = 0; j < cols; j++)
         {
             if (j == 2 || j == 3)
                 continue; // description might be null
             if (read[j] == null)
                 return;
         }
         int ans = dm.StoryAddNewStory(Convert.ToInt32(read[0]), DateTime.Parse(read[1]), read[2], null, read[3],
                                       Convert.ToInt32(read[4]), Convert.ToInt32(read[5]));
         if (ans == -1)
             MessageBox.Show("Error while creating new story");
     }
 }
开发者ID:dmitrymov,项目名称:SE_Project,代码行数:27,代码来源:Form1.cs

示例2: Storyadd_new_storyTest

 public void Storyadd_new_storyTest()
 {
     DataManager target = new DataManager(); // TODO: Initialize to an appropriate value
     // int ID = 0; // TODO: Initialize to an appropriate value
     int Story_Owner = 0; // TODO: Initialize to an appropriate value
     DateTime Current_Sprint = DateTime.Parse("01.12.2012"); ; // TODO: Initialize to an appropriate value
     int Work_Status = 0; // TODO: Initialize to an appropriate value
     int Priority = 0; // TODO: Initialize to an appropriate value
     string Description = string.Empty; // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     string str = " ";
     Image pic = null;
     actual = target.StoryAddNewStory(Story_Owner, Current_Sprint, str, pic, Description, Priority, Work_Status);
     Assert.AreEqual(expected, actual);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
开发者ID:AntonLitovka,项目名称:Backlog,代码行数:17,代码来源:DataManagerTest.cs

示例3: StoryToDb

        private void StoryToDb()
        {
            //systemId = storydataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["SystemId"].Value.ToString();
            string id = storyDataGridView.Rows[0].Cells[0].Value.ToString();

            if (!IfStoryGreedChanged())
                return;
            DataManager dm = new DataManager();
            MathManager mm = new MathManager();

            int rows;

            if (Convert.ToInt32(updatedStoryIndexes.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(updatedStoryIndexes.Count.ToString()); i++)
                {
                    rows = updatedStoryIndexes.ElementAt(i).getRow();
                    //MessageBox.Show("6: " + storyDataGridView.Rows[rows].Cells[6].Value.ToString() + "1: " + storyDataGridView.Rows[rows].Cells[1].Value.ToString());
                    int story_ID = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[0].Value.ToString());
                    if (mm.isStory_Id_Exist(story_ID) >= 0)
                    {
                        int programmerID = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[2].Value.ToString());
                        if (mm.isProgrammer_Id_Exist(Convert.ToInt32(programmerID)) >= 0)
                        {
                            dm.StorySetOwnerID(story_ID, programmerID);
                        }
                        else
                        {
                            MessageBox.Show("Invalid story owner ID at line: " + (rows + 1));
                            return;
                        }
                        // if (mm.isStory_current_Sprint_valid(DateTime.Parse(read[1])) >= 0)
                        //{
                        dm.StorySetCurrentSprint(story_ID, DateTime.Parse(storyDataGridView.Rows[rows].Cells[3].Value.ToString()));
                        //}
                        /*else
                        {
                            MessageBox.Show("Invalid date of story_current_sprint at line: " + (i + 1));
                            return;
                        }*/
                        //dm.StorySetStoryDemoDes(story_ID, storyDataGridView.Rows[rows].Cells[4].Value.ToString());
                        //dm.StorySetStoryDemoPic(story_ID);
                        dm.StorySetStoryDescription(story_ID, storyDataGridView.Rows[rows].Cells[6].Value.ToString());
                        //MessageBox.Show("Passed here");
                        int priority = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[1].Value.ToString());
                        if (mm.isTask_PriorityValid(priority) >= 0)
                        {
                            dm.StorySetStoryPriority(story_ID, priority);
                        }
                        else
                        {
                            MessageBox.Show("Invalid priority value at line: " + (rows + 1));
                            return;
                        }
                        int workStatus = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[7].Value.ToString());
                        dm.StorySetStoryWorkStatus(story_ID, workStatus);
                    }
                    else
                    {
                        int workStatus = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[7].Value.ToString());
                        int priority = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[1].Value.ToString());

                        int programmerID = Convert.ToInt32(storyDataGridView.Rows[rows].Cells[2].Value.ToString());

                        int ans = dm.StoryAddNewStory(programmerID, DateTime.Parse(storyDataGridView.Rows[rows].Cells[3].Value.ToString()), storyDataGridView.Rows[rows].Cells[4].Value.ToString(), null, storyDataGridView.Rows[rows].Cells[6].Value.ToString(),
                                                     priority, workStatus);
                        if (ans == -1)
                        {
                            MessageBox.Show("Error while creating new story");
                            return;
                        }
                    }
                }
        }
开发者ID:AntonLitovka,项目名称:Backlog,代码行数:77,代码来源:Form1.cs


注:本文中的WindowsFormsApplication13.DataManager.StoryAddNewStory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。