Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["UserID"] != null)
            {
                string  MunicipalId = ""; string MunicipalName = "";
                DataRow Municipal = klas.GetDataRow(@"Select lm.MunicipalName,lm.MunicipalID from Users u inner join List_classification_Municipal lm 
on u.MunicipalID=lm.MunicipalID Where  UserID=" + Session["UserID"].ToString());
                if (Municipal != null)
                {
                    MunicipalId   = Municipal["MunicipalID"].ToString();
                    MunicipalName = Municipal["MunicipalName"].ToString();
                }
                if (MunicipalId != "")
                {
                    DataTable      dt        = new DataTable();
                    string         sqlstring = @"Select ROW_NUMBER() over(order by t.SName+' '+t.Name+' '+t.FName+' '+ case when t.Gender=1 then N'oğlu' else N'Qızı' end,n,sn) sn1,'' sn2,
 t.TaxpayerID,t.SName+' '+t.Name+' '+t.FName+' '+ case when t.Gender=1 then N'oğlu' else N'Qızı' end fullname, t.YVOK,b.*
from Taxpayer t  left join viewbldbaza b on t.TaxpayerID=b.TaxpayerID where t.MunicipalID=" + MunicipalId;
                    SqlDataAdapter dap       = new SqlDataAdapter(sqlstring, klas.baglan());
                    dap.SelectCommand.CommandTimeout = 180;
                    dap.Fill(dt);
                    dt = klas.tekrarlamax2("fullname", "YVOK", "N", dt);
                    DataListBaza.DataSource = dt;
                    DataListBaza.DataBind();
                }
            }
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["UserID"] != null)
            {
                string  MunicipalId = ""; string MunicipalName = "";
                DataRow Municipal = klas.GetDataRow(@"Select lm.MunicipalName,lm.MunicipalID from Users u inner join List_classification_Municipal lm 
on u.MunicipalID=lm.MunicipalID Where  UserID=" + Session["UserID"].ToString());
                if (Municipal != null)
                {
                    MunicipalId   = Municipal["MunicipalID"].ToString();
                    MunicipalName = Municipal["MunicipalName"].ToString();
                }


                if (MunicipalId != "")
                {
                    DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'  Cəmi ' fullname, 
                                           '' YVOK,
                                           '' CompanyName,
                                           '' ActivitieType,
                                           '' unvan,
                                           sum(c.Income) Income,
                                           Sum(c.Expense) Expense,
                                           SUM(c.Amount) as Amount,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join ProfitsTax p on p.TaxpayerID=t.TaxpayerID left join 
                                    CalcProfits c on c.ProfitsID=p.IncomeTaxID where t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId);

                    DataListCem.DataSource = dt1;
                    DataListCem.DataBind();



                    DataTable dt = klas.getdatatable(@"select '' sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       p.CompanyName,
                                       p.ActivitieType,
                                       p.RegionName+', '+p.Village+', '+p.Street+', '+p.Home+', '+p.Flat as unvan,
                                       sum(c.Income) Income,
                                       Sum(c.Expense) Expense,
                                       SUM(c.Amount) as Amount,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join ProfitsTax p on p.TaxpayerID=t.TaxpayerID left join CalcProfits c on c.ProfitsID=p.IncomeTaxID
                                 where t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId +
                                                     "group by t.SName+' '+t.Name+' '+t.FName, t.YVOK,p.CompanyName, p.ActivitieType, p.RegionName+', '+p.Village+', '+p.Street+', '+p.Home+', '+p.Flat order by sn,fullname ");

                    DataListBaza.DataSource = dt;
                    DataListBaza.DataBind();
                }
            }
        }
    }
Пример #3
0
    protected void selectProfits()
    {
        string MunicipalId = ""; string ray = " ";

        if (ddlbelediyye.SelectedValue == "-1" || ddlbelediyye.SelectedValue == "" || ddlbelediyye.SelectedValue == null)
        {
            MunicipalId = " ";
        }
        else
        {
            MunicipalId = " and t.MunicipalID=" + ddlbelediyye.SelectedValue;
        }
        if (ddlrayon.SelectedValue == "-1" || ddlrayon.SelectedValue == "" || ddlrayon.SelectedValue == null)
        {
            ray = "  ";
        }
        else
        {
            ray = " and lcm.RegionID=" + ddlrayon.SelectedValue;
        }
        DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'  Cəmi ' fullname, 
                                           '' YVOK,
                                           '' CompanyName,
                                           '' ActivitieType,
                                           '' unvan,
                                           sum(c.Income) Income,
                                           Sum(c.Expense) Expense,
                                           SUM(c.Amount) as Amount,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join ProfitsTax p on p.TaxpayerID=t.TaxpayerID left join 
                                    CalcProfits c on c.ProfitsID=p.IncomeTaxID 
inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 " + MunicipalId + ray);

        DataListCem.DataSource = dt1;
        DataListCem.DataBind();



        DataTable dt = klas.getdatatable(@"select   '' sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       p.CompanyName,
                                       p.ActivitieType,
                                       p.RegionName+', '+p.Village+', '+p.Street+', '+p.Home+', '+p.Flat as unvan,
                                       sum(c.Income) Income,
                                       Sum(c.Expense) Expense,
                                       SUM(c.Amount) as Amount,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join ProfitsTax p on p.TaxpayerID=t.TaxpayerID left join CalcProfits c on c.ProfitsID=p.IncomeTaxID
                           inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 " + MunicipalId + ray +
                                         "group by t.SName+' '+t.Name+' '+t.FName, t.YVOK,p.CompanyName, p.ActivitieType, p.RegionName+', '+p.Village+', '+p.Street+', '+p.Home+', '+p.Flat ");

        DataListBaza.DataSource = dt;
        DataListBaza.DataBind();
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["UserID"] != null)
            {
                string  MunicipalId = ""; string MunicipalName = "";
                DataRow Municipal = klas.GetDataRow(@"Select lm.MunicipalName,lm.MunicipalID from Users u inner join List_classification_Municipal lm 
on u.MunicipalID=lm.MunicipalID Where  UserID=" + Session["UserID"].ToString());
                if (Municipal != null)
                {
                    MunicipalId   = Municipal["MunicipalID"].ToString();
                    MunicipalName = Municipal["MunicipalName"].ToString();
                }


                if (MunicipalId != "")
                {
                    DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'Cəmi' fullname, 
                                           '' YVOK,
                                           '' GraduationYear,
                                           '' MotorType,
                                           '' MotorSize,
                                           '' Price,
                                           sum(l.mebleg) mebleg,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join viewWaterAirTransport l on t.TaxpayerID=l.TaxpayerID  
where t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId);

                    DataListCem.DataSource = dt1;
                    DataListCem.DataBind();



                    DataTable dt = klas.getdatatable(@"select '' sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       l.GraduationYear,
                                       l.MotorType,
                                       case when l.MotorSize=0 then null else l.MotorSize end MotorSize,
                                       case when l.Price=0 then null else l.Price end Price,
                                       l.mebleg,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join viewWaterAirTransport l on t.TaxpayerID=l.TaxpayerID where 
t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId + " order by sn,fullname ");

                    DataListBaza.DataSource = dt;
                    DataListBaza.DataBind();
                }
            }
        }
    }
Пример #5
0
    protected void selectTransport()
    {
        string MunicipalId = ""; string ray = " ";

        if (ddlbelediyye.SelectedValue == "-1" || ddlbelediyye.SelectedValue == "" || ddlbelediyye.SelectedValue == null)
        {
            MunicipalId = " ";
        }
        else
        {
            MunicipalId = " and t.MunicipalID=" + ddlbelediyye.SelectedValue;
        }
        if (ddlrayon.SelectedValue == "-1" || ddlrayon.SelectedValue == "" || ddlrayon.SelectedValue == null)
        {
            ray = "  ";
        }
        else
        {
            ray = " and lcm.RegionID=" + ddlrayon.SelectedValue;
        }
        DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'Cəmi' fullname, 
                                           '' YVOK,
                                           '' GraduationYear,
                                           '' MotorType,
                                           '' MotorSize,
                                           '' Price,
                                           sum(l.mebleg) mebleg,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join viewWaterAirTransport l on t.TaxpayerID=l.TaxpayerID  
inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 and ExitDate is null " + MunicipalId + ray);

        DataListCem.DataSource = dt1;
        DataListCem.DataBind();

        //ROW_NUMBER() over(order by t.SName+' '+t.Name+' '+FName)

        DataTable dt = klas.getdatatable(@"select '' sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       l.GraduationYear,
                                       l.MotorType,
                                       case when l.MotorSize=0 then null else l.MotorSize end MotorSize,
                                       case when l.Price=0 then null else l.Price end Price,
                                       l.mebleg,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join viewWaterAirTransport l on t.TaxpayerID=l.TaxpayerID 
inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 and ExitDate is null " + MunicipalId + ray);

        DataListBaza.DataSource = dt;
        DataListBaza.DataBind();
    }
Пример #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["UserID"] != null)
            {
                string  MunicipalId = ""; string MunicipalName = "";
                DataRow Municipal = klas.GetDataRow(@"Select lm.MunicipalName,lm.MunicipalID from Users u inner join List_classification_Municipal lm 
on u.MunicipalID=lm.MunicipalID Where  UserID=" + Session["UserID"].ToString());
                if (Municipal != null)
                {
                    MunicipalId   = Municipal["MunicipalID"].ToString();
                    MunicipalName = Municipal["MunicipalName"].ToString();
                }


                if (MunicipalId != "")
                {
                    DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'  Cəmi ' fullname, 
                                           '' YVOK,
                                           '' MinePositionArea,
                                           '' MineType,
                                           sum(m.Productionsize) Productionsize,
                                           sum(m.Amount) Amount,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join MineTax l on t.TaxpayerID=l.TaxpayerID 
left join CalcMine m on m.MineID=l.MineId where t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId +
                                                      " order by fullname");

                    DataListCem.DataSource = dt1;
                    DataListCem.DataBind();



                    DataTable dt = klas.getdatatable(@"select '' sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       l.MinePositionArea,
                                       l.MineType,
                                       sum(m.Productionsize) Productionsize,
                                       Sum(m.Amount) Amount,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join MineTax l on t.TaxpayerID=l.TaxpayerID left join CalcMine m on m.MineID=l.MineId where t.fordelete=1 and ExitDate is null and t.MunicipalID=" + MunicipalId +
                                                     "group by t.SName+' '+t.Name+' '+t.FName, t.YVOK, l.MinePositionArea, l.MineType ");

                    DataListBaza.DataSource = dt;
                    DataListBaza.DataBind();
                }
            }
        }
    }
Пример #7
0
    protected void selectMine()
    {
        string MunicipalId = ""; string ray = " ";

        if (ddlbelediyye.SelectedValue == "-1" || ddlbelediyye.SelectedValue == "" || ddlbelediyye.SelectedValue == null)
        {
            MunicipalId = " ";
        }
        else
        {
            MunicipalId = " and t.MunicipalID=" + ddlbelediyye.SelectedValue;
        }
        if (ddlrayon.SelectedValue == "-1" || ddlrayon.SelectedValue == "" || ddlrayon.SelectedValue == null)
        {
            ray = "  ";
        }
        else
        {
            ray = " and lcm.RegionID=" + ddlrayon.SelectedValue;
        }
        DataTable dt1 = klas.getdatatable(@"select '' sn, 
                                           N'  Cəmi ' fullname, 
                                           '' YVOK,
                                           '' MinePositionArea,
                                           '' MineType,
                                           sum(m.Productionsize) Productionsize,
                                           sum(m.Amount) Amount,
                                           '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                    from Taxpayer t inner join MineTax l on t.TaxpayerID=l.TaxpayerID left join CalcMine m on m.MineID=l.MineId
inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 " + MunicipalId + ray);

        DataListCem.DataSource = dt1;
        DataListCem.DataBind();



        DataTable dt = klas.getdatatable(@"select ROW_NUMBER() over(order by t.SName+' '+t.Name+' '+FName) sn, 
                                       t.SName+' '+t.Name+' '+t.FName as fullname, 
                                       t.YVOK,
                                       l.MinePositionArea,
                                       l.MineType,
                                       sum(m.Productionsize) Productionsize,
                                       Sum(m.Amount) Amount,
                                       '01.01.'+CAST((YEAR(getdate())+1) as varchar) Tarix            
                                from Taxpayer t inner join MineTax l on t.TaxpayerID=l.TaxpayerID left join CalcMine m on m.MineID=l.MineId

inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1 " + MunicipalId + ray +
                                         "group by t.SName+' '+t.Name+' '+t.FName, t.YVOK, l.MinePositionArea, l.MineType ");

        DataListBaza.DataSource = dt;
        DataListBaza.DataBind();
    }
Пример #8
0
    void kk()
    {
        string s = " ", f = " ", k = " "; string ray = " "; string fizhuq = " "; string fizhuq1 = " "; string fizhuq2 = " ";

        if (ddlbelediyye.SelectedValue == "-1" || ddlbelediyye.SelectedValue == "" || ddlbelediyye.SelectedValue == null)
        {
            s = " ";
            f = " ";
            k = " ";
        }
        else
        {
            s = " and t1.MunicipalID=" + ddlbelediyye.SelectedValue;
            f = " and t2.MunicipalID=" + ddlbelediyye.SelectedValue;
            k = " and t.MunicipalID=" + ddlbelediyye.SelectedValue;
        }
        if (ddlrayon.SelectedValue == "-1" || ddlrayon.SelectedValue == "" || ddlrayon.SelectedValue == null)
        {
            ray = "  ";
        }
        else
        {
            ray = " and lcm.RegionID=" + ddlrayon.SelectedValue;
        }

        if (ddlfizhuq.SelectedValue == "-1" || ddlfizhuq.SelectedValue == "" || ddlfizhuq.SelectedValue == null)
        {
            fizhuq  = "  ";
            fizhuq1 = "  ";
            fizhuq2 = "  ";
        }
        else
        {
            fizhuq  = " and t1.Individual_Legal=" + ddlfizhuq.SelectedValue;
            fizhuq1 = " and t2.Individual_Legal=" + ddlfizhuq.SelectedValue;
            fizhuq2 = " and t.Individual_Legal=" + ddlfizhuq.SelectedValue;
        }



        lb1.Font.Underline = false;
        lb2.Font.Underline = false;
        lb3.Font.Underline = false;
        lb4.Font.Underline = false;
        lb5.Font.Underline = false;
        lb6.Font.Underline = false;
        lb7.Font.Underline = false;


        int gelenx = 1;

        if (Session["x"] != null)
        {
            gelenx = int.Parse(Session["x"].ToString());
        }


        if (gelenx == 1)
        {
            lb6.Enabled = false;
        }
        else
        {
            lb6.Enabled = true;
        }

        if (gelenx > 3)
        {
            lb1.Text = (gelenx - 2).ToString();
            lb2.Text = (gelenx - 1).ToString();
            lb3.Text = (gelenx).ToString();
            lb4.Text = (gelenx + 1).ToString();
            lb5.Text = (gelenx + 2).ToString();
        }
        else if (gelenx == 3)
        {
            lb1.Text = "1";
            lb2.Text = "2";
            lb3.Text = "3";
            lb4.Text = "4";
            lb5.Text = "5";
        }
        else if (gelenx == 2)
        {
            lb1.Text           = "1";
            lb2.Text           = "2";
            lb3.Text           = "3";
            lb4.Text           = "4";
            lb5.Text           = "5";
            lb2.Font.Underline = true;
        }
        else if (gelenx == 1)
        {
            lb1.Text           = "1";
            lb2.Text           = "2";
            lb3.Text           = "3";
            lb4.Text           = "4";
            lb5.Text           = "5";
            lb1.Font.Underline = true;
        }
        if (gelenx > 2)
        {
            lb3.Font.Underline = true;
        }

        int setrsayi = klas.ConvertInt(klas.getdatacell(@"select count(TaxpayerID) from Taxpayer where Fordelete=1"));

        int sehifelemek = 1000;

        if (setrsayi > gelenx * sehifelemek - sehifelemek)
        {
            if (setrsayi < gelenx * sehifelemek)
            {
                sehifelemek = sehifelemek - (sehifelemek * gelenx - setrsayi);
            }



            DataTable dt = klas.getdatatable(@"select * from (select top " + sehifelemek + " * from (Select top " +
                                             klas.ConvertString(sehifelemek * gelenx) + " t1.SName+' '+t1.Name+' '+t1.FName as fullname," +
                                             " t1.YVOK,t1.ActualAdress,'mobil: '+t1.Mobiltel+N'; iş: '+t1.Workltel+'; ev: '+t1.Hometel telefon," +
                                             " case when t1.Concession=1 then N'Yox' else N'hə' end Guzesht," +
                                             " convert(nvarchar,t1.RegistrPetitondate,104) RegistrPetitondate, t1.TaxpayerID,t1.MunicipalID,lcm.MunicipalName,case when lr.CityID=2 then lr.Name+N' rayonu' when CityID=1 then lr.Name+N' şəhəri' end as RegionName  from Taxpayer t1 " +
                                             " inner join List_classification_Municipal lcm on t1.MunicipalID=lcm.MunicipalID " +
                                             " inner join List_classification_Regions lr on lcm.RegionID=lr.RegionsID where 1=1 and t1.Fordelete=1 " + s + ray + fizhuq +
                                             "  order by t1.TaxpayerID desc) as c order by TaxpayerID ) as cc order by TaxpayerID desc");

            DataListBaza.DataSource = dt;
            DataListBaza.DataBind();



            DataTable dt1 = klas.getdatatable(@"Select count(TaxpayerID) say,N'Yox: '+Convert(nvarchar,(Select count(TaxpayerID) cem from Taxpayer t1 inner join List_classification_Municipal lcm 
on t1.MunicipalID=lcm.MunicipalID where Concession=1 and t1.Fordelete=1 " + s + ray + fizhuq + ")) +'<br />'+  N'Hə: '+Convert(nvarchar,(Select count(TaxpayerID) cem from Taxpayer t2 " +
                                              " inner join List_classification_Municipal lcm on t2.MunicipalID=lcm.MunicipalID where Concession=2 and t2.Fordelete=1 " + f + ray + fizhuq1 + ")) heyox  from Taxpayer t " +
                                              " inner join List_classification_Municipal lcm on t.MunicipalID=lcm.MunicipalID where 1=1  and t.Fordelete=1 " + k + ray + fizhuq2);

            DataListCem.DataSource = dt1;
            DataListCem.DataBind();
        }
        else
        {
            DataListBaza.DataSource = null;
            DataListBaza.DataBind();

            DataListCem.DataSource = null;
            DataListCem.DataBind();
        }
    }