protected string ReturnAllItems() { String strOutput = "{\"aaData\":["; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); var targetConfigs = repDayOffDal.GetAllTargetItems(); foreach (var item in targetConfigs) { String strEdit = "<img src='../../Images/Edit.png' onclick='Delete(" + item.Id + ")'/>"; strOutput = strOutput + "[\"" + item.Id + "\"," + "\"" + item.TargetTitle + "\"," + "\"" + Math.Truncate(item.TargetAmount) + "\"," + "\"" + item.TargetDay.ToString("dd-MM-yyyy") + "\"," + "\"" + strEdit + "\"],"; } if (targetConfigs.Count() > 0) { int Length = strOutput.Length; strOutput = strOutput.Substring(0, (Length - 1)); } strOutput = strOutput + "]}"; return(strOutput); }
protected string ReturnAllItems(string repId, string tarId) { String strOutput = "{\"aaData\":["; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); var listDayOffs = repDayOffDal.GetRepDayOffByRepIdANdTarId(Convert.ToInt32(repId), Convert.ToInt32(tarId)); foreach (var item in listDayOffs) { var apprAtat = "N"; if (item.IsApproved) { apprAtat = "Y"; } String strEdit = "<img src='../../Images/Edit.png' onclick='Delete(" + item.Id + ")'/>"; strOutput = strOutput + "[\"" + item.Id + "\"," + "\"" + item.DayOff.ToString("dd-MM-yyyy") + "\"," + "\"" + apprAtat + "\"," + "\"" + strEdit + "\"],"; } if (listDayOffs.Count() > 0) { int Length = strOutput.Length; strOutput = strOutput.Substring(0, (Length - 1)); } strOutput = strOutput + "]}"; return(strOutput); }
public static void DeleteRecordCS(int csId) { string cs = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL dal = new RepDayOffDAL(cs); dal.DeleteAtteName(csId); }
protected string ReturnAllItems(string year, string month) { String strOutput = "{\"aaData\":["; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); var monCon = Convert.ToInt32(month); var yerCon = Convert.ToInt32(year); var listDayOffs = repDayOffDal.GetAusHoliday(); listDayOffs = (from li in listDayOffs where li.Month == monCon && li.Year == yerCon select li).ToList(); foreach (var item in listDayOffs) { String strEdit = "<img src='../../Images/Edit.png' onclick='Delete(" + item.Id + ")'/>"; strOutput = strOutput + "[\"" + item.Id + "\"," + "\"" + item.HolidayDate.ToString("dd-MM-yyyy") + "\"," + "\"" + strEdit + "\"],"; } if (listDayOffs.Count() > 0) { int Length = strOutput.Length; strOutput = strOutput.Substring(0, (Length - 1)); } strOutput = strOutput + "]}"; return(strOutput); }
protected string ReturnAllItems() { String strOutput = "{\"aaData\":["; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL dal = new RepDayOffDAL(connString); var getallNames = dal.GetAttendanceReps(); var count = 0; foreach (var item in getallNames) { count = count + 1; string c = "<img src='../Images/error.png' onclick='DeleteCal(" + item.Id + ")'/>"; strOutput = strOutput + "[\"" + item.Id + "\"," + "\"" + item.Name + "\"," + "\"" + c + "\"],"; } if (getallNames.Count() > 0) { int Length = strOutput.Length; strOutput = strOutput.Substring(0, (Length - 1)); } strOutput = strOutput + "]}"; return(strOutput); }
public string HandleConfigTarget() { string re = ""; var connectionString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var targetConfig = new RepDayOffDAL(connectionString); var listConfig = targetConfig.GetAllTargetItems(); var currentDay = DateTime.Now.Date; listConfig = (from cons in listConfig where cons.TargetDay.Date == currentDay select cons).ToList(); if (listConfig.Count() > 0) { getRepName(); re = listConfig[0].TargetTitle + "," + Math.Truncate(listConfig[0].TargetAmount); } float dailyVolume = 0.0f; foreach (var pair in di_getStat) { obj_Contact = (DelReport_Contact)pair.Value; String repName = obj_Contact.FirstName + " " + obj_Contact.LastName; dailyVolume = dailyVolume + getDailyVolume(repName); } if (!string.IsNullOrEmpty(re)) { re = re + "," + dailyVolume + "," + listConfig[0].Id + "," + listConfig[0].IsReached; } return(re); }
protected void Page_Load(object sender, EventArgs e) { String strFirstName = Request.Form["NewFirstName"].ToString(); var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL dal = new RepDayOffDAL(connString); dal.InsertRepAttendance(strFirstName); Response.Write("OK"); }
public string DeleteTargetConfig(string targetConfigId) { var retur = "OK"; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); repDayOffDal.DeleteTargetConfig(Convert.ToInt32(targetConfigId)); return(retur); }
public string DeleteRepDayOffItem(string dayOffId) { var retur = "OK"; var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); repDayOffDal.DeleteHolidayByMonth(Convert.ToInt32(dayOffId)); return(retur); }
public string UpdateTargetConfig(int configId) { var connectionString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var retur = "OK"; var targetConfig = new RepDayOffDAL(connectionString); var isreached = true; targetConfig.UpdateTargetConfig(configId, isreached); return(retur); }
public void InsertDayOff(string dayOff, int targetId, int repId, bool approved) { var dayoffdate = Convert.ToDateTime(dayOff).ToString("yyyy-MM-dd"); var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL repDayOffDal = new RepDayOffDAL(connString); var userId = Convert.ToInt32(Session["LoggedUserID"].ToString()); var dateTimeDayOff = Convert.ToDateTime(dayoffdate); var obj = new RepDayOff() { CreatedDate = DateTime.Now, CreateduserId = userId, UserId = repId, DayOff = dateTimeDayOff, TargetId = targetId, IsApproved = approved }; repDayOffDal.InsertRepDayOff(obj); }
protected void Page_Load(object sender, EventArgs e) { Int32 yea = Int32.Parse(Request.Form["Year"].ToString()); Int32 mon = Int32.Parse(Request.Form["Month"].ToString()); var holDay = Convert.ToDateTime(Request.Form["holiday"].ToString()); var holDayAus = Convert.ToDateTime(holDay).ToString("yyyy-MM-dd"); var conn = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var ausHol = Convert.ToDateTime(holDayAus); var ausHolidayObj = new AusHoliday() { CreatedDate = DateTime.Now, Month = mon, Year = yea, HolidayDate = ausHol }; RepDayOffDAL dal = new RepDayOffDAL(conn); dal.InsertHolidayByMonth(ausHolidayObj); Response.Write("Ok"); }
protected void Page_Load(object sender, EventArgs e) { var targetTitle = Request.Form["targettitle"].ToString(); var targetDay = Convert.ToDateTime(Request.Form["targetday"].ToString()); var targetAmount = Convert.ToDecimal(Request.Form["targetamount"].ToString()); var conn = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; var targetHndler = new RepDayOffDAL(conn); var targetObj = new StatsTargetConfig() { IsReached = false, TargetAmount = targetAmount, TargetDay = targetDay, TargetTitle = targetTitle }; var userid = Convert.ToInt32(Session["LoggedUserID"].ToString()); targetHndler.InsertIntoTargetConfig(targetObj, userid); Response.Write("Ok"); }
private List <string> SetRepList() { var listRep = new List <string>(); //listRep.Add("AIDAN"); //listRep.Add("BAILEY"); listRep.Add("BRENDAN"); listRep.Add("DIMITRI"); listRep.Add("EMMA"); //listRep.Add("JOHN"); listRep.Add("KRIT"); listRep.Add("TARAS"); //listRep.Add("CHRISTINE"); listRep.Add("ALEC"); listRep.Add("JOE"); //listRep.Add("JOSIAH"); listRep.Add("LACHLAN"); listRep.Add("PHIL"); listRep.Add("FARAH"); listRep.Add("ACCOUNTS"); //listRep.Add("TRENT"); listRep.Add("PARTI"); //listRep.Add("SOPHIE"); var connString = ConfigurationManager.ConnectionStrings["ConnStringDeltoneCRM"].ConnectionString; RepDayOffDAL dal = new RepDayOffDAL(connString); var listRepa = dal.GetAttendanceReps(); foreach (var item in listRepa) { listRep.Add(item.Name); } return(listRep); }
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); }