public static bool LoadNewDeal(string sPath, string sStatus) { //Variables XmlDocument doc = new XmlDocument(); doc.Load(sPath); XmlNodeList xmlJobs = doc.GetElementsByTagName("command"); //Deal Import Variables string sOrgName = ""; string sTitle = ""; string sValue = ""; string sRep = ""; string sPerson = ""; string sEmail = ""; DealStatus dsStatus = new DealStatus { Status = DealStatus.dealStatus.Open }; if (xmlJobs.Count <= 0) { Console.WriteLine("ERROR:"); Console.WriteLine("There are no Jobs in the specified XML file."); Console.ReadLine(); return(true); } else { //Set the Deal Import Variables sOrgName = xmlJobs[0].SelectSingleNode("org_name").InnerText; sTitle = xmlJobs[0].SelectSingleNode("title").InnerText; sValue = xmlJobs[0].SelectSingleNode("value").InnerText; sRep = xmlJobs[0].SelectSingleNode("rep").InnerText; sPerson = xmlJobs[0].SelectSingleNode("client_name").InnerText; sEmail = xmlJobs[0].SelectSingleNode("email").InnerText; //Load global Deal object with values from FileMaker import g_User = new UserAPI(sRep); g_Deal.stage_id = g_User.GetStage(); g_Deal.title = sTitle; g_Deal.value = sValue.Replace("$", ""); //g_Deal.org_id = GetOrgID(sOrgName); if (sEmail.Contains(";")) { sEmail = sEmail.Substring(0, sEmail.IndexOf(";")); } g_Deal.person_id = GetPersonID(sEmail); //Hard Coded values for the Deal g_Deal.add_time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); g_Deal.status = dsStatus.StatusText; if (DealExists(sTitle)) { return(false); } else { return(true); } } }
public void Delete(DealStatus dealStatus) { var existed = _context.DealStatuses.Find(dealStatus.Id); _context.DealStatuses.Remove(existed); _context.SaveChanges(); }
public DealStatus UpdateDealStatus(int dealId, DealStatus status) { if (status == DealStatus.Delivered) { dealRepository.DeliveryDeal(dealId); } dealRepository.UpdateDealStatus(dealId, status); return(status); }
public int UpdateDealStatus(int submitId, DealStatus dealStatus) { var dbCommand = _dbHelper.GetStoredProcCommand(SP_ModifyDealStatus); _dbHelper.AddInParameter(dbCommand, "@SubmitId", System.Data.DbType.Int32, submitId); _dbHelper.AddInParameter(dbCommand, "@DealStatus", System.Data.DbType.Int32, dealStatus); _dbHelper.AddInParameter(dbCommand, "@ModifiedDate", System.Data.DbType.DateTime, DateTime.Now); return _dbHelper.ExecuteNonQuery(dbCommand); }
public void Update(DealStatus dealStatus) { var existed = _context .DealStatuses.Find(dealStatus.Id); existed.Name = dealStatus.Name; _context.SaveChanges(); }
public IEnumerable<Deal> Get(DealStatus dealStatus) { var url = "deals.xml?status=" + dealStatus.ToString().ToLower(); var response = _client.Execute<List<Deal>>(new RestRequest(url, Method.GET)); var deals = response.Data; foreach (var deal in deals) deal.LoadParties(response.Content); return deals; }
public IEnumerable <Deal> Get(DealStatus dealStatus) { var url = "deals.xml?status=" + dealStatus.ToString().ToLower(); var response = Client.Execute <List <Deal> >(new RestRequest(url, Method.GET)); var deals = response.Data; foreach (var deal in deals) { deal.LoadParties(response.Content); } return(deals); }
public bool UpdateStatus(int id, DealStatus dealStatus) { var request = new RestRequest(String.Format("deals/{0}/status.xml", id), Method.PUT) { XmlSerializer = new XmlIgnoreSerializer() }; request.AddParameter("text/xml", String.Format("<status><name>{0}</name></status>", dealStatus.ToString().ToLower()), ParameterType.RequestBody); var response = Client.Execute(request); return(response.StatusCode == HttpStatusCode.OK); }
public IHttpActionResult UpdateDealStatus(int dealId, int dealStatus) { try { if (dealStatus <= 0 || dealStatus > 4) { return(BadRequest($"Deal status incorrect")); } DealStatus status = (DealStatus)dealStatus; return(Ok(dealService.UpdateDealStatus(dealId, status))); } catch (InvalidOperationException) { return(BadRequest($"Deal with id {dealId} does not exists")); } }
public static void CreateDeal() { //Variables string sAPIToken = g_User.APIKey; string sURL = @"https://mcrae2.pipedrive.com/v1/deals?api_token=" + sAPIToken; RestClient rcClient = new RestClient(sURL); RestRequest rrRequest = new RestRequest(Method.POST); DealStatus dsStatus = new DealStatus { Status = DealStatus.dealStatus.Open }; //Execute Request try { //Add Header and Parameters rrRequest.AddJsonBody(g_Deal); //Execute Request IRestResponse <dynamic> rrResponse = rcClient.Execute <dynamic>(rrRequest); //Get response from API dynamic dResponse = JObject.Parse(rrResponse.Content); string s = dResponse.data.ToString(); dynamic dDeal = JObject.Parse(dResponse.data.ToString()); Console.WriteLine(); Console.WriteLine("Deal created successfully."); Console.WriteLine("Press Enter to close this window."); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine("ERROR:\n\tFunction: CreateDeal()"); Console.WriteLine("\t" + ex.Message); Console.ReadLine(); Environment.Exit(-1); } }
public int UpdateDealStatus(int submitId, DealStatus dealStatus) { Tracking(ActionType.Edit, ResourceType.EntrustCommand, submitId, dealStatus.ToString()); return(_entrustcmddao.UpdateDealStatus(submitId, dealStatus)); }
public void Insert(DealStatus dealStatus) { _context.DealStatuses.Add(dealStatus); _context.SaveChanges(); }
public void SetStatus(DealStatus status) { Status = status; }
public static string GetDealName(DealStatus status) { return(EnumAttributeHelper.GetEnumDescription <DealStatus>(status)); }
public static void UpdateStatus(int dealId, DealStatus status) { var deliveryDeal = deals.First(x => x.ID == dealId); deliveryDeal.DealStatus = status; }
public DealStatus UpdateDealStatus(int dealId, DealStatus status) { DealContainer.UpdateStatus(dealId, status); return(status); }
public bool UpdateStatus(int id, DealStatus dealStatus) { var request = new RestRequest(String.Format("deals/{0}/status.xml", id), Method.PUT) { XmlSerializer = new XmlIgnoreSerializer() }; request.AddParameter("text/xml", String.Format("<status><name>{0}</name></status>", dealStatus.ToString().ToLower()), ParameterType.RequestBody); var response = _client.Execute(request); return response.StatusCode == HttpStatusCode.OK; }