protected void btnLuuLai_Click(object sender, EventArgs e) { try { FileCommon fileCommon = new FileCommon(); HttpFileCollection httpFileCollection = Page.Request.Files; if (httpFileCollection[0] != null && httpFileCollection[0].ContentLength > 0) { thongTinHeThong.LinkLogo = fileCommon.UploadFile("/Style/images/Uploads/Logo/", httpFileCollection[0]); } if (httpFileCollection[1] != null && httpFileCollection[1].ContentLength > 0) { thongTinHeThong.LinkBanner = fileCommon.UploadFile("/Style/images/Uploads/Banner/", httpFileCollection[1]); } thongTinHeThong.TimeZoneSystem = ddlTimeZone.SelectedValue; thongTinHeThong.Hotline = txtHotLine.Text; thongTinHeThong.LinkFacebook = txtLinkFacebook.Text; thongTinHeThong.LinkYoutube = txtLinkYoutube.Text; thongTinHeThong.LinkReddit = txtLinkReddit.Text; thongTinHeThong.LinkLinkedIn = txtLinkLinkedIn.Text; thongTinHeThong.Footer = txtFooter.Text.Replace("\n", "<br/>"); thongTinHeThong.LinkGioiThieu = txtLinkGioiThieu.Text; thongTinHeThong.GiaTriKichHoatHoaHong = float.Parse(txtGiaTriKichHoatHoaHong.Text); thongTinHeThong.TiLeChiaHoaHong = float.Parse(txtTiLeChiaHoaHong.Text); thongTinHeThongManagement.updateThongTinHeThong(thongTinHeThong); } catch (Exception ex) { HttpContext.Current.Response.Write("<script type=\"text/javascript\">alert(\"Xảy ra lỗi vui lòng thử lại.\");</script>"); } }
protected void btnCapNhat_Click(object sender, EventArgs e) { loaiTien.TenLoaiTien = txtTenLoaiTien.Text; loaiTien.MaLoaiTien = txtMaLoaiTien.Text; loaiTien.GiaMua = float.Parse(txtGiaMua.Text); loaiTien.GiaBan = float.Parse(txtGiaBan.Text); loaiTien.TrangThai = ddlTrangThai.SelectedValue; loaiTien.AutoLoad = ddlAutoLoad.SelectedValue; loaiTien.ThuTu = int.Parse(txtThuTu.Text); loaiTien.HanMuc = float.Parse(txtHanMuc.Text); loaiTien.ThongBaoHetHanMuc = txtThongBaoHetHanMuc.Text; //upanh FileCommon fileCommon = new FileCommon(); HttpFileCollection httpFileCollection = Page.Request.Files; if (httpFileCollection[0] != null && httpFileCollection[0].ContentLength > 0) { loaiTien.LinkIcon = fileCommon.UploadFile("/Style/images/Uploads/Money/", httpFileCollection[0]); } if (chkHienThiBox.Checked == true) { loaiTien.ThuTuHienThiBox = int.Parse(txtThuTuHienThiBox.Text); } else { loaiTien.ThuTuHienThiBox = -1; } loaiTien.MaLoaiTien = txtMaLoaiTien.Text; if (txtPhuPhiBan.Text == "") { loaiTien.PhuPhiBan = 0; } else { loaiTien.PhuPhiBan = float.Parse(txtPhuPhiBan.Text); } if (txtPhuPhiMua.Text == "") { loaiTien.PhuPhiMua = 0; } else { loaiTien.PhuPhiMua = float.Parse(txtPhuPhiMua.Text); } loaiTienManagement.updateLoaiTien(loaiTien); Response.Redirect("/Views/Backend/QuanTri/QuanLyLoaiTien/DanhSachLoaiTien.aspx"); }