protected void Button1_Click(object sender, EventArgs e) { string id = Session["id"].ToString(); string macongty = DropCty.SelectedValue.ToString(); DateTime tungay = DateTime.Parse(txtTuNgay.Text.ToString()); DateTime denngay = DateTime.Parse(txtDenNgay.Text.ToString()); string ngonngu = Session["languege"].ToString(); string manguoiduyet = txtNguoiDuyet.Text; string manguoiduocuyquyen = txtNguoiDuocUyQuyen.Text; int khivang = int.Parse(DropDownVangMat.SelectedValue.ToString()); ABJobAgent nghiphep = new ABJobAgent(); nghiphep.GSBH = macongty; nghiphep.ID = int.Parse(id); nghiphep.TuNgay = tungay; nghiphep.DenNgay = denngay; if (txtNguoiDuyet.Text.Trim() == "" && txtNguoiDuocUyQuyen.Text.Trim() == "") { return; } else { Busers2 nguoiuyquyen = UserDAO.TimNhanVienTheoMa(manguoiduyet, macongty); Busers2 nguoithaythe = UserDAO.TimNhanVienTheoMa(manguoiduocuyquyen, macongty); if (nguoiuyquyen == null && nguoithaythe == null) { if (ngonngu == "lbl_VN") { lblThongBao.Text = "Mã người Ủy Quyền hoặc Mã Người Thay Thế không có trong hệ thống"; } else if (ngonngu == "lbl_TW") { lblThongBao.Text = "系统没有这个委托人编号或者代理人编号"; } else if (ngonngu == "lbl_EN") { lblThongBao.Text = "Mã người Ủy Quyền hoặc Mã Người Thay Thế không có trong hệ thống"; } } else { nghiphep.IDNguoiDuyet = manguoiduyet; nghiphep.IDNguoiDuocUyQuyen = manguoiduocuyquyen; nghiphep.tennguoiuyquyen = nguoiuyquyen.USERNAME; nghiphep.tennguoithaythe = nguoithaythe.USERNAME; } } nghiphep.ThongQua = khivang; StatusCode thong = KhiVangMatDAO.TimMaThongQua(khivang); nghiphep.TenThongQua = thong.NameTaiwan; NghiPhepDAO.SuaDuLieu(nghiphep); Response.Redirect("frmNghiPhep.aspx"); }
private void HienThiDropDown() { string ngonngu = Session["languege"].ToString(); DropDownVangMat.DataSource = KhiVangMatDAO.Qry(); DropDownVangMat.DataValueField = "ID"; //DropDownVangMat.DataTextField = "NameVietNam"; if (ngonngu == "lbl_VN") { DropDownVangMat.DataTextField = "NameVietNam"; } else if (ngonngu == "lbl_TW") { DropDownVangMat.DataTextField = "NameTaiwan"; } else if (ngonngu == "lbl_EN") { DropDownVangMat.DataTextField = "NameEnglish"; } DropDownVangMat.DataBind(); }