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


C# DataAccess.insertLocalPlan方法代码示例

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


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

示例1: btnCreatePlan_Click

    protected void btnCreatePlan_Click(object sender, EventArgs e)
    {
        if (cbLocked.Checked == true)
        {
            if (Convert.ToDecimal(txtAppropiation.Text) > 0)
            {
                DataAccess obj = new DataAccess();
                String insRes = obj.insertLocalPlan(Convert.ToInt32(ddCollege.SelectedValue),
                                                    Convert.ToInt32(ddFiscalYear.SelectedValue),
                                                    Convert.ToDecimal(txtAppropiation.Text),
                                                    cbLocked.Checked,
                                                     HttpContext.Current.User.Identity.Name.ToString());
                int ilp_id;
                try
                {
                    ilp_id = Convert.ToInt32(insRes);
                    if (ilp_id < 0)
                    {
                        if (insRes.Trim() == "-1")
                        {
                            lblMsg.Text = "Error: Narratives have not been Set, Local Plan not saved";
                        }
                        else
                        {
                        lblMsg.Text = insRes.ToString();
                        }
                    }
                    else
                    {
                        lblMsg.ForeColor = Color.Green;
                        lblMsg.Text = "Create Successful!";

                        txtAppropiation.Enabled = false;
                        cbLocked.Enabled = false;

                        btnSave.Visible = false;
                        btnCreatePlan.Visible = false;
                        lblLocalPlan.Text = insRes;

                        scs_local_plan_level lplObj = new scs_local_plan_level();

                        if (lplObj.LoadByPrimaryKey(ilp_id))
                        {
                            lblStatus.Text = lplObj.Txt_local_plan_level_status;
                            lblLevel.Text = lplObj.Txt_local_plan_level_status_desc;
                        }
                    }
                }
                catch
                {
                    if (insRes.Trim() == "-1")
                    {
                        lblMsg.Text = "Error: Narratives have not been Set, Local Plan not saved";
                    }
                    else
                    {
                        lblMsg.Text = insRes.ToString();
                    }

                }
            }
            else
            {
                lblMsg.ForeColor = Color.Red;
                lblMsg.Text = "Invalid input, Yearly Appropiation has to be greater than 0 in order to lock local plan";
            }
        }
        else
        {
            DataAccess obj = new DataAccess();
            String insRes = obj.insertLocalPlan(Convert.ToInt32(ddCollege.SelectedValue),
                                                Convert.ToInt32(ddFiscalYear.SelectedValue),
                                                Convert.ToDecimal(txtAppropiation.Text),
                                                cbLocked.Checked,
                                                HttpContext.Current.User.Identity.Name.ToString());
            int ilp_id;
            try
            {
                ilp_id = Convert.ToInt32(insRes);
                if (ilp_id < 0)
                {
                    if (insRes.Trim() == "-1")
                    {
                        lblMsg.Text = "Error: Narratives have not been Set, Local Plan not saved";
                    }
                    else
                    {
                        lblMsg.Text = insRes.ToString();
                    }
                }
                else
                {
                    lblMsg.ForeColor = Color.Green;
                    lblMsg.Text = "Create Successful!";
                    btnSave.Visible = true;
                    btnCreatePlan.Visible = false;
                    lblLocalPlan.Text = insRes;

                    scs_local_plan_level lplObj = new scs_local_plan_level();

//.........这里部分代码省略.........
开发者ID:sdemdouglas,项目名称:sdecateproject,代码行数:101,代码来源:LocalPlanSetup.aspx.cs


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