Esempio n. 1
0
        protected void btnLuu_Click(object sender, EventArgs e)
        {
            string maphieu     = Session["maphieu"].ToString();
            string macongty    = Session["congty"].ToString();
            string ngonngu     = Session["languege"].ToString();
            string manguoidung = Session["user"].ToString();

            DateTime date     = DateTime.Now;
            string   ngaydich = DateTime.Parse(date.ToShortDateString()).ToString("dd/MM/yyyy");
            //pdna phieu = pnaDAO.LayVanBanChuaDichTheoNguoiDich(maphieu, macongty, manguoidung);
            //pdna phieudich = new pdna();
            //phieudich.pdno = maphieu;
            //phieudich.CFMDate2 = DateTime.Parse(ngaydich);
            //phieudich.GSBH = macongty;

            //phieudich.NoiDungDich = CKEditorControl1.Text;
            //phieudich.trangthaidich = true;
            //phieudich.IdnguoiDich = manguoidung;
            int Yn = 4;

            //db.CapNhatPhieuDich(phieudich.pdno, phieudich.GSBH, phieudich.NoiDungDich, phieudich.CFMDate2,txtTieuDe.Text, phieudich.IdnguoiDich, phieudich.trangthaidich);

            dal.CapNhatPhieuDichPhieuCoYKien(manguoidung, macongty, maphieu, txtTieuDe.Text, CKEditorControl1.Text, date, Yn);
            dalAbcon.CapNhatTrangThaiCuaPhieuCoYKien(maphieu, macongty, Yn, txtNguoiDUyet.Text.Trim());
            db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IdnguoiDich='" + manguoidung + "'"));
            var list = db.ExecuteQuery <pdna>("select * from pdna where pdno='" + maphieu + "'and GSBH='" + macongty + "' and IdnguoiDich='" + manguoidung + "'");

            foreach (pdna phieu1 in list)
            //pdna phieu1 = pnaDAO.LayVanBanDaDichTheoNguoiDich(maphieu, macongty, manguoidung);
            {
                if (phieu1.trangthaidich == true)
                {
                    if (ngonngu == "lbl_VN")
                    {
                        lbThongBao.Text = "Lưu thành công";
                    }
                    else if (ngonngu == "lbl_TW")
                    {
                        lbThongBao.Text = "存档成功";
                    }
                    else if (ngonngu == "lbl_EN")
                    {
                        lbThongBao.Text = "Save Success.";
                    }
                    btnLuu.Enabled = false;
                    Response.Redirect("frmChiTietDichND.aspx");
                }
            }
        }