Search Results

Search found 30 results on 2 pages for 'programmerist'.

Page 2/2 | < Previous Page | 1 2 

  • MyController class must produce class according to the enum type.

    - by programmerist
    GenoTipController must produce class according to the enum type. i have 3 class: _Company,_Muayene,_Radyoloji. Also i have CompanyView Class GetPersonel method. if you look GenoTipController my codes need refactoring. Can you understand me? i need a class according to ewnum type must me produce class. For example; case DataModelType.Radyoloji it must return radyoloji= new Radyoloji . Everything must be one switch case? public class GenoTipController { public _Company GenerateCompany(DataModelType modeltype) { _Company company = null; switch (modeltype) { case DataModelType.Radyoloji: break; case DataModelType.Satis: break; case DataModelType.Muayene: break; case DataModelType.Company: company = new Company(); break; default: break; } return company; } public _Muayene GenerateMuayene(DataModelType modeltype) { _Muayene muayene = null; switch (modeltype) { case DataModelType.Radyoloji: break; case DataModelType.Satis: break; case DataModelType.Muayene: muayene = new Muayene(); break; case DataModelType.Company: break; default: break; } return muayene; } public _Radyoloji GenerateRadyoloji(DataModelType modeltype) { _Radyoloji radyoloji = null; switch (modeltype) { case DataModelType.Radyoloji: radyoloji = new Radyoloji(); break; case DataModelType.Satis: break; case DataModelType.Muayene: break; case DataModelType.Company: break; default: break; } return radyoloji; } } public class CompanyView { public static List GetPersonel() { GenoTipController controller = new GenoTipController(); _Company company = controller.GenerateCompany(DataModelType.Company); return company.GetPersonel(); } } public enum DataModelType { Radyoloji, Satis, Muayene, Company } }

    Read the article

  • How to make Entity Key Mapping in Entity Framework like sql's foreign key?

    - by programmerist
    I try to give entity map on my entity app. But how can I do it? I try to make it like below: var test = ( from k in Kartlar where k.Rehber..... above codes k.(can not see Rehber or not working ) if you are correct , i can write k.Rehber.ID and others. i can not write: from k in Kartlar where k.Rehber.ID = 123 //assuming that navigation property name is Rehbar and its primary key of Rehbar table is ID && k.Kampanya.ID = 345 //assuming that navigation property name is Kampanya and its primary //key of Kampanya table is ID && k.Birim.ID = 567 //assuming that navigation property name is Birim and its primary key of Birim table is ID select k images you can see: also: You should look : http://i42.tinypic.com/2nqyyc6.png I have a table it includes 3 foreign key field like that: My Table: Kartlar ID (Pkey) RehberID (Fkey) KampanyaID (Fkey) BrimID (Fkey) Name Detail How can i write entity query with LINQ ? select * from Kartlar where RehberID=123 and KampanyaID=345 and BrimID=567 BUT please be careful I can not see RehberID, KampanyaID, BrimID in entity they are foreign key. I should use entity key but how?

    Read the article

  • How can i get a file from remote machine?

    - by programmerist
    How can i get a file from remote computer? i know remote computer ip and 51124 port is open. i need this algorith: 1) Connect 192.xxx.x.xxx ip via 51124 port 2) filename:123456 (i want to search it on remote machine) 3) Get File 4) Save C:\ 51124 port is open. can i access and can i search any file according to filename? My code is below: IPEndPoint ipEnd = new IPEndPoint(IPAddress.Any, 51124); Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP); sock.Bind(ipEnd); sock.Listen(maxConnections); Socket serverSocket = sock.Accept(); byte[] data = new byte[bufferSize]; int received = serverSocket.Receive(data); int filenameLength = BitConverter.ToInt32(data, 0); string filename = Encoding.ASCII.GetString(data, 4, filenameLength); BinaryWriter bWrite = new BinaryWriter(File.Open(outPath + filename, FileMode.Create)); bWrite.Write(data, filenameLength + 4, received - filenameLength - 4); int received2 = serverSocket.Receive(data); while (received2 0) { bWrite.Write(data, 0, received2); received2 = serverSocket.Receive(data); } bWrite.Close(); serverSocket.Close(); sock.Close();

    Read the article

  • How to use Transaction in Entity FrameWork?

    - by programmerist
    How to use Transaction in Entity FrameWork? i read some links on Stackoverflow : http://stackoverflow.com/questions/815586/entity-framework-using-transactions-or-savechangesfalse-and-acceptallchanges BUT; i have 3 table so i have 3 entities: CREATE TABLE Personel (PersonelID integer PRIMARY KEY identity not null, Ad varchar(30), Soyad varchar(30), Meslek varchar(100), DogumTarihi datetime, DogumYeri nvarchar(100), PirimToplami float); Go create TABLE Prim (PrimID integer PRIMARY KEY identity not null, PersonelID integer Foreign KEY references Personel(PersonelID), SatisTutari int, Prim float, SatisTarihi Datetime); Go CREATE TABLE Finans (ID integer PRIMARY KEY identity not null, Tutar float); Personel, Prim,Finans my tables. if you look Prim table you can see Prim value float value if i write a textbox not float value my transaction must run. using (TestEntities testCtx = new TestEntities()) { using (TransactionScope scope = new TransactionScope()) { // do someyihng... testCtx.Personel.SaveChanges(); // do someyihng... testCtx.Prim.SaveChanges(); // do someyihng... testCtx.Finans.SaveChanges(); scope .Complete(); success = true; } } How can i do that?

    Read the article

  • How can i find and take in my local machine any file in remote machine?

    - by programmerist
    i try to write any codes. For example i have 2 machine: A computer, B computer. My local machine A computer. i also have sql data base . with "select * from" i can learn PatientID. ForExample PatientID :123456. But this patient's pictures file in B Computer.Picture File Name is equal to PatientID. B Computer ports is open for me. I can listen B Computer's 51124 port. How can i get Files from B machine via Port(But this files includes pics ). But this is Windows App. But i don't know files path. My program must find it automatically

    Read the article

< Previous Page | 1 2