Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("CKSJ");
            strPageUserType.Add("mana");
            strPageUserType.Add("teacher");

            try
            {
                if (!Page.IsPostBack)
                {
                    #region get key

                    int key = 0;

                    if (Request.QueryString["key"] != null)
                    {
                        key = int.Parse(Request.QueryString["key"]);
                    }

                    #endregion

                    LabMS.BLL.ResearchCost bll = new LabMS.BLL.ResearchCost();
                    LabMS.Model.ResearchCost rc;

                    rc = bll.GetModel(key);

                    if (rc == null)
                    {
                        throw new Exception("�Բ���,�������Ѿ���ɾ��!");
                    }

                    lblChongJingZiHao.Text = rc.ChongJingZiHao;
                    lblDanWeiMingCheng.Text = rc.DanWeiMingCheng;
                    lblFuZeRen.Text = rc.FuZeRen;
                    lblGuangLiFei.Text = rc.GuangLiFei;
                    lblGuangLiFeiBiLi.Text = rc.GuangLiFeiBiLi;
                    lblHuiChuYinHang.Text = rc.HuiChuYinHang;
                    lblID.Text = rc.ID;
                    lblJingBanRen.Text = rc.JingBanRen;
                    lblRuanJianJingFei.Text = rc.RuanJianJingFei;
                    lblShiDaoJingFei.Text = rc.ShiDaoJingFei;
                    lblShiDaoShiJian.Text = rc.ShiDaoShiJian;
                    lblXiangMuLieBie.Text = rc.XiangMuLieBie;
                    lblXiangMuMingCheng.Text = rc.XiangMuMingCheng;
                }
            }
            catch
            {

            }
        }
Ejemplo n.º 2
0
        protected void BtnDelete_Click(object sender, EventArgs e)
        {
            CheckBox cb;
            int key;
            LabMS.BLL.ResearchCost bll = new LabMS.BLL.ResearchCost();

            for (int i = GridViewCostList.Rows.Count - 1; i > -1; i--)
            {
                cb = (CheckBox)GridViewCostList.Rows[i].FindControl("CBSelect");

                if (cb.Checked)
                {
                    key = int.Parse(GridViewCostList.DataKeys[i].Value.ToString());

                    bll.Delete(key);
                }
            }

            BindData();

            WriteBackScript("alert('�ѳɹ�ɾ���������')");
        }