コード例 #1
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)
                {
                    _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);
            }
        }
コード例 #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);
        }
コード例 #3
0
        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>");
        }
コード例 #4
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);
            }
        }
コード例 #5
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);
            }
        }
コード例 #6
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);
            }
        }