public IHttpActionResult AddContractDWGS(ContractDWGS contractDWGS) { SortedDictionary <string, string> sd = new SortedDictionary <string, string>() { }; sd.Add("@ProejctId", contractDWGS.ProjectId); sd.Add("@fileName", contractDWGS.FileName); sd.Add("@timeStamp", contractDWGS.TImeStamp); RDSService.RDSService rdsService = new RDSService.RDSService(); DataSet retvalue = rdsService.SelectList("USP_InsertContractDWGS", "ContractDWGSId", sd); var ContractDWGSId = retvalue.Tables[0].Rows[0][0].ToString(); return(Ok(ContractDWGSId)); }
public IHttpActionResult DeleteContractDWGS(ContractDWGS contractDWGS) { if (contractDWGS == null) { return(BadRequest()); } SortedDictionary <string, string> sd = new SortedDictionary <string, string>() { }; sd.Add("@ProejctId", contractDWGS.ProjectId); sd.Add("@ContractId", contractDWGS.ContractDrawingId); RDSService.RDSService rdsService = new RDSService.RDSService(); DataSet retvalue = rdsService.SelectList("USP_DeleteContractDWGS", sd); return(Ok(retvalue)); }
public IHttpActionResult GetContractDWGS(string projectId) { SortedDictionary <string, string> sd = new SortedDictionary <string, string>() { }; sd.Add("@ProejctId", projectId.ToString()); RDSService.RDSService rdsService = new RDSService.RDSService(); DataSet ds = rdsService.SelectList("USP_GetContractDWGS", sd); var contractDwgs = new List <ContractDWGS>(); if (ds != null && ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { var drawings = new ContractDWGS { ProjectId = dr[0].ToString(), ContractDrawingId = dr[1].ToString(), FileName = dr[2].ToString(), TImeStamp = dr[3].ToString() }; contractDwgs.Add(drawings); } } return(Ok(contractDwgs)); }