Example #1
0
    public DataTable GetPaymentList(string yvok, string passwordbld)
    {
        if (passwordbld == "=Bld2016dlB+")
        {
            Class2 conn = new Class2();
            yvok = seo.temizle(yvok);
            DataRow dr = conn.GetDataRow(@"Select * from taxpayer where YVOK = '" + yvok + "'");
            if (dr != null)
            {
                string    taxpayerID = dr["TaxpayerID"].ToString();
                MethotAll municipal  = new MethotAll();

                //  DataTable dt = new DataTable();
                // dt = municipal.GetTaxesObjects(taxpayerID);
                if (municipal.GetTaxesObjects(taxpayerID) != null)
                {
                    return(municipal.GetTaxesObjects(taxpayerID));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
        else
        {
            return(null);
        }
    }
Example #2
0
        public invoiceResponse GetInvoiceInfo(invoiceDefaultRequest InvoiceDefaultRequest)
        {
            //serhe alinan hisse evvel
            //    public invoiceResponse GetInvoiceInfo(int SCCode, string IdentificationSubtype, string AbonCode)
            //{
            //    invoiceDefaultRequest InvoiceDefaultRequest = new invoiceDefaultRequest();
            //    InvoiceDefaultRequest.abonCode = AbonCode;
            //    InvoiceDefaultRequest.scCode = SCCode;
            //    InvoiceDefaultRequest.identificationSubtype = IdentificationSubtype;
            //serhe alinan hisse son



            invoiceResponse invResp = new invoiceResponse();

            invResp.serviceAccountPartial          = new serviceAccountPartial();
            invResp.serviceAccountPartial.abonCode = InvoiceDefaultRequest.abonCode;
            invResp.serviceAccountPartial.scCode   = InvoiceDefaultRequest.scCode;
            invResp.serviceAccountPartial.identificationSubtype = InvoiceDefaultRequest.identificationSubtype;

            SqlConnection sqlcon = new SqlConnection();

            try
            {
                sqlcon.ConnectionString = SQLConnectionstring;
                sqlcon.Open();
            }
            catch (Exception ex)
            {
                System.IO.File.AppendAllText(Settings.Default.LogFileDirectory + "log" + DateTime.Now.ToString("yyyyMMdd") + ".txt",
                                             DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + " - Error : " + ex.Message.ToString() + Environment.NewLine + SQLConnectionstring + Environment.NewLine);
                errorType ert = new errorType();
                ert.errorCode       = errorCode.SYSTEM_ERROR;
                ert.errorDateTime   = DateTime.Now;
                ert.errorData       = new object[1];
                ert.errorData[0]    = messageHeaderValue.receiverID.ToString();
                ert.errorObjectType = objectType.SYSTEM;
                CustomSOAPException myexp = new CustomSOAPException("GetInvoiceInfo", ert);
                throw myexp;
            }



            SqlCommand ckcmd = new SqlCommand(@"select TaxpayerID from Taxpayer 
where YVOK=@YVOK  and Fordelete=1", sqlcon);

            ckcmd.Parameters.AddWithValue("@YVOK", InvoiceDefaultRequest.abonCode);
            SqlDataReader reader1 = ckcmd.ExecuteReader();



            if (!(reader1.HasRows) || !(reader1.Read()))
            {
                errorType ert = new errorType();
                ert.errorCode       = errorCode.NOT_FOUND;
                ert.errorDateTime   = DateTime.Now;
                ert.errorData       = new object[1];
                ert.errorData[0]    = InvoiceDefaultRequest.abonCode;
                ert.errorObjectType = objectType.SERVICE_ACCOUNT;

                CustomSOAPException myexp = new CustomSOAPException("GetInvoiceInfo", ert);
                sqlcon.Close();
                throw myexp;
            }
            reader1.Close();



            int[] ServiceCodeList = { 20000200 /*emlak*/,                          20000100 /*torpaq*/,     20000300 /*meden vergisi*/,
                                      20001000 /*Bələdiyyə mülkiyyətinin icarə*/,  20000500 /*reklam*/, 20000800 /*neqliyyat vas day*/, 20000700 /*Mehmanxana*/, 20000600 /*Stasionar*/,
                                      20000900 /*Bələdiyyə mülkiyyətinin özgə*/,  20000400 /*menfeet*/,          20001100 /*sanksiya*/, 20001200 /*iane*/ };


            string TaxpayerID = klas.getdatacell(@"select TaxpayerID from Taxpayer  
                where YVOK=N'" + InvoiceDefaultRequest.abonCode + "' and Fordelete=1");

            DataTable dt = new DataTable();

            if (TaxpayerID != null && ServiceCodeList.Length > 0)
            {
                dt = municipal.GetTaxesObjects(TaxpayerID, ServiceCodeList);
            }

            DataTableReader reader;

            reader = dt.CreateDataReader();
            int            cnt     = 0;
            List <invoice> invList = new List <invoice>();


            while (reader.Read())
            {
                int     colIndex;
                invoice inv = new invoice();


                colIndex = reader.GetOrdinal("InvoiceType");
                //invoiceType invtype = new invoiceType();
                //if (Enum.TryParse(reader[colIndex].ToString(), out  invtype))
                //{
                inv.invoiceType = invoiceType.AVANS;
                //}

                colIndex      = reader.GetOrdinal("AmountDue");
                inv.amountDue = reader.IsDBNull(colIndex) ?
                                0 : reader.GetDecimal(colIndex);
                inv.amountDueSpecified = true;



                colIndex        = reader.GetOrdinal("CurrentDebt");
                inv.currentDebt = reader.IsDBNull(colIndex) ?
                                  0 : reader.GetDecimal(colIndex);
                inv.currentDebtSpecified = true;


                colIndex = reader.GetOrdinal("PaymentReceiver");
                int paymentReceiver = 0;
                if (Int32.TryParse(reader[colIndex].ToString(), out paymentReceiver))
                {
                    inv.paymentReceiverCode          = paymentReceiver;
                    inv.paymentReceiverCodeSpecified = true;
                }

                colIndex = reader.GetOrdinal("ServiceCode");

                int serviceCode = 0;
                if (Int32.TryParse(reader[colIndex].ToString(), out serviceCode))
                {
                    inv.serviceCode          = serviceCode;
                    inv.serviceCodeSpecified = true;
                }

                //if (inv.currentDebt > 0)
                //{
                invList.Add(inv);
                cnt++;
                //}
            }

            sqlcon.Close();

            if (cnt > 0)
            {
                invResp.invoiceList = invList.ToArray();
            }



            System.IO.File.AppendAllText(Settings.Default.LogFileDirectory + "log" + DateTimeOffset.Now.ToString("yyyyMMdd") + ".txt",
                                         DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + " - INFO : " + DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:sszzz") + InvoiceDefaultRequest.abonCode.ToString() + Environment.NewLine);

            return(invResp);
        }
Example #3
0
    public DataTable GetPaymentListPincode(string Pincode, string passwordbld)
    {
        if (passwordbld == "=Bld2016dlB+")
        {
            Class2 conn = new Class2();
            Pincode = seo.temizle(Pincode);
            DataTable dt  = conn.getdatatable(@"Select * from taxpayer where Pincode = '" + Pincode + "' order by MunicipalName desc");
            DataTable dt2 = new DataTable();
            int       i   = 0;
            if (dt != null)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    string    taxpayerID = dr["TaxpayerID"].ToString();
                    MethotAll municipal  = new MethotAll();

                    DataTable dt1 = new DataTable();
                    // dt = municipal.GetTaxesObjects(taxpayerID);
                    if (municipal.GetTaxesObjects(taxpayerID) != null)
                    {
                        dt1 = municipal.GetTaxesObjects(taxpayerID);
                        i++;
                        if (i == 1)
                        {
                            dt2 = dt1;
                        }
                    }
                    else
                    {
                        dt1 = null;
                    }


                    if (i > 1)
                    {
                        if (dt1 != null)
                        {
                            for (int j = 0; j < dt1.Rows.Count; j++)
                            {
                                DataRow dr1 = dt2.NewRow();
                                dr1["RayonID"]      = dt1.Rows[j]["RayonID"].ToString();
                                dr1["BelediyyeID"]  = dt1.Rows[j]["BelediyyeID"].ToString();
                                dr1["RayonSheher"]  = dt1.Rows[j]["RayonSheher"].ToString();
                                dr1["Belediyye"]    = dt1.Rows[j]["Belediyye"].ToString();
                                dr1["OdeyiciID"]    = dt1.Rows[j]["OdeyiciID"].ToString();
                                dr1["OdeyiciAdi"]   = dt1.Rows[j]["OdeyiciAdi"].ToString();
                                dr1["VergiTipi"]    = dt1.Rows[j]["VergiTipi"].ToString();
                                dr1["VergiAdi"]     = dt1.Rows[j]["VergiAdi"].ToString();
                                dr1["Mebleg"]       = dt1.Rows[j]["Mebleg"].ToString();
                                dr1["HesabNomresi"] = dt1.Rows[j]["HesabNomresi"].ToString();
                                dr1["BankAdi"]      = dt1.Rows[j]["BankAdi"].ToString();
                                dt2.Rows.Add(dr1);
                            }
                        }
                    }
                }
                return(dt2);
            }
            else
            {
                return(null);
            }
        }
        else
        {
            return(null);
        }
    }