示例#1
0
        private DataTable returnDt()
        {
            DataTable dt = new DataTable();

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");
            var lst       = db.BC_GiaoNhan2Chieu_ChiTiet(ma_dviqly, int.Parse("0" + cmbThang.Value), int.Parse("0" + cmbNam.Value));

            if (!dt.Columns.Contains("DiemDo"))
            {
                dt.Columns.Add("DiemDo");
                dt.Columns.Add("ThongSo");
                dt.Columns.Add("CongTo");
                dt.Columns.Add("HeSo");
                dt.Columns.Add("Bieu");
                dt.Columns.Add("Giao_Dau");
                dt.Columns.Add("Giao_Cuoi");
                dt.Columns.Add("Nhan_Dau");
                dt.Columns.Add("Nhan_Cuoi");


                dt.Columns.Add("Giao_SL");
                dt.Columns.Add("Giao_Cos");
                dt.Columns.Add("Nhan_SL");
                dt.Columns.Add("Nhan_Cos");
            }

            return(dt);
        }
示例#2
0
        private void _DataBind()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            DataTable          dt      = db.Get_SLKhang(session.User.ma_dviqlyDN, Request["MA_KHANG"], int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""));

            if (dt.Rows.Count > 0)
            {
                lbMaKH.Text   = Request["MA_KHANG"] + "";
                lbTenKH.Text  = dt.Rows[0]["TENKHACHHANG"] + "";
                lbTram.Text   = Request["MA_TRAM"] + "";
                lbDiaChi.Text = dt.Rows[0]["DIACHI"] + "";
            }
            else
            {
                lbMaKH.Text = Request["MA_KHANG"] + "";
                var       makhachang = Request["MA_KHANG"] + "";
                DataTable dsa        = db.SELECT_TTTT_KHACHHANG_LUUY_INFO(session.User.ma_dviqlyDN, makhachang);
                lbTenKH.Text  = dsa.Rows[0]["TEN_KHANG"] + "";
                lbTram.Text   = Request["MA_TRAM"] + "";
                lbDiaChi.Text = dsa.Rows[0]["DIACHI"] + "";
            }

            grdDVT.DataSource = dt;
            grdDVT.DataBind();
        }
示例#3
0
        private void LoadDataDV()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int a = int.Parse(session.User.ma_dviqly + "");

            if (MaDienLuc.Value + "" != "")
            {
                if (a > 38)
                {
                    DM_DVQLYService dm_dviSer = new DM_DVQLYService();
                    var             donvi     = dm_dviSer.SelectDM_DVQLY(a);
                    List <DM_DS>    List      = new List <DM_DS>();
                    DM_DS           Dvi       = new DM_DS();

                    Dvi.MA_DVIQLY   = session.User.ma_dviqlyDN + "";
                    Dvi.NAME_DVIQLY = donvi.NAME_DVIQLY.Split('-')[1].ToString().ToUpper();;
                    List.Add(Dvi);

                    cmMaDvi.DataSource = List;
                    cmMaDvi.TextField  = "NAME_DVIQLY";
                    cmMaDvi.ValueField = "MA_DVIQLY";
                    cmMaDvi.DataBind();
                }
                else
                {
                    DM_DVQLYService dm_dviSer = new DM_DVQLYService();
                    //  DataTable lst_dmdv = new DataTable();
                    var lst_dmdv = dm_dviSer.SelectAll_DVI_ByChild(int.Parse(MaDienLuc.Value + ""));
                    cmMaDvi.DataSource = lst_dmdv;
                    cmMaDvi.ValueField = "MA_DVIQLY";
                    cmMaDvi.TextField  = "NAME_DVIQLY";
                    cmMaDvi.DataBind();
                }
            }
        }
示例#4
0
        private void InTongHopDienNang()
        {
            if (cmbPhuongThuc.Value == null)
            {
                return;
            }

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int             ma_dviqly  = int.Parse(session.User.ma_dviqly);
            DM_DVQLYService dm_dviSer  = new DM_DVQLYService();
            var             donvi      = dm_dviSer.SelectDM_DVQLY(ma_dviqly);

            //  if (Request["XacNhan"] + "" == "1") kiemtra = true;
            string strGiao, strNhan; string strGDNhan = "", strGDGiao = "";

            if (cmbPhuongThuc.Value + "" != "0")
            {
                var           cn = db.DM_ChiNhanhs.SingleOrDefault(x => x.ID == int.Parse(cmbPhuongThuc.Value + ""));
                CBDN.DM_DVQLY giao, nhan;
                if (cn.IDMADVIQLY.Contains(",2,"))
                {
                    giao = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == 2);
                    nhan = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == int.Parse(cn.IDMADVIQLY.Replace(",2,", "").Replace(",", "")));
                }
                else
                {
                    giao = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == cn.DiemDauNguon);
                    nhan = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == cn.DiemCuoiNguon);
                }
                strGiao = giao.TEN_DVIQLY;
                strNhan = nhan.TEN_DVIQLY;


                var imGDGiao = db.HD_ThongTinKies.SingleOrDefault(x => x.IDMaDViQLy == cn.DiemDauNguon && x.IDChinhNhanh == int.Parse(cmbPhuongThuc.Value + "") && x.Thang == int.Parse(cmbThang.Value + "") && x.Nam == int.Parse(cmbNam.Value + "") && x.ChucVu == 3);
                var imGDNhan = db.HD_ThongTinKies.SingleOrDefault(x => x.IDMaDViQLy == cn.DiemCuoiNguon && x.IDChinhNhanh == int.Parse(cmbPhuongThuc.Value + "") && x.Thang == int.Parse(cmbThang.Value + "") && x.Nam == int.Parse(cmbNam.Value + "") && x.ChucVu == 3);

                if (imGDGiao != null)
                {
                    var ngGiao = db.DM_USERs.SingleOrDefault(x => x.IDUSER == imGDGiao.NguoiTao);
                    strGDGiao = ngGiao.HOTEN + "</br> Thời gian xác nhận: " + imGDGiao.NgayTao;
                }
                if (imGDNhan != null)
                {
                    var ngNhan = db.DM_USERs.SingleOrDefault(x => x.IDUSER == imGDNhan.NguoiTao);
                    strGDNhan = ngNhan.HOTEN + "</br> Thời gian xác nhận: " + imGDNhan.NgayTao;
                }
            }
            else
            {
                strGiao = "TỔNG CÔNG TY ĐIỆN LỰC MIỀM BẮC";
                strNhan = donvi.TEN_DVIQLY;
            }


            MTCSYT.Report.InBieuTong report = new MTCSYT.Report.InBieuTong(int.Parse(cmbPhuongThuc.Value + ""), ma_dviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), "", "", donvi.TEN_DVIQLY, strGiao, strNhan, 0, "", "", strGDNhan, strGDGiao);

            ReportViewer1.Report = report;

            ReportToolbar1.ReportViewer = ReportViewer1;
        }
示例#5
0
        public DataTable GetData()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int       ma_dviqly        = int.Parse(session.User.ma_dviqly + "");
            string    makhachang       = Request["MA_KHANG"] + "";
            DataTable dt    = db.Get_SLKhang(session.User.ma_dviqlyDN, makhachang, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""));
            DataTable table = new DataTable();

            table.Columns.AddRange(new DataColumn[] {
                new DataColumn("Region", typeof(string)),
                new DataColumn("Sales", typeof(decimal))
            });
            foreach (DataRow row in dt.Rows)
            {
                var SANLUONGTHANG = row["SANLUONGTHANG"];
                table.Rows.Add("Sản lượng tháng", SANLUONGTHANG);
                var SLUONG_1 = row["SLUONG_1"];
                table.Rows.Add("Sản lượng tháng trước", SLUONG_1);
                var SLUONG_2 = row["SLUONG_2"];
                table.Rows.Add("Sản lượng 2 tháng trước", SLUONG_2);
                var SLUONG_3 = row["SLUONG_3"];
                table.Rows.Add("Sản lượng 3 tháng trước", SLUONG_3);
                var SANLUONGCUNGKY = row["SANLUONGCUNGKY"];
                table.Rows.Add("Sản lượng cùng kỳ năm trước", SANLUONGCUNGKY);
            }

            return(table);
        }
示例#6
0
        private void LoadGrdNhan()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int strMadviqly            = int.Parse(session.User.ma_dviqly);

            //List<CBDN.db_DSDiemNhanNVXacNhanResult> lstNhan = new List<CBDN.db_DSDiemNhanNVXacNhanResult>();
            System.Data.Linq.ISingleResult <CBDN.db_DSDiemNhanNVXacNhanResult> lstNhan = null;
            System.Data.Linq.ISingleResult <CBDN.db_DSDiemGiaoNVXacNhanResult> lstGiao = null;
            if (cmbPhuongThuc.Value != null)
            {
                lstNhan = db.db_DSDiemNhanNVXacNhan(strMadviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), int.Parse(cmbPhuongThuc.Value + ""));
                lstGiao = db.db_DSDiemGiaoNVXacNhan(strMadviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), int.Parse(cmbPhuongThuc.Value + ""));
            }
            else
            {
                lstNhan = db.db_DSDiemNhanNVXacNhan(strMadviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), 0);
                lstGiao = db.db_DSDiemGiaoNVXacNhan(strMadviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), 0);
            }
            grdNhan.DataSource = lstNhan;
            grdNhan.DataBind();

            grdGiao.DataSource = lstGiao;
            grdGiao.DataBind();

            grdSanLuonghan.DataSource = lstNhan;
            grdSanLuonghan.DataBind();

            grdSLGiao.DataSource = lstGiao;
            grdSLGiao.DataBind();
        }
示例#7
0
        private void xacnhanky()
        {
            MTCSYT.SYS_Session session     = (MTCSYT.SYS_Session)Session["SYS_Session"];
            string             strMadviqly = session.User.ma_dviqly;

            var dv = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == int.Parse(strMadviqly));
            var ky = db.HD_ThongTinKies.SingleOrDefault(x => x.IDChinhNhanh == int.Parse(cmbPhuongThuc.Value + "") && x.Nam == int.Parse(cmbNam.Value + "") && x.Thang == int.Parse(cmbThang.Value + "") && x.IDMaDViQLy == int.Parse(strMadviqly) && x.ChucVu == 2 && x.TrangThai == null);

            if (ky != null)
            {
                return;
            }
            CBDN.HD_ThongTinKy hDKyTH = new CBDN.HD_ThongTinKy();
            hDKyTH.IDChinhNhanh = int.Parse(cmbPhuongThuc.Value + "");
            hDKyTH.NgayTao      = DateTime.Now;
            hDKyTH.NguoiTao     = session.User.IDUSER;

            hDKyTH.Link       = "";
            hDKyTH.Barcode    = "";
            hDKyTH.Thang      = int.Parse(cmbThang.Value + "");
            hDKyTH.Nam        = int.Parse(cmbNam.Value + "");
            hDKyTH.IDMaDViQLy = int.Parse(strMadviqly);
            //TruongPhong
            hDKyTH.ChucVu = 2;
            db.HD_ThongTinKies.InsertOnSubmit(hDKyTH);
            db.SubmitChanges();
        }
示例#8
0
        private void loadDanhMuc()
        {
            DM_DVQLYService dm_dviSer = new DM_DVQLYService();
            DataTable       lst_dmdv  = new DataTable();

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");
            var donvi     = dm_dviSer.SelectDM_DVQLY(ma_dviqly);

            if (donvi.ParentId == 0 || donvi.ParentId == 61)
            {
                lst_dmdv = dm_dviSer.SelectAll_DVI_ByChild(ma_dviqly);
                cmbMaDonVi.DataSource = lst_dmdv;
                cmbMaDonVi.ValueField = "IDMA_DVIQLY";
                cmbMaDonVi.TextField  = "NAME_DVIQLY";
                cmbMaDonVi.DataBind();
            }
            else
            {
                List <Entity.DM_DVQLY> lst = new List <DM_DVQLY>();
                lst.Add(donvi);
                cmbMaDonVi.DataSource = lst;
                cmbMaDonVi.ValueField = "IDMA_DVIQLY";
                cmbMaDonVi.TextField  = "NAME_DVIQLY";
                cmbMaDonVi.DataBind();
            }
        }
示例#9
0
        private void InTongHopKHDAThap()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int             ma_dviqly  = int.Parse(session.User.ma_dviqly);
            DM_DVQLYService dm_dviSer  = new DM_DVQLYService();
            var             donvi      = dm_dviSer.SelectDM_DVQLY(ma_dviqly);
            var             lst        = db.TT_KhachHangDAThapTrongThang(int.Parse(session.User.ma_dviqly + ""), int.Parse("" + Request["Thang"]), int.Parse("" + Request["Nam"])).ToList();
            DataTable       dt         = new DataTable();

            dt.Columns.Add("STT");
            dt.Columns.Add("TenDonVi");
            dt.Columns.Add("SOKH");
            dt.Columns.Add("KH160", typeof(decimal));
            dt.Columns.Add("KH180", typeof(decimal));
            dt.Columns.Add("KH200", typeof(decimal));
            dt.Columns.Add("GiaiPhap");
            dt.Columns.Add("TienDo");

            int stt = 1;

            foreach (var chitiet in lst)
            {
                dt.Rows.Add(stt, chitiet.TEN_DVIQLY, chitiet.SoTBA, chitiet.KH160, chitiet.KH180, chitiet.KH200, chitiet.GiaiPhap, chitiet.TienDoThucHien);
                stt++;
            }

            MTCSYT.Report.KHDAThap report = new MTCSYT.Report.KHDAThap(dt, "" + Request["Thang"], "" + Request["Nam"], donvi.TEN_DVIQLY);

            ReportViewer1.Report = report;

            ReportToolbar1.ReportViewer = ReportViewer1;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            #region PhanQuyen
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            if (session == null || session.User.USERNAME == "Guest")
            {
                Response.Redirect("~\\Login.aspx");
            }
            else
            {
                //if (Request.Cookies["IDUSER"].Value != "1")
                //{
                //    List<SYS_Right> right = session.User.Rights;
                //    foreach (SYS_Right sysRight in right)
                //    {
                //        if (sysRight.FuncId == funcid)
                //        {
                //            rightOfUser = sysRight;
                //            Session["Right"] = sysRight;
                //            Session["UserId"] = session.User.IDUSER;
                //            Session["FunctionId"] = sysRight.FuncId;
                //            break;
                //        }
                //    }

                //    if (rightOfUser == null)
                //    {
                //        Session["Status"] = "0";
                //        Response.Redirect("~\\HeThong\\Default.aspx");

                //    }
                //}
            }
            Session["SYS_Session"] = session;
            #endregion

            if (!IsPostBack)
            {
                if (DateTime.Now.Month == 1)
                {
                    cmbThang.Value = 11;
                    cmbNam.Value   = DateTime.Now.Year - 1;
                }
                else if (DateTime.Now.Month == 2)
                {
                    cmbThang.Value = 12;
                    cmbNam.Value   = DateTime.Now.Year - 1;
                }
                else
                {
                    cmbThang.Value = DateTime.Now.Month - 2;
                    cmbNam.Value   = DateTime.Now.Year;
                }
            }
            loadDanhMuc();
            if (!IsPostBack)
            {
                _DataBind();
            }
        }
示例#11
0
        private void loadDanhMuc()
        {
            DM_DVQLYService dm_dviSer = new DM_DVQLYService();

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            var lstDD = db.DM_DiemDos.Where(x => x.IDMaDViQly == ma_dviqly).ToList();

            cmbDiemDo.DataSource = lstDD;
            cmbDiemDo.ValueField = "IDDiemDo";
            cmbDiemDo.TextField  = "TenDiemDo";
            cmbDiemDo.DataBind();

            //  var lstLo = db.DM_Los.Where(x => x.IDMaDViQly == ma_dviqly).ToList();


            var lstDMTinhChat = db.DM_TinhChatKenhs.ToList();

            cmbTinhChatGiao.DataSource = lstDMTinhChat;
            cmbTinhChatGiao.ValueField = "ID";
            cmbTinhChatGiao.TextField  = "TinhChat";
            cmbTinhChatGiao.DataBind();

            cmbTinhChatNhan.DataSource = lstDMTinhChat;
            cmbTinhChatNhan.ValueField = "ID";
            cmbTinhChatNhan.TextField  = "TinhChat";
            cmbTinhChatNhan.DataBind();
        }
示例#12
0
        protected void btnDuyet_Click(object sender, EventArgs e)
        {
            try
            {
                MTCSYT.SYS_Session session     = (MTCSYT.SYS_Session)Session["SYS_Session"];
                string             strMadviqly = session.User.ma_dviqly;


                if (grdNhan.Selection.Count == 0)
                {
                    return;
                }
                List <Object> keyvalues = grdNhan.GetSelectedFieldValues("ID");
                // List<Object> temp = new List<Object>();


                foreach (object key in keyvalues)
                {
                    var bd_chitiet = db.HD_GiaoNhanThangs.SingleOrDefault(x => x.ID == int.Parse(key + ""));
                    bd_chitiet.ISNhanVien      = true;
                    bd_chitiet.IDUseNhanVienXN = session.User.IDUSER;
                    bd_chitiet.DateNhanVienXN  = DateTime.Now;
                    db.SubmitChanges();
                }

                LoadGrdNhan();
                //pcAddRoles.ShowOnPageLoad = false;
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Lỗi duyệt chấm nợ " + ex.Message + "');", true);
            }
        }
示例#13
0
        protected void btnHuy_Click(object sender, EventArgs e)
        {
            MTCSYT.SYS_Session session     = (MTCSYT.SYS_Session)Session["SYS_Session"];
            string             strMadviqly = session.User.ma_dviqly;

            if (grdNhan.Selection.Count == 0)
            {
                return;
            }
            List <Object> keyvalues = grdNhan.GetSelectedFieldValues("IDCongTo");


            foreach (object key in keyvalues)
            {
                var bd_chitiet = db.HD_GiaoNhanThangs.Where(x => x.IDCongTo == key + "");
                foreach (var item in bd_chitiet)
                {
                    item.XacNhanDVNhan     = false;
                    item.ISChot            = false;
                    item.IDXacNhanNhan     = int.Parse(strMadviqly);
                    item.NgayXacNhanDVNhan = DateTime.Now;
                    db.SubmitChanges();
                }
            }
            LoadGrdNhan();
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            if (session == null || session.User.USERNAME == "Guest")
            {
                session.CurrentPage = Request.AppRelativeCurrentExecutionFilePath;
                Response.Redirect("~\\Login.aspx");
            }
            else
            {
                List <SYS_Right> right = session.User.Rights;
                foreach (SYS_Right sysRight in right)
                {
                    if (sysRight.FuncId == funcid)
                    {
                        rightOfUser           = sysRight;
                        Session["Right"]      = sysRight;
                        Session["UserId"]     = session.User.IDUSER;
                        Session["FunctionId"] = sysRight.FuncId;
                        break;
                    }
                }

                if (rightOfUser == null)
                {
                    Session["Status"] = "0";
                    Response.Redirect("~\\HeThong\\Default.aspx");
                }
            }
            Session["SYS_Session"] = session;
            _DataBind();
        }
示例#15
0
        private void loadDanhMuc()
        {
            if (cmbDonVi.Value == null)
            {
                return;
            }
            DM_DVQLYService dm_dviSer = new DM_DVQLYService();

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            //grdDVT.DataSource = db.BC_TonThat110ChiTiet(int.Parse(cmbDonVi.Value+""), int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), cmbCapDienAp.Value + "");
            grdDVT.DataSource = db.BC_TonThat_ChiTietCDA(int.Parse(cmbDonVi.Value + ""), int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), cmbCapDienAp.Value + "");
            grdDVT.DataBind();

            //var listTong = db.BC_TonThat110(int.Parse(cmbDonVi.Value + ""), int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), cmbCapDienAp.Value + "");
            var listTong = db.BC_TonThatCDA(int.Parse(cmbDonVi.Value + ""), int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), cmbCapDienAp.Value + "");

            grdBieuTong.DataSource = listTong;
            grdBieuTong.DataBind();

            grdTonHao.DataSource = listTong;
            grdTonHao.DataBind();

            grdTonThat.DataSource = listTong;
            grdTonThat.DataBind();
        }
示例#16
0
        private bool LoadGrdNhan()
        {
            if (cmbPhuongThuc.Value == null)
            {
                return(false);
            }
            bool kiemtra = false;

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int strMadviqly            = int.Parse(session.User.ma_dviqly);
            var lstGiao = db.db_DSDiemNhanCanXacNhan(strMadviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), int.Parse(cmbPhuongThuc.Value + "")).ToList();

            if (lstGiao.Count > 0)
            {
                kiemtra = true;
            }
            else
            {
                kiemtra = false;
            }
            grdNhan.DataSource = lstGiao;
            grdNhan.DataBind();

            grdSLNhan.DataSource = lstGiao;
            grdSLNhan.DataBind();
            return(kiemtra);
        }
示例#17
0
        private void loadGiaoNhan()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            var lstDD = db.db_SelectPhuongThucCanXN(int.Parse(session.User.ma_dviqly + ""), int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), "NVXacNhan").ToList();

            if (int.Parse(session.User.ma_dviqly + "") == 2)
            {
                List <Phuongthuc> dsT = new List <Phuongthuc>();
                foreach (var list in lstDD)
                {
                    var a = db.HD_GiamDocXNGiaoNhans.Where(x => x.IDChiNhanh == list.IDChiNhanh + "").Where(x => x.Thang == int.Parse(cmbThang.Value + "")).Where(x => x.Nam == int.Parse(cmbNam.Value + "")).Where(x => x.TrangThai == null).ToList();
                    var b = db.HD_ThongTinKies.Where(x => x.IDChinhNhanh == int.Parse(list.IDChiNhanh + "")).Where(x => x.Thang == int.Parse(cmbThang.Value + "")).Where(x => x.Nam == int.Parse(cmbNam.Value + "")).Where(x => x.ChucVu == 3).Where(x => x.TrangThai == null).ToList();
                    if (a.Count != 0 || b.Count != 0)
                    {
                        Phuongthuc ds = new Phuongthuc();
                        ds.IDChiNhanh    = list.IDChiNhanh + "";
                        ds.TenPhuongThuc = list.TenPhuongThuc + "";
                        dsT.Add(ds);
                    }
                }

                cmbPhuongThuc.DataSource = dsT;
                cmbPhuongThuc.ValueField = "IDChiNhanh";
                cmbPhuongThuc.TextField  = "TenPhuongThuc";
                cmbPhuongThuc.DataBind();
            }
            else
            {
                cmbPhuongThuc.DataSource = lstDD;
                cmbPhuongThuc.ValueField = "IDChiNhanh";
                cmbPhuongThuc.TextField  = "TenPhuongThuc";
                cmbPhuongThuc.DataBind();
            }
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            if (session == null || session.User.USERNAME == "Guest")
            {
                Response.Redirect("~\\Login.aspx");
            }
            else
            {
            }
            Session["SYS_Session"] = session;
            if (!IsPostBack)
            {
                laodDVCapCha();
                loadDSNgay();
                LoadTyLeTT();
                TyLEBT();
                LoadDataDV();
                _DataBind();
            }


            LoadDataDV();
            _DataBind();
            InBienBanTonThat();
        }
示例#19
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
     session.User.USERNAME    = txtUserName.Text;
     session.User.HOTEN       = txtHoTen.Text;
     session.User.DIACHI      = txtDiaChi.Text;
     session.User.SODT        = txtSoDT.Text;
     session.User.PASSWORD    = session.User.PASSWORD;
     session.User.XACNHAN     = session.User.XACNHAN;
     session.User.IDMA_DVIQLY = session.User.IDMA_DVIQLY;
     session.User.NGAYSINH    = session.User.NGAYSINH;
     session.User.CHUCDANH    = txtChucDanh.Text;
     if (IsValidEmailAddress(txtEmail.Text))
     {
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Cập nhật thành công.');", true);
         session.User.EMAIL = txtEmail.Text;
         _userService.UpdateDM_USER(session.User);
     }
     else
     {
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Email của bạn không đúng định dạng.Vui lòng nhập lại!');", true);
         txtEmail.Focus();
         return;
     }
     Session["SYS_Session"] = session;
     //WriteLog("Cập nhật thông tin cá nhân", Action.Update);
 }
示例#20
0
        private void _DataBind()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];

            grdDVT.DataSource = db.DM_TramSelectByIDDVi(session.User.ma_dviqly + "").ToList();
            grdDVT.DataBind();
        }
示例#21
0
        private void _DataBidCongTo()
        {
            if (grdDiemDo.FocusedRowIndex < 0)
            {
                return;
            }
            int index = grdDiemDo.FocusedRowIndex;

            CBDN.DM_DiemDoSelectByIDDViResult diemdo = (CBDN.DM_DiemDoSelectByIDDViResult)grdDiemDo.GetRow(grdDiemDo.FocusedRowIndex);
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            if (int.Parse(tlDonVi.FocusedNode.Key) > 0)
            {
                var dmCongTo = db.DM_CongToSelectByIDDVi(session.User.ma_dviqly + "", diemdo.IDDiemDo + "").ToList();
                if (dmCongTo.Count > 0)
                {
                    grdDVT.DataSource = dmCongTo;
                    grdDVT.DataBind();
                }
                else
                {
                    grdDVT.DataSource = null;
                    grdDVT.DataBind();
                }
            }
        }
示例#22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
     if (session == null || session.User.USERNAME == "Guest")
     {
         Response.Redirect("~\\Login.aspx");
     }
     else
     {
         if (!IsPostBack)
         {
             if (DateTime.Now.Month == 1)
             {
                 cmbThang.Value = 12;
                 cmbNam.Value   = DateTime.Now.Year - 1;
             }
             else
             {
                 cmbThang.Value = DateTime.Now.Month - 1;
                 cmbNam.Value   = DateTime.Now.Year;
             }
             loadtonthat();
         }
         loadDanhMuc();
         loadXacNhan();
     }
     //insertdulieu();
     // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('Insert dữ liệu thành công');", true);
 }
示例#23
0
        private void loadXacNhan()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");
            var listTong  = db.BC_TongHopDiemDoCanXacNhan(ma_dviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + "")).ToList();

            if (listTong.Count > 0)
            {
                foreach (var a in listTong)
                {
                    lbNhanVien.Text    = a.NVCanXN + "";
                    lbTruongPhong.Text = a.TPCanXN + "";
                    lbGiamDocChua.Text = (a.GDChuaXN - a.GDDaXN) + "";
                    lbGiamDocDa.Text   = a.GDDaXN + "";

                    break;
                }
            }
            else
            {
                lbNhanVien.Text    = "0";
                lbTruongPhong.Text = "0";
                lbGiamDocChua.Text = "0";
                lbGiamDocDa.Text   = "0";
            }
        }
示例#24
0
        protected void btnIn_Click(object sender, EventArgs e)
        {
            MTCSYT.SYS_Session session     = (MTCSYT.SYS_Session)Session["SYS_Session"];
            string             strMadviqly = session.User.ma_dviqly;

            Response.Redirect("../Report/Report.aspx?ChiNhanh=" + cmbPhuongThuc.Value + "&Loai=1&Thang=" + cmbThang.Value + "&Nam=" + cmbNam.Value + "&ParentId=1");
        }
示例#25
0
        private void InBienBanQuyetToan()
        {
            if (cmbPhuongThuc.Value == null || cmbPhuongThuc.Value + "" == "0")
            {
                return;
            }
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int strMadviqly            = int.Parse(session.User.ma_dviqly);

            DataTable dt = new DataTable();

            CBDN.Class.InBienBanQT inBienBan = new CBDN.Class.InBienBanQT();
            string strGiao = "", strNhan = "", strGDNhan = "", strGDGiao = "";

            int donvi      = strMadviqly;
            int phuongthuc = int.Parse(cmbPhuongThuc.Value + "");

            if (strMadviqly == 2)
            {
                if (phuongthuc != 0)
                {
                    donvi      = int.Parse(db.DM_ChiNhanhs.SingleOrDefault(x => x.ID == int.Parse(cmbPhuongThuc.Value + "")).IDMADVIQLY.Replace(",2,", "").Replace(",", ""));
                    phuongthuc = 0;
                }
            }

            dt = inBienBan.InBienBanQuyetToan(phuongthuc, donvi, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), ref strGiao, ref strNhan, ref strGDNhan, ref strGiao);

            MTCSYT.Report.InBienBanQT report = new MTCSYT.Report.InBienBanQT(dt, "" + cmbThang.Value, "" + cmbNam.Value, false, false, "", "", strGiao, strNhan, "", "", strGDNhan, strGDGiao);
            ReportViewer2.Report = report;

            ReportToolbar2.ReportViewer = ReportViewer2;
        }
示例#26
0
        private void InTongHopDienNang()
        {
            if (cmbPhuongThuc.Value == null || cmbPhuongThuc.Value + "" == "0")
            {
                return;
            }

            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int             ma_dviqly  = int.Parse(session.User.ma_dviqly);
            DM_DVQLYService dm_dviSer  = new DM_DVQLYService();
            var             donvi      = dm_dviSer.SelectDM_DVQLY(ma_dviqly);

            //  if (Request["XacNhan"] + "" == "1") kiemtra = true;

            var cn = db.DM_ChiNhanhs.SingleOrDefault(x => x.ID == int.Parse(cmbPhuongThuc.Value + ""));

            CBDN.DM_DVQLY giao, nhan;
            if (cn.IDMADVIQLY.Contains(",2,"))
            {
                giao = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == 2);
                nhan = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == int.Parse(cn.IDMADVIQLY.Replace(",2,", "").Replace(",", "")));
            }
            else
            {
                giao = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == cn.DiemDauNguon);
                nhan = db.DM_DVQLies.SingleOrDefault(x => x.IDMA_DVIQLY == cn.DiemCuoiNguon);
            }

            MTCSYT.Report.InBieuTong report = new MTCSYT.Report.InBieuTong(int.Parse(cmbPhuongThuc.Value + ""), ma_dviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + ""), "", "", donvi.TEN_DVIQLY, giao.TEN_DVIQLY, nhan.TEN_DVIQLY, 0, "", "", "", "");

            ReportViewer1.Report = report;

            ReportToolbar1.ReportViewer = ReportViewer1;
        }
示例#27
0
        public string UploadFile()
        {
            MTCSYT.SYS_Session session    = (MTCSYT.SYS_Session)Session["SYS_Session"];
            string             strTenFile = "";

            try
            {
                //file tổng hợp
                strTenFile = cmbPhuongThuc.Value + "_" + cmbThang.Value + "_" + cmbNam.Value + "_TH.pdf";
                if (!Directory.Exists(Server.MapPath("~/") + "FileKy"))
                {
                    Directory.CreateDirectory(Server.MapPath("~/") + "FileKy");
                }
                if (!File.Exists(Server.MapPath("~/") + "FileKy\\" + strTenFile))
                {
                    fileUp.PostedFile.SaveAs(Server.MapPath("~/") + "FileKy\\" + strTenFile);
                    //strTenFile = fileUp.FileName;
                    CBDN.HD_ThongTinKy hDKyTH = new CBDN.HD_ThongTinKy();
                    hDKyTH.IDChinhNhanh = int.Parse(cmbPhuongThuc.Value + "");
                    hDKyTH.NgayTao      = DateTime.Now;
                    hDKyTH.NguoiTao     = session.User.IDUSER;
                    //hDKyTH.Link = "http://10.21.0.135:8091/FileKy/" + strTenFile;
                    hDKyTH.Link    = "http://10.21.3.75:8899//FileKy/" + strTenFile;
                    hDKyTH.Barcode = "";
                    hDKyTH.Thang   = int.Parse(cmbThang.Value + "");
                    hDKyTH.Nam     = int.Parse(cmbNam.Value + "");
                    db.HD_ThongTinKies.InsertOnSubmit(hDKyTH);
                    db.SubmitChanges();
                }
                //hdTenFile.Value = strTenFile;

                // import file quyết toán
                string strQT = cmbPhuongThuc.Value + "_" + cmbThang.Value + "_" + cmbNam.Value + "_QT.pdf";

                if (!File.Exists(Server.MapPath("~/") + "FileKy\\" + strQT))
                {
                    FileUpload1.PostedFile.SaveAs(Server.MapPath("~/") + "FileKy\\" + strQT);
                    //strTenFile = FileUpload1.FileName;
                    CBDN.HD_ThongTinKy hDKyQT = new CBDN.HD_ThongTinKy();
                    hDKyQT.IDChinhNhanh = int.Parse(cmbPhuongThuc.Value + "");
                    hDKyQT.NgayTao      = DateTime.Now;
                    hDKyQT.NguoiTao     = session.User.IDUSER;
                    // hDKyQT.Link = "http://10.21.0.135:8091/FileKy/"+strQT;
                    hDKyQT.Link    = "http://10.21.3.75:8899/FileKy/" + strQT;
                    hDKyQT.Barcode = "";
                    hDKyQT.Thang   = int.Parse(cmbThang.Value + "");
                    hDKyQT.Nam     = int.Parse(cmbNam.Value + "");
                    db.HD_ThongTinKies.InsertOnSubmit(hDKyQT);
                    db.SubmitChanges();
                }
                //hdTenFile.Value = strTenFile;
            }
            catch (Exception exp)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('" + exp.Message + Server.MapPath("~/") + "BaoCao\\" + hdTenFile.Value + "');", true);
            }
            //  ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "alert('" + strTenFile + "');", true);
            return(strTenFile);
        }
示例#28
0
        private void loadDanhMuc()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            tlDonVi.DataSource = db.BC_GiaoNhanDaXacNhan(ma_dviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + "")).ToList();
            tlDonVi.DataBind();
        }
示例#29
0
        private void _DataBind()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            grdDVT.DataSource = db.LayThongTinGiaoNhanQuaTool(ma_dviqly, int.Parse(cmbThang.Value + ""), int.Parse(cmbNam.Value + "")).ToList();
            grdDVT.DataBind();
        }
示例#30
0
        private void _DataBind()
        {
            MTCSYT.SYS_Session session = (MTCSYT.SYS_Session)Session["SYS_Session"];
            int ma_dviqly = int.Parse(session.User.ma_dviqly + "");

            grdDVT.DataSource = db.DM_CongToSelectByIDDVi(ma_dviqly).ToList();
            grdDVT.DataBind();
        }