private void AddQuotes(List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne> objLst) { var repId = Convert.ToInt32(RepNameDropDownList.SelectedValue); var listRecentAddedQuotes = new List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne>(); if (repId > 0) { var numberAccount = Convert.ToInt32(NumberAccountDropDownList.SelectedValue); var allocTime = GetAllocationTime(); var currentDate = DateTime.Now; var comDal = new QuoteDAL(CONNSTRING); Random rnd = new Random(); for (var i = 0; i < numberAccount; i++) { var newAccountQuote = GetNewRecentQuote(objLst, repId); if (newAccountQuote != null) { listRecentAddedQuotes.Add(newAccountQuote); comDal.InsertQuoteAllocate(newAccountQuote.QuoteId, repId, currentDate, allocTime); } } Session["recentAddedQuotes"] = listRecentAddedQuotes; } else { messagelable.Text = "Please Select Rep"; } }
private void GetQuoteCompaniesByQuoteId(List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne> objLst, int companyId, int repId, DateTime allocTime) { var listQuotesByCOmpaies = new List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne>(); listQuotesByCOmpaies = (from lis in objLst where lis.CompanyId == companyId select lis).ToList(); if (listQuotesByCOmpaies.Count() > 0) { string CONNSTRING = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var currentDate = DateTime.Now; var comDal = new QuoteDAL(CONNSTRING); Random rnd = new Random(); var listQuotesAllocate = comDal.GetAssignQuotes(); for (var i = 0; i < listQuotesByCOmpaies.Count(); i++) { if (listQuotesAllocate.Any(x => x.QuoteId == listQuotesByCOmpaies[i].QuoteId && x.ExpiryDate.Date > currentDate.Date)) { } else { comDal.InsertQuoteAllocate(listQuotesByCOmpaies[i].QuoteId, repId, currentDate, allocTime); } } } }
private DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne GetNewRecentQuote(List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne> coViewAll, int repId) { var comDal = new QuoteDAL(CONNSTRING); var listQuotesAllocate = comDal.GetAssignQuotes(); Random rnd = new Random(); var currentDate = DateTime.Now; var pickedCom = coViewAll.OrderBy(x => rnd.Next()).Take(1).ToList(); if (pickedCom.Count > 0) { var pickedObj = pickedCom[0]; if (listQuotesAllocate.Any(x => x.QuoteId == pickedObj.QuoteId && x.ExpiryDate.Date > currentDate.Date)) { return(GetNewRecentQuote(coViewAll, repId)); } else if (listQuotesAllocate.Any(x => x.QuoteId == pickedObj.QuoteId && x.UserId == repId)) { return(GetNewRecentQuote(coViewAll, repId)); } else { return(pickedObj); } } return(null); }
private void AddQuotes(List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne> objLst, string numberOfAccount, string allocationPeriod, int RepId) { var repId = RepId; string CONNSTRING = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var listRecentAddedQuotes = new List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne>(); if (repId > 0) { var numberAccount = Convert.ToInt32(numberOfAccount); var allocTime = GetAllocationTime(allocationPeriod); var currentDate = DateTime.Now; var comDal = new QuoteDAL(CONNSTRING); Random rnd = new Random(); for (var i = 0; i < numberAccount; i++) { var newAccountQuote = GetNewRecentQuote(objLst, repId); if (newAccountQuote != null) { listRecentAddedQuotes.Add(newAccountQuote); comDal.InsertQuoteAllocate(newAccountQuote.QuoteId, repId, currentDate, allocTime); GetQuoteCompaniesByQuoteId(objLst, newAccountQuote.CompanyId, repId, allocTime); } } } }
private DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne GetNewRecentQuote(List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne> coViewAll, int repId) { string CONNSTRING = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var comDal = new QuoteDAL(CONNSTRING); var listQuotesAllocate = comDal.GetAssignQuotes(); Random rnd = new Random(); var currentDate = DateTime.Now; var pickedCom = coViewAll.OrderBy(x => rnd.Next()).Take(1).ToList(); if (pickedCom.Count > 0) { var pickedObj = pickedCom[0]; if (listQuotesAllocate.Any(x => x.QuoteId == pickedObj.QuoteId && x.ExpiryDate.Date > currentDate.Date)) { return(GetNewRecentQuote(coViewAll, repId)); } //else // if (listCompanylead.Any(x => x.CompanyId == pickedObj.CompanyID // && x.UserId == repId)) // { // return GetNewCompaySel(coViewAll, repId); // } else { return(pickedObj); } } return(null); }
protected void btn_undoClickEvent(object sender, EventArgs e) { if (Session["recentAddedQuotes"] != null) { var listQuotes = Session["recentAddedQuotes"] as List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne>; var qtDal = new QuoteDAL(CONNSTRING); var repId = Convert.ToInt32(RepNameDropDownList.SelectedValue); if (repId > 0) { qtDal.DeleteQuoteRecentAllocate(listQuotes, repId); Session["recentAddedQuotes"] = null; undoButton.Visible = false; messagelable.Text = "Successfully Deleted."; } } }
protected void Page_Load(object sender, EventArgs e) { //Xero Model Create Contact Unit Test XeroIntergration xero = new XeroIntergration(); //Create Contact //Repository repos = xero.CreateRepository(); // XeroApi.Model.Contact DeltoneContact ; // XeroApi.Model.Item item; //DeltoneContact = xero.CreateContact(repos, "DeltoneTestCompan_5", "Shehan", "Peris", "4", "61", "2434684", String.Empty, String.Empty, String.Empty, "4", "61", "123456", "*****@*****.**", "12 Kauri Grove", "Spingwale", "Australia", "3150", "VIC", "26 Tamarisk Avenue", "Glen waverley", "Australia", "3150", "VIC"); //Response.Write(DeltoneContact.ContactID);//Fetch the Contact ID Created in Xero System .store it in the Dletone Contact Table //Fetch the Contact by Guid //DeltoneContact = xero.findContact(repos, "7B08CAB7-7157-4EFC-954C-59B3FC43F7C5"); //Response.Write(DeltoneContact.FirstName); //Deltone Test Create Item //xero.CreateItem(repos, "DeltoneItem", "DeltoneTestDescription", (Decimal)salesUnitPrice, (Decimal)purchaseunitPrice); //Deltone Update Item //Update an Invoice String strGuid = "adsfhajhsdfkjhajdshf"; //xero.UpdtateInvoice(repos, strGuid); //XeroIntergration xero = new XeroIntergration(); //Repository repos = xero.CreateRepository(); String Guid = "4dc4e979-11e5-4994-a6a9-912c102d3a13";// Expected value //String companyname = "REGIONAL SERVICES AUSTRALIA PTY LTD"; String companyname = "AUSJET"; // string ActualValue = xero.findContactByName(repos, companyname); //Actual Value QuoteDAL quote = new QuoteDAL(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString); // var sss = quote.GetAllQuotesByCompany(176); //360 // var testName = "Janine O'Connell"; // var ttt= testName.Insert(8, "\\"); var tttt = new CallNDataHandler(); // tttt.TestFileDownload(); var mmm = new RepDayOffDAL(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString); var obj = new StatsTargetConfig() { IsReached = false, TargetAmount = 7000, TargetDay = DateTime.Now.AddDays(2), TargetTitle = "Lunch Target" }; // mmm.InsertIntoTargetConfig(obj, 1); // var result = mmm.GetAllTargetItems(); //mmm.DeleteTargetConfig(2); // mmm.UpdateTargetConfig(5, true); var ddd = new CreditNoteRMAHandler(ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString); // var nnn= ddd.GetRMANotesById(100); // SendMail(); SendCreditCardNotificationEmail(0); }
public static string GetRandomQuote() { return(QuoteDAL.GetRandomQuote()); }
public static void AddQuotes(String Quote) { QuoteDAL.AddQuotes(Quote); }
public static DataTable LoadQuotes() { return(QuoteDAL.LoadQuotes()); }