private string Check_TrungMST(int _year)
        {
            string    str  = "";
            string    lenh = "SELECT MST,NAM, count(*) FROM CONG_NO WHERE MST != '' and NAM = " + _year + " GROUP BY MST,NAM HAVING count(*) > 1";
            DataTable dt   = new DataTable();

            dt = XLDLRepo.ReadData(lenh);
            int _count = dt.Rows.Count;

            if (_count > 0)
            {
                str += "Đã phát hiện ra năm " + _year + " có " + _count + " mã số thuế bị trùng----\n\n";
                for (int i = 0; i < _count; i++)
                {
                    str += (i + 1) + ".MST: " + dt.Rows[i]["MST"] + "\n";
                    var list = db.CONG_NOs.Where(n => n.MST == Utils.CStrDef(dt.Rows[i]["MST"], "") && n.NAM == _year).ToList();
                    if (list.Count > 0)
                    {
                        str += "---Năm / STT / MST / Tên công ty\n";
                        for (int j = 0; j < list.Count; j++)
                        {
                            str += String.Format("---{0} / {1} / {2} / {3}\n"
                                                 , list[j].NAM, list[j].STT, list[j].MST, list[j].TEN_KH);
                        }
                    }
                }
                return(str);
            }
            else
            {
                return("");
            }
        }
Exemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            //String hostdet = Request.ServerVariables["HTTP_HOST"].ToString();

            //lbMessage.Text = hostdet + " - " + System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;

            string kq = XLDLRepo.DataCommand(TextBox1.Text);

            lbMessage.Text = kq;
        }
Exemplo n.º 3
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string kq = XLDLRepo.DataCommand("  BACKUP DATABASE esell2_vn TO DISK= '" + Server.MapPath("~/esell2_vn.bak") + "' WITH FORMAT");

            lbMessage.Text = kq;
        }
Exemplo n.º 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string kq = XLDLRepo.DataCommand(TextBox1.Text);

            lbMessage.Text = kq;
        }