本文整理汇总了C#中WindowsFormsApplication13.DataManager.ProgrammerUpdateProgrammerName方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.ProgrammerUpdateProgrammerName方法的具体用法?C# DataManager.ProgrammerUpdateProgrammerName怎么用?C# DataManager.ProgrammerUpdateProgrammerName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowsFormsApplication13.DataManager
的用法示例。
在下文中一共展示了DataManager.ProgrammerUpdateProgrammerName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProgrammerToDB
private void ProgrammerToDB()
{
if (!IfProgrammerGreedChanged())
return;
DataManager dm = new DataManager();
MathManager mm = new MathManager();
int col = 3;
int rows = programmerDataGridView.Rows.Count;
string[] read = new string[col];
for (int i = 0; i < rows - 1; i++)
{
for (int j = 0; j < col; j++)
{
read[j] = programmerDataGridView.Rows[i].Cells[j + 1].Value.ToString();
}
/*for (int j = 0; j < col; j++)
{
if (j == 2)
continue; // description might be null
if (read[j] == null)
return;
}*/
int programmer_ID = Convert.ToInt32(programmerDataGridView.Rows[i].Cells[0].Value.ToString());
if (mm.isProgrammer_Id_Exist(programmer_ID) >= 0)
{ // task already exist, therefore we need only to update
if (mm.isProgrammerNameValid(read[0]) == true)
{
dm.ProgrammerUpdateProgrammerName(programmer_ID, read[0]);
}
else
{
MessageBox.Show("Invalid programmer name at line:" + (i + 1));
return;
}
dm.ProgrammerUpdateProgrammerExpectedWorkHours(programmer_ID,Convert.ToDouble(read[1]));
dm.ProgrammerUpdateProgrammerCurrentWorkHours(programmer_ID, Convert.ToDouble(read[2]));
}
else
{
int ans = dm.ProgrammerAddNewProgrammer(read[0], Convert.ToInt32(read[1]), Convert.ToInt32(read[2]));
if (ans == -1)
{
MessageBox.Show("Error adding new programmer");
return;
}
}
}
}
示例2: ProgrammerUpdateProgrammerNameTest
public void ProgrammerUpdateProgrammerNameTest()
{
DataManager target = new DataManager(); // TODO: Initialize to an appropriate value
int expected = 0;
int actual;
actual = target.ProgrammerUpdateProgrammerName(1,"Vasia");
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}