本文整理汇总了C#中DataAccess.insertNewActivity方法的典型用法代码示例。如果您正苦于以下问题:C# DataAccess.insertNewActivity方法的具体用法?C# DataAccess.insertNewActivity怎么用?C# DataAccess.insertNewActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataAccess
的用法示例。
在下文中一共展示了DataAccess.insertNewActivity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
lblMsg.Text = "";
hfPageInfo.Value = "0";
hfFlgSave.Value = "";
try
{
if (Request.QueryString.Get("acrId").Equals("-1"))
{
//Add new Activity Request
DataAccess obj = new DataAccess();
//Local Plan id will be enter later, use 101 for now
int aId = Convert.ToInt32(Request.QueryString.Get("aid").ToString());
int key_acId = obj.insertNewActivity(aId,
txtNewActivityName.Text,
txtNewActivityDesc.Text,
txtNewCoreIndicatorDesc.Text);
//Insert Core Indicator
if (key_acId > 0)
{
for (int i = 0; i < cblCoreIndicators.Items.Count; i++)
if (cblCoreIndicators.Items[i].Selected)
obj.insertNewNewCoreInd(key_acId,
aId,
Convert.ToInt32(cblCoreIndicators.Items[i].Value));
}
selectReturnForm(-1);
}
else
{
//Update Current Activity Request
DataAccess obj = new DataAccess();
//Local Plan id will be enter later, use 101 for now
int aId = Convert.ToInt32(Request.QueryString.Get("aid").ToString());
int acId = Convert.ToInt32(Request.QueryString.Get("acrId").ToString());
obj.updateActivityChangeRequest(acId, aId,
txtNewActivityName.Text,
txtNewActivityDesc.Text,
txtNewCoreIndicatorDesc.Text,
cbApproved.Checked);
//Insert Core Indicator
for (int i = 0; i < cblCoreIndicators.Items.Count; i++)
if (cblCoreIndicators.Items[i].Selected)
obj.insertNewNewCoreInd(acId,
aId,
Convert.ToInt32(cblCoreIndicators.Items[i].Value));
//Approved by SO
if (cbApproved.Checked)
{
String returnVal = obj.approveChangeRequest(acId, aId);
}
}
scs_error_dictionary errObj = new scs_error_dictionary();
if (errObj.LoadByPrimaryKey("200"))
{
lblMsg.Text = errObj.Txt_message;
}
}
catch
{
scs_error_dictionary errObj = new scs_error_dictionary();
if (errObj.LoadByPrimaryKey("201"))
{
lblMsg.Text = errObj.Txt_message;
}
}
}
}