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


C# DataAccess.updateActivity方法代码示例

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


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

示例1: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            try
            {
                //Update current activity
                DataAccess obj = new DataAccess();
                act_activity actObj = new act_activity();
                actObj.ConnectionString = DataAccess.getConnStr();
                int ika = Convert.ToInt32(Request.QueryString.Get("keyid").ToString());

                if (actObj.LoadByPrimaryKey(ika))
                {
                    obj.updateActivity(ika,
                                       Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString()),
                                       (FormView1.FindControl("txtActivityName") as TextBox).Text,
                                       (FormView1.FindControl("txtDescActivity") as TextBox).Text,
                                       Convert.ToInt32((FormView1.FindControl("ddlProgramType") as DropDownList).SelectedValue),
                                       (FormView1.FindControl("txtDescCoreInd") as TextBox).Text,
                                       Convert.ToInt32((FormView1.FindControl("DLB_Category") as DropDownList).SelectedValue),
                                       Convert.ToInt32((FormView1.FindControl("DLB_FunCode") as DropDownList).SelectedValue),
                                       actObj.Key_activity_type_id,
                                       (FormView1.FindControl("txtSystemOfficeNotes") as TextBox).Text,
                                       Convert.ToInt32((FormView1.FindControl("ddStatus") as DropDownList).SelectedValue),
                                       (FormView1.FindControl("cbLocked") as CheckBox).Checked,
                                       (FormView1.FindControl("cbApproved") as CheckBox).Checked,
                                       true,
                                       (FormView1.FindControl("txtAmdReductionDesc") as TextBox).Text,
                                       102);

                    //Insert Core Indicator

                    CheckBoxList cblCoreIndicators = FormView1.FindControl("chkCoreIndicators") as CheckBoxList;
                    for (int i = 0; i < cblCoreIndicators.Items.Count; i++)
                        if (cblCoreIndicators.Items[i].Selected)
                            obj.insertFundedActivityCoreIndicator(Convert.ToInt32(ika),
                                                                  Convert.ToInt32(cblCoreIndicators.Items[i].Value));

                    //update Line Item
                    //for (int i = 0; i < TRG_Funds.MasterTableView.Items.Count; i++)
                    //{
                    //    TextBox tb = (TextBox)TRG_Funds.MasterTableView.Items[i].FindControl("txt_Funds");
                    //    if (tb != null && !tb.Text.Equals(""))
                    //    {
                    //        obj.updateFundedActivityLineItems(Convert.ToInt32(ika),
                    //                                          Convert.ToInt32(TRG_Funds.MasterTableView.Items[i].GetDataKeyValue("key_line_item_type_id")),
                    //                                          Convert.ToDecimal(tb.Text));
                    //    }
                    //}

                    scs_error_dictionary errObj = new scs_error_dictionary();

                    if (errObj.LoadByPrimaryKey("200"))
                    {
                        (FormView1.FindControl("lblMsg") as Label).Text = errObj.Txt_message;
                    }

                }
            }
            catch(Exception ex)
            {
                scs_error_dictionary errObj = new scs_error_dictionary();

                if (errObj.LoadByPrimaryKey("201"))
                {
                    (FormView1.FindControl("lblMsg") as Label).Text = errObj.Txt_message;
                }
            }
        }
    }
开发者ID:sdemdouglas,项目名称:sdecateproject,代码行数:71,代码来源:AmendmentForm2.aspx.cs

示例2: Save

    protected void Save()
    {
        lblMsg.Text = "";
        hfPageInfo.Value = "0";
        hfFlgSave.Value = "";

        try
        {
            if (Request.QueryString.Get("id").Equals("-1"))
            {
                //Add new Activity
                DataAccess obj = new DataAccess();
                //Local Plan id will be enter later, use 101 for now
                int iLpid;

                iLpid = Convert.ToInt32(Session[Session.SessionID + "PlanID"].ToString());

                String ika = obj.insertActivity(iLpid,
                                                   txtTypeEquip.Text,
                                                   txtSupProgram.Text,
                                                   101,
                                                   "",
                                                   Convert.ToInt32(DLB_Category.SelectedValue),
                                                   Convert.ToInt32(DLB_FunCode.SelectedValue),
                                                   102,
                                                   101);
                lblAid.Text = ika;
                //Insert Core Indicator
                for (int i = 0; i < cblCoreIndicators.Items.Count; i++)
                    if (cblCoreIndicators.Items[i].Selected)
                        obj.insertFundedActivityCoreIndicator(Convert.ToInt32(ika),
                                                              Convert.ToInt32(cblCoreIndicators.Items[i].Value));

                //update Line Item
                for (int i = 0; i < TRG_Funds.MasterTableView.Items.Count; i++)
                {
                    TextBox tb = (TextBox)TRG_Funds.MasterTableView.Items[i].FindControl("txt_Funds");
                    if (tb != null && !tb.Text.Equals(""))
                    {
                        obj.updateFundedActivityLineItems(Convert.ToInt32(ika),
                                                          Convert.ToInt32(TRG_Funds.MasterTableView.Items[i].GetDataKeyValue("key_line_item_type_id")),
                                                          Convert.ToDecimal(tb.Text));
                    }
                }
                InjectScript.Text = "<script>refreshPage(" + ika + ")</" + "script>";
            }
            else
            {
                //Update current activity
                DataAccess obj = new DataAccess();
                //Local Plan id will be enter later, use 101 for now
                int ika = Convert.ToInt32(Request.QueryString.Get("id").ToString());
                obj.updateActivity(ika,
                                   101,
                                   txtTypeEquip.Text,
                                   txtSupProgram.Text,
                                   0,
                                   "",
                                   Convert.ToInt32(DLB_Category.SelectedValue),
                                   Convert.ToInt32(DLB_FunCode.SelectedValue),
                                   102,
                                   txtSystemOfficeNotes.Text,
                                   Convert.ToInt32(ddStatus.SelectedValue),
                                   cbLocked.Checked,
                                   cbApproved.Checked,
                                   false,
                                   "",
                                   101);

                //Insert Core Indicator
                for (int i = 0; i < cblCoreIndicators.Items.Count; i++)
                    if (cblCoreIndicators.Items[i].Selected)
                        obj.insertFundedActivityCoreIndicator(Convert.ToInt32(ika),
                                                              Convert.ToInt32(cblCoreIndicators.Items[i].Value));

                //update Line Item
                for (int i = 0; i < TRG_Funds.MasterTableView.Items.Count; i++)
                {
                    TextBox tb = (TextBox)TRG_Funds.MasterTableView.Items[i].FindControl("txt_Funds");
                    if (tb != null && !tb.Text.Equals(""))
                    {
                        obj.updateFundedActivityLineItems(Convert.ToInt32(ika),
                                                          Convert.ToInt32(TRG_Funds.MasterTableView.Items[i].GetDataKeyValue("key_line_item_type_id")),
                                                          Convert.ToDecimal(tb.Text));
                    }
                }
            }
            scs_error_dictionary errObj = new scs_error_dictionary();

            if (errObj.LoadByPrimaryKey("200"))
            {
                lblMsg.Text = errObj.Txt_message;
            }
            TRG_Funds.DataBind();
            RadGrid1.DataBind();

        }
        catch (Exception ex)
        {
            scs_error_dictionary errObj = new scs_error_dictionary();
//.........这里部分代码省略.........
开发者ID:sdemdouglas,项目名称:sdecateproject,代码行数:101,代码来源:ActivityFormEquipment.aspx.cs

示例3: Save

    protected void Save()
    {
        if (Page.IsValid)
        {
            try
            {
                //Update current activity
                DataAccess obj = new DataAccess();
                act_activity actObj = new act_activity();
                actObj.ConnectionString = DataAccess.getConnStr();
                int ika = Convert.ToInt32(Request.QueryString.Get("keyid").ToString());

                if (actObj.LoadByPrimaryKey(ika))
                {
                    String sRet = obj.updateActivity(ika,
                                       Convert.ToInt32(Session[Session.SessionID.ToString() + "PlanID"].ToString()),
                                       (FormView1.FindControl("txtActivityName") as TextBox).Text,
                                       (FormView1.FindControl("txtDescActivity") as TextBox).Text,
                                       -1,
                                       (FormView1.FindControl("txtDescCoreInd") as TextBox).Text,
                                       -1,
                                       -1,
                                       actObj.Key_activity_type_id,
                                       (FormView1.FindControl("txtSystemOfficeNotes") as TextBox).Text,
                                       Convert.ToInt32((FormView1.FindControl("ddStatus") as DropDownList).SelectedValue),
                                       (FormView1.FindControl("cbLocked") as CheckBox).Checked,
                                       (FormView1.FindControl("cbApproved") as CheckBox).Checked,
                                       true,
                                       (FormView1.FindControl("txtAmdReductionDesc") as TextBox).Text,
                                       102);

                    String errCode;

                    if (sRet.Equals("0"))
                        errCode = "200";
                    else
                        errCode = "201";

                    scs_error_dictionary errObj = new scs_error_dictionary();

                    if (errObj.LoadByPrimaryKey(errCode))
                    {
                        (FormView1.FindControl("lblMsg") as Label).Text = errObj.Txt_message; // errObj.Txt_message;
                    }

                }
            }
            catch (Exception ex)
            {
                scs_error_dictionary errObj = new scs_error_dictionary();

                if (errObj.LoadByPrimaryKey("201"))
                {
                    (FormView1.FindControl("lblMsg") as Label).Text = errObj.Txt_message;
                }
            }
        }
    }
开发者ID:sdemdouglas,项目名称:sdecateproject,代码行数:58,代码来源:AmendmentForm.aspx.cs


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