Beispiel #1
0
        protected void btnCapNhat_Click(object sender, EventArgs e)
        {
            DM_DVQLYService dm_dviSer  = new DM_DVQLYService();
            SYS_Session     session    = (SYS_Session)Session["SYS_Session"];
            string          strTenFile = fileUp.FileName;

            UploadFile();

            if (Session["Add"] + "" == "0")
            {
                var qtCT = (DataRowView)grdDVT.GetRow(grdDVT.FocusedRowIndex);

                //CBDN.DM_LoaiDay cn = db.DM_LoaiDays.SingleOrDefault(x => x.ID == qtCT.ID);
                if (!CheckName(txtMaTram.Text))
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Mã trạm đã trùng');", true); return;
                }

                db.UPDATE_TTTT_QUANLYCAD_MATRAM(session.User.ma_dviqlyDN, txtMaTram.Text, strTenFile);
            }
            else
            {
                if (!CheckName(txtMaTram.Text))
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Mã trạm đã trùng');", true); return;
                }


                db.INSERT_TTTT_QUANLYCAD(session.User.ma_dviqlyDN, txtMaTram.Text, strTenFile);
            }
            pcAddRoles.ShowOnPageLoad = false;
            _DataBind();
        }