protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            if (Utils.CStrDef(Session["Grouptype"]) == "1" || Utils.CStrDef(Session["Grouptype"]) == "2")
            {
                List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });
                foreach (var item in fieldValues)
                {
                    _delData.DeleteMemberByProf(Utils.CIntDef(item));
                    _delData.DeleteAttachByProf(Utils.CIntDef(item));
                    _delData.DeleteWorkByProf(Utils.CIntDef(item));
                    _ProjectData.Remove(Utils.CIntDef(item));
                    string pathfileOld = Server.MapPath("/File/Profile/" + Utils.CStrDef(item));
                    DeleteAllFilesInFolder(pathfileOld);
                }

                Response.Redirect("danh-sach-ho-so.aspx");
            }
            else
            {
                string strScript = "<script>";
                strScript += "alert(' Bạn không có quyền này!');";
                strScript += "window.location='danh-sach-ho-so.aspx';";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
        }
Esempio n. 2
0
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            _getCookies.getCookiesNew();//cấp lại session
            if (Utils.CStrDef(Session["Grouptype"]) == "1" || Utils.CStrDef(Session["Grouptype"]) == "2")
            {
                List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });
                foreach (var item in fieldValues)
                {
                    _MerHopDongDVData.Remove(Utils.CIntDef(item));
                    string pathfileOld = Server.MapPath("/File/WordFile/HopDongDVKeToan_Code_" + Utils.CStrDef(item) + ".docx");
                    System.IO.File.Delete(pathfileOld);
                }

                Response.Redirect("danh-sach-hop-dong-ke-toan.aspx");
            }
            else
            {
                string strScript = "<script>";
                strScript += "alert(' Bạn không có quyền này!');";
                strScript += "window.location='danh-sach-hop-dong-ke-toan.aspx';";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
            //string strScript = "<script>";
            //strScript += "alert(' Xin liên hệ với quản lý để được cấp quyền!');";
            //strScript += "window.location='danh-sach-hop-dong-ke-toan.aspx';";
            //strScript += "</script>";
            //Page.RegisterClientScriptBlock("strScript", strScript);
        }
Esempio n. 3
0
        private void LoadProject()
        {
            try
            {
                if (Utils.CStrDef(Session["Grouptype"]) != "1" && Utils.CStrDef(Session["Grouptype"]) != "9" && Utils.CStrDef(Session["Grouptype"]) != "14")
                {
                    var list = _BangLuongData.GetListByNV(txtKeyword.Value, Utils.CIntDef(ddlThang.SelectedValue), Utils.CIntDef(ddlNam.SelectedValue), GetUser(Utils.CIntDef(Session["Userid"])));

                    HttpContext.Current.Session["listBangLuong"] = list;
                    ASPxGridView1_project.DataSource             = list;
                    ASPxGridView1_project.DataBind();
                }
                else
                {
                    var list = _BangLuongData.GetListByYear(txtKeyword.Value, Utils.CIntDef(ddlThang.SelectedValue), Utils.CIntDef(ddlNam.SelectedValue));

                    HttpContext.Current.Session["listBangLuong"] = list;
                    ASPxGridView1_project.DataSource             = list;
                    ASPxGridView1_project.DataBind();
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });

            foreach (var item in fieldValues)
            {
                _member.Remove(Utils.CIntDef(item));
            }
            ClientScript.RegisterStartupScript(GetType(), "Load", "<script type='text/javascript'>parent.emailwindow.close(); parent.GetCurrentTime()</script>");
        }
Esempio n. 5
0
        private void LoadProject()
        {
            try
            {
                if (_Search != "" && _Search != null)
                {
                    txtKeyword.Value = _Search;
                }
                if (_Month != "" && _Month != null)
                {
                    ddlThang.SelectedValue = _Month;
                }
                if (_Year != "" && _Year != null)
                {
                    ddlNam.SelectedValue = _Year;
                }
                if (_congno != 0)
                {
                    ddlCongnno.SelectedValue = _congno.ToString();
                }
                if (_tinhtrang != 0)
                {
                    ddlTinhtrang.SelectedValue = _tinhtrang.ToString();
                }

                int sotin    = Utils.CIntDef(ddlCountPage.SelectedValue);
                int _idUser  = Utils.CIntDef(Session["Userid"], 0);
                int _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                if (_idGroup != 1 && _idGroup != 2 && _idGroup != 10 && _idGroup != 14)
                {
                    var list = _CongNoWebRepo.GetListByYear(Utils.CIntDef(ddlNam.SelectedValue), Utils.CIntDef(ddlThang.SelectedValue), _idUser, _Search, Utils.CIntDef(ddlTinhtrang.SelectedValue), Utils.CIntDef(ddlCongnno.SelectedValue));
                    //HttpContext.Current.Session["listCongNoWeb"] = list;
                    ASPxGridView1_project.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                    ASPxGridView1_project.DataBind();

                    ltrPage.Text = change.result_web(list.Count, sotin, "danh-sach-cong-no-web", 0, _page, 1, ddlThang.SelectedValue, ddlNam.SelectedValue, "0", _Search, Utils.CIntDef(ddlTinhtrang.SelectedValue), Utils.CIntDef(ddlCongnno.SelectedValue));
                }
                else
                {
                    var list = _CongNoWebRepo.GetListByYear(Utils.CIntDef(ddlNam.SelectedValue), Utils.CIntDef(ddlThang.SelectedValue), -1, _Search, Utils.CIntDef(ddlTinhtrang.SelectedValue), Utils.CIntDef(ddlCongnno.SelectedValue));
                    //HttpContext.Current.Session["listCongNoWeb"] = list;
                    ASPxGridView1_project.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                    ASPxGridView1_project.DataBind();

                    ltrPage.Text = change.result_web(list.Count, sotin, "danh-sach-cong-no-web", 0, _page, 1, ddlThang.SelectedValue, ddlNam.SelectedValue, "0", _Search, Utils.CIntDef(ddlTinhtrang.SelectedValue), Utils.CIntDef(ddlCongnno.SelectedValue));
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TestPermission();
     if (!IsPostBack)
     {
         LoadProject();
     }
     else
     {
         ASPxGridView1_project.DataSource = HttpContext.Current.Session["listBangLuong"];
         ASPxGridView1_project.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     _id = Utils.CIntDef(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         LoadProject();
         TestPermission();
     }
     else
     {
         ASPxGridView1_project.DataSource = HttpContext.Current.Session["listMember"];
         ASPxGridView1_project.DataBind();
     }
 }
        private void LoadProject()
        {
            try
            {
                var list = db.PROFILE_MEMBERs.Where(n => n.PROF_ID == _id).OrderByDescending(n => n.MEM_DATE);

                HttpContext.Current.Session["listMember"] = list;
                ASPxGridView1_project.DataSource          = list;
                ASPxGridView1_project.DataBind();
            }
            catch //(Exception)
            {
                //throw;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     TestPermission();
     viewDebtCol();
     if (!IsPostBack)
     {
         pickdate_Begin.returnDate = Convert.ToDateTime("01/01/2015");
         fromDate = pickdate_Begin.returnDate;
         pickdate_End.returnDate = DateTime.Now;
         toDate = pickdate_End.returnDate;
         LoadProject();
     }
     else
     {
         ASPxGridView1_project.DataSource = HttpContext.Current.Session["listProj"];
         ASPxGridView1_project.DataBind();
     }
 }
        private void LoadProject()
        {
            try
            {
                int    _idUser  = Utils.CIntDef(Session["Userid"]);
                int    _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                string _keyword = txtKeyword.Value;
                if (_idGroup != 1 && _idGroup != 2 && _idGroup != 10 && _idGroup != 14 && _idGroup != 7)
                {
                    var list = (from n in db.CONG_NOs
                                where ((n.NV_KD == _idUser || n.NV_GN == _idUser || n.NV_KT == _idUser) &&
                                       (n.TEN_KH.Contains(_keyword) || n.MST.Contains(_keyword) || "" == _keyword) &&
                                       (n.MST != "" && n.MST != null))
                                select new
                    {
                        n.MST
                    }).OrderByDescending(n => n.MST).Distinct();

                    HttpContext.Current.Session["listListCty"] = list;
                    ASPxGridView1_project.DataSource           = list;
                    ASPxGridView1_project.DataBind();
                }
                else
                {
                    var list = (from n in db.CONG_NOs
                                where ((n.TEN_KH.Contains(_keyword) || n.MST.Contains(_keyword) || "" == _keyword) &&
                                       (n.MST != "" && n.MST != null))
                                select new
                    {
                        n.MST
                    }).OrderByDescending(n => n.MST).Distinct();

                    HttpContext.Current.Session["listListCty"] = list;
                    ASPxGridView1_project.DataSource           = list;
                    ASPxGridView1_project.DataBind();
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Esempio n. 11
0
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            if (Utils.CStrDef(Session["Grouptype"]) == "1" || Utils.CStrDef(Session["Grouptype"]) == "2")
            {
                List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });
                foreach (var item in fieldValues)
                {
                    _CongNoCKSData.Remove(Utils.CIntDef(item));
                }

                Response.Redirect("danh-sach-cong-no-cks.aspx");
            }
            else
            {
                string strScript = "<script>";
                strScript += "alert(' Bạn không có quyền này!');";
                strScript += "window.location='danh-sach-cong-no-cks.aspx';";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
        }
Esempio n. 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            getCookies _getCookies = new getCookies();

            _getCookies.getCookiesNew();
            TestPermission();

            if (!IsPostBack)
            {
                pickdate_Begin.returnDate = Convert.ToDateTime("01/01/2015");
                fromDate = pickdate_Begin.returnDate;
                pickdate_End.returnDate = DateTime.Now;
                toDate = pickdate_End.returnDate;
                _getCookies.getCookiesNew();//cấp lại session
                LoadProject();
            }
            else
            {
                ASPxGridView1_project.DataSource = HttpContext.Current.Session["listThanhLyHopDong"];
                ASPxGridView1_project.DataBind();
            }
        }
Esempio n. 13
0
        private void LoadProject()
        {
            try
            {
                if (_Month != "" && _Month != null)
                {
                    ddlThang.SelectedValue = _Month;
                }
                if (_Year != "" && _Year != null)
                {
                    ddlNam.SelectedValue = _Year;
                }
                int sotin    = Utils.CIntDef(ddlCountPage.SelectedValue);
                int _idUser  = Utils.CIntDef(Session["Userid"], 0);
                int _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                if (_idGroup != 1 && _idGroup != 2 && _idGroup != 10 && _idGroup != 14)
                {
                    var list = _CongNoCKSData.GetListByYearNV(ddlNam.SelectedValue, ddlThang.SelectedValue, _idUser, _Search);
                    //HttpContext.Current.Session["listCongNoCKS"] = list;
                    ASPxGridView1_project.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                    ASPxGridView1_project.DataBind();

                    ltrPage.Text = change.result_cks(list.Count, sotin, "danh-sach-cong-no-cks", 0, _page, 1, ddlThang.SelectedValue, ddlNam.SelectedValue, "0", _Search);
                }
                else
                {
                    var list = _CongNoCKSData.GetListByYear(ddlNam.SelectedValue, ddlThang.SelectedValue, _Search);
                    //HttpContext.Current.Session["listCongNoCKS"] = list;
                    ASPxGridView1_project.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                    ASPxGridView1_project.DataBind();

                    ltrPage.Text = change.result_cks(list.Count, sotin, "danh-sach-cong-no-cks", 0, _page, 1, ddlThang.SelectedValue, ddlNam.SelectedValue, "0", _Search);
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
        private void LoadProject()
        {
            try
            {
                int _typeprof = Utils.CIntDef(ddlTypeProf.SelectedValue);
                fromDate = pickdate_Begin.returnDate;
                toDate   = new DateTime(pickdate_End.returnDate.Year, pickdate_End.returnDate.Month, pickdate_End.returnDate.Day, 23, 59, 59);
                if (Utils.CStrDef(Session["Grouptype"]) == "3")
                {
                    var list = _ProjectData.GetListByName(txtKeyword.Value)
                               .Where(a => a.USER_ID == Utils.CIntDef(Session["Userid"]) &&
                                      (a.PROF_DATE <= toDate && a.PROF_DATE >= fromDate) &&
                                      (a.PROF_TYPE == _typeprof || 0 == _typeprof) &&
                                      (chkViewDebt.Checked ? a.PROF_COST1 != a.PROF_COST2 : "" == ""))
                               .OrderByDescending(n => n.PROF_DATE).OrderBy(n => n.PROF_STATUS == 12);

                    HttpContext.Current.Session["listProj"] = list;
                    ASPxGridView1_project.DataSource        = list;
                    ASPxGridView1_project.DataBind();
                }
                else
                {
                    var list = _ProjectData.GetListByName(txtKeyword.Value)
                               .Where(a => (a.PROF_DATE <= toDate && a.PROF_DATE >= fromDate) &&
                                      (a.PROF_TYPE == _typeprof || 0 == _typeprof) &&
                                      (chkViewDebt.Checked ? a.PROF_COST1 != a.PROF_COST2 : "" == ""))
                               .OrderByDescending(n => n.PROF_DATE).OrderBy(n => n.PROF_STATUS == 12);

                    HttpContext.Current.Session["listProj"] = list;
                    ASPxGridView1_project.DataSource        = list;
                    ASPxGridView1_project.DataBind();
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Esempio n. 15
0
        private void LoadProject()
        {
            try
            {
                int _idUser  = Utils.CIntDef(Session["Userid"]);
                int _idGroup = Utils.CIntDef(Session["Grouptype"], 0);
                fromDate = pickdate_Begin.returnDate;
                toDate   = new DateTime(pickdate_End.returnDate.Year, pickdate_End.returnDate.Month, pickdate_End.returnDate.Day, 23, 59, 59);
                if (_idGroup != 1 && _idGroup != 2 && _idGroup != 9 && _idGroup != 14 && _idUser != 24)
                {
                    var list = _MerThanhLyHopDongDVData.GetListAll()
                               .Where(a => a.USER_ID == Utils.CIntDef(Session["Userid"]) &&
                                      (a.MER_DATE <= toDate && a.MER_DATE >= fromDate) &&
                                      (a.MER_NAME2.Contains(txtKeyword.Value.ToUpper()) || a.MER_NAME2 == ""))
                               .OrderByDescending(n => n.MER_DATE);

                    HttpContext.Current.Session["listThanhLyHopDong"] = list;
                    ASPxGridView1_project.DataSource = list;
                    ASPxGridView1_project.DataBind();
                }
                else
                {
                    var list = _MerThanhLyHopDongDVData.GetListAll()
                               .Where(a => (a.MER_DATE <= toDate && a.MER_DATE >= fromDate) &&
                                      (a.MER_NAME2.Contains(txtKeyword.Value.ToUpper()) || a.MER_NAME2 == ""))
                               .OrderByDescending(n => n.MER_DATE);

                    HttpContext.Current.Session["listThanhLyHopDong"] = list;
                    ASPxGridView1_project.DataSource = list;
                    ASPxGridView1_project.DataBind();
                }
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Esempio n. 16
0
        private void CreateCongNo()
        {
            List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });

            if (fieldValues.Count > 0)
            {
                foreach (var item in fieldValues)
                {
                    var obj = _MerThanhLyHopDongDVData.GetById(Utils.CIntDef(item));
                    if (obj != null)
                    {
                        //Kiểm tra xem trạng thái đã Hoàn thành chưa
                        if (Utils.CIntDef(obj.MER_STATUS) == 3)
                        {
                            var objCheck = db.CONG_NOs.Where(u => u.MST == obj.MER_TAXCODE && u.NAM == Utils.CIntDef(obj.MER_POS05, 0)).ToList();
                            if (objCheck.Count > 0)
                            {
                                objCheck[0].TINH_TRANG = "Ngừng dịch vụ";
                                db.SubmitChanges();
                            }
                        }
                    }
                }
                string strScript = "<script>";
                strScript += "alert('Đã xử lý xong!');";
                strScript += "window.location='danh-sach-bien-ban-thanh-ly-hop-dong.aspx';";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
            else
            {
                string strScript = "<script>";
                strScript += "alert('Xin chọn hợp đồng để cập nhật vào công nợ kế toán!');";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
        }
Esempio n. 17
0
        private void CreateCongNo()
        {
            List <object> fieldValues = ASPxGridView1_project.GetSelectedFieldValues(new string[] { "ID" });

            if (fieldValues.Count > 0)
            {
                foreach (var item in fieldValues)
                {
                    var obj = _MerHopDongDVData.GetById(Utils.CIntDef(item));
                    if (obj != null)
                    {
                        //Kiểm tra xem trạng thái đã Hoàn thành chưa
                        if (Utils.CIntDef(obj.MER_STATUS) == 3)
                        {
                            var objCheck = db.CONG_NOs.Where(u => u.MST == obj.MER_TAXCODE && u.NAM == Utils.CIntDef(obj.MER_POS05, 0)).ToList();
                            if (objCheck.Count == 0)
                            {
                                CONG_NO i = new CONG_NO();
                                i.TINH_TRANG = "---";
                                i.NAM        = Utils.CIntDef(obj.MER_POS05, 0);
                                string _ngayHD = obj.MER_POS03 + "/" + obj.MER_POS04 + "/" + obj.MER_POS05;
                                i.NGAY_KY_HD = DateTime.ParseExact(_ngayHD, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                                i.TEN_KH     = obj.MER_NAME;
                                i.DIA_CHI    = obj.MER_ADDRESS;
                                i.DIEN_THOAI = obj.MER_PHONE;
                                i.MST        = obj.MER_TAXCODE;
                                i.EMAIL      = obj.MER_EMAIL;
                                i.GIAM_DOC   = obj.MER_REPRESENT;
                                i.PHI        = obj.PHI_HANGTHANG;
                                i.NV_KD      = obj.USER_ID;

                                if (Utils.CIntDef(obj.PHI_TU1_1) > 0 && Utils.CIntDef(obj.PHI_TU1_2) > 0)
                                {
                                    i.BIEUPHI1_SL  = obj.PHI_TU1_1 + "-" + obj.PHI_TU1_2;
                                    i.BIEUPHI1_PHI = obj.PHI_HD1;
                                }
                                if (Utils.CIntDef(obj.PHI_TU2_1) > 0 && Utils.CIntDef(obj.PHI_TU2_2) > 0)
                                {
                                    i.BIEUPHI2_SL  = obj.PHI_TU2_1 + "-" + obj.PHI_TU2_2;
                                    i.BIEUPHI2_PHI = obj.PHI_HD2;
                                }
                                if (Utils.CIntDef(obj.PHI_TU3_1) > 0 && Utils.CIntDef(obj.PHI_TU3_2) > 0)
                                {
                                    i.BIEUPHI3_SL  = obj.PHI_TU3_1 + "-" + obj.PHI_TU3_2;
                                    i.BIEUPHI3_PHI = obj.PHI_HD3;
                                }
                                if (Utils.CIntDef(obj.PHI_TU4_1) > 0 && Utils.CIntDef(obj.PHI_TU4_2) > 0)
                                {
                                    i.BIEUPHI4_SL  = obj.PHI_TU4_1 + "-" + obj.PHI_TU4_2;
                                    i.BIEUPHI4_PHI = obj.PHI_HD4;
                                }
                                if (Utils.CIntDef(obj.PHI_TU5_1) > 0 && Utils.CIntDef(obj.PHI_TU5_2) > 0)
                                {
                                    i.BIEUPHI5_SL  = obj.PHI_TU5_1 + "-" + obj.PHI_TU5_2;
                                    i.BIEUPHI5_PHI = obj.PHI_HD5;
                                }
                                if (Utils.CIntDef(obj.PHI_TU6_1) > 0 && Utils.CIntDef(obj.PHI_TU6_2) > 0)
                                {
                                    i.BIEUPHI6_SL  = obj.PHI_TU6_1 + "-" + obj.PHI_TU6_2;
                                    i.BIEUPHI6_PHI = obj.PHI_HD6;
                                }
                                if (Utils.CIntDef(obj.PHI_THEMPHI) > 0)
                                {
                                    i.BIEUPHI_THEM = obj.PHI_THEMPHI;
                                }
                                i.THANG_BD_THU = obj.MER_BEGIN_M;
                                i.STT          = _CongNoData.GetSTT(Utils.CIntDef(obj.MER_POS05)) + 1;

                                _CongNoData.Create(i);
                                db.SubmitChanges();
                            }
                        }
                    }
                }
                string strScript = "<script>";
                strScript += "alert('Đã xử lý xong!');";
                strScript += "window.location='danh-sach-hop-dong-ke-toan.aspx';";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
            else
            {
                string strScript = "<script>";
                strScript += "alert('Xin chọn hợp đồng để cập nhật vào công nợ kế toán!');";
                strScript += "</script>";
                Page.RegisterClientScriptBlock("strScript", strScript);
            }
        }