NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StokAndCustomerRest
{
class StokAndCustomerService : IStokAndCustomerService
{
string connectionstringx = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
SqlConnection con;
SqlDataAdapter da;
DataTable dt;
public int KullaniciGirisi(string kullaniciadi, string sifre)
{
try
{
con = new SqlConnection(connectionstringx);
da = new SqlDataAdapter("Select * from Users where UserName='" + kullaniciadi + "' and Password='" + sifre + "' ", con);
dt = new DataTable();
da.Fill(dt);


if (dt.Rows.Count == 1)
{
return int.Parse(dt.Rows[0]["UserID"].ToString());
}
else
{
return 0;
}
}
catch (Exception)
{

return 0;
}
}

public List<Customers> CustomersList()
{
// herşey
con = new SqlConnection(connectionstringx);
da = new SqlDataAdapter("Select * from Customers", con);
dt = new DataTable();
da.Fill(dt);

List<Customers> Lc1 = new List<Customers>();

foreach (DataRow item in dt.Rows)
{
Customers c1 = new Customers();
c1.CustomerID =int.Parse(item["CustomerId"].ToString());
c1.FirstName = item["FirstName"].ToString();
c1.Name = item["Name"].ToString();
c1.Phone = item["Phone"].ToString();
c1.Mail = item["Mail"].ToString();
c1.Address = item["Address"].ToString();
c1.Note = item["Note"].ToString();
c1.CreadionDate = item["CreadionDate"].ToString();
Lc1.Add(c1);
}
return Lc1;

}

public List<Products> ProductsList()
{
// herşey
con = new SqlConnection(connectionstringx);
da = new SqlDataAdapter("Select * from Products", con);
dt = new DataTable();
da.Fill(dt);

List<Products> Lp1 = new List<Products>();

foreach (DataRow item in dt.Rows)
{
Products p1 = new Products();
p1.ProductID = int.Parse(item["ProductId"].ToString());
p1.ProductName = item["ProductName"].ToString();
p1.ProductDetail = item["ProductDetail"].ToString();
p1.Quantity = int.Parse(item["Quantity"].ToString());
p1.Pazarlama = item["Pazarlama"].ToString();
p1.Perakende = item["Perakende"].ToString();
p1.Price = item["Price"].ToString();
Lp1.Add(p1);
}
return Lp1;
}

public List<Expenses> ExpensesList()
{
con = new SqlConnection(connectionstringx);
da = new SqlDataAdapter("Select * from Expenses", con);
dt = new DataTable();
da.Fill(dt);

List<Expenses> Le1 = new List<Expenses>();

foreach (DataRow item in dt.Rows)
{
Expenses e1 = new Expenses();
e1.ExpensID = int.Parse(item["ExpensID"].ToString());
e1.Explain = item["Explain"].ToString();
e1.ExpensDate = item["ExpensDate"].ToString();
e1.Price =item["Price"].ToString();

Le1.Add(e1);
}
return Le1;
}

public List<Products> StockList()
{
con = new SqlConnection(connectionstringx);
da = new SqlDataAdapter("Select * from Products", con);
dt = new DataTable();
da.Fill(dt);

List<Products> Lp1 = new List<Products>();

foreach (DataRow item in dt.Rows)
{
Products p1 = new Products();
p1.ProductID = int.Parse(item["ProductID"].ToString());
p1.ProductName = item["ProductName"].ToString();
p1.ProductDetail = item["ProductDetail"].ToString();
p1.Quantity = int.Parse(item["Quantity"].ToString());
p1.Price= item["Price"].ToString(); ;

Lp1.Add(p1);
}
return Lp1;
}

public void SlipList()
{



}
}

}

----

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;

namespace StokAndCustomerRest
{
[ServiceContract]
public interface IStokAndCustomerService
{
[WebGet(UriTemplate = "KullaniciGirisi?kullaniciadi={kullaniciadi}&sifre={sifre}", ResponseFormat =WebMessageFormat.Json)]
[OperationContract]
int KullaniciGirisi(string kullaniciadi, string sifre);


[WebGet(UriTemplate = "CustomersList", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Customers> CustomersList(); // Müşteri Listesi

[WebGet(UriTemplate = "ProductsList", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Products> ProductsList(); // Ürün Listesi (products)

[WebGet(UriTemplate = "ExpensesList", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Expenses> ExpensesList(); // Gider Listesi (explein)

[WebGet(UriTemplate = "StockList", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List<Products> StockList(); // Ürün Stok Listesi (products)

[WebGet(UriTemplate = "SlipList", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
void SlipList(); // Fiş Listesi Slips ve slipdetails tablosu birleşicek
}

[DataContract]
public class Customers
{
[DataMember]
public int CustomerID { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string FirstName { get; set; }
[DataMember]
public string Phone { get; set; }
[DataMember]
public string Mail { get; set; }
[DataMember]
public string Address { get; set; }
[DataMember]
public string Note { get; set; }
[DataMember]
public string CreadionDate { get; set; }
}
[DataContract]
public class Expenses
{
[DataMember]
public int ExpensID { get; set; }
[DataMember]
public string Explain { get; set; }
[DataMember]
public string ExpensDate { get; set; }
[DataMember]
public string Price { get; set; }
}


[DataContract]
public class Products
{
[DataMember]
public int ProductID { get; set; }
[DataMember]
public string ProductName { get; set; }
[DataMember]
public string ProductDetail { get; set; }
[DataMember]
public int Quantity { get; set; }
[DataMember]
public string Pazarlama { get; set; }
[DataMember]
public string Perakende { get; set; }
[DataMember]
public string Price { get; set; }
}


[DataContract]
public class SlipDetail
{
[DataMember]
public int SlipDetailId { get; set; }
[DataMember]
public int SlipId { get; set; }
[DataMember]
public int ProductId { get; set; }
[DataMember]
public int Adet { get; set; }
[DataMember]
public string ToplamFiyat { get; set; }
}


[DataContract]
public class Slips
{
[DataMember]
public int SlipId { get; set; }
[DataMember]
public int CustomerId { get; set; }
[DataMember]
public int State { get; set; }
[DataMember]
public string CredionalDate { get; set; }
[DataMember]
public string NetTutar { get; set; }
[DataMember]
public string OdenenTutar { get; set; }
[DataMember]
public string KalanTutar { get; set; }
}


[DataContract]
public class Users
{
[DataMember]
public int UserID { get; set; }
[DataMember]
public string UserName { get; set; }
[DataMember]
public string UserLastName { get; set; }
[DataMember]
public int UserType { get; set; }
[DataMember]
public string Pass { get; set; }
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.