本文整理匯總了C#中WindowsFormsApplication13.DataManager.ProgrammerAddNewProgrammer方法的典型用法代碼示例。如果您正苦於以下問題:C# DataManager.ProgrammerAddNewProgrammer方法的具體用法?C# DataManager.ProgrammerAddNewProgrammer怎麽用?C# DataManager.ProgrammerAddNewProgrammer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WindowsFormsApplication13.DataManager
的用法示例。
在下文中一共展示了DataManager.ProgrammerAddNewProgrammer方法的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: ProgrammerAddNewProgrammerTest
public void ProgrammerAddNewProgrammerTest()
{
DataManager target = new DataManager(); // TODO: Initialize to an appropriate value
int expected = 0;
int actual;
actual = target.ProgrammerAddNewProgrammer("Dan",50,4);
Assert.AreEqual(expected, actual);
//Assert.Inconclusive("Verify the correctness of this test method.");
}