/*public override void drawInLine(util.SpriteBatchWrapper sprites, int line) { base.drawInLine(sprites, line); if (this.active) { int y = sprites.getYForTextLine(line + 1); int x = 75; foreach (MenuItem item in this.items) { sprites.drawTextAt(item.title, x, y, .8f, item.isSelected() ? Color.Orange : Color.GhostWhite); x += sprites.getWidthOfText(item.title, .8f); x += 15; } } }*/ /*public override int getLineSize() { int size = base.getLineSize(); if (this.active) { size += 2; } return size; }*/ public override void drawFromCenter(util.SpriteBatchWrapper sprites, int x, int y) { base.drawFromCenter(sprites, x, y); if (this.active) { int width = 0; foreach (MenuItem item in this.items) { width += sprites.getWidthOfText(item.title, 1.0f, SubMenu.FONTNAME); width += 15; } width -= 15; int submenuX = x - width / 2; int submenuY = y + this.texture.bounds.Height; int textHeight = sprites.getHeightOfText("FOO", 1.0f, SubMenu.FONTNAME); int backdropY = submenuY - 3; sprites.drawColorAt(Color.Black, .3f, width +10, textHeight + 6, submenuX - 5, backdropY); foreach (MenuItem item in this.items) { sprites.drawTextAt(item.title, submenuX, submenuY, 1.0f, item.isSelected() ? Color.Orange : Color.GhostWhite, SubMenu.FONTNAME); submenuX += sprites.getWidthOfText(item.title, 1.0f, SubMenu.FONTNAME); submenuX += 15; } } }
public List <BEReportCategoryByProgramationView> GetCategoryByProgramation(int year, int month, int headquartersId, int dietId) { BEReportCategoryByProgramationView _vE_Programation = null; List <BEReportCategoryByProgramationView> _lstProgramation = new List <BEReportCategoryByProgramationView>(); Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("_headquartersId", (headquartersId == 0) ? DBNull.Value : (object)headquartersId); parameters.Add("_dietId", (dietId == 0) ? DBNull.Value : (object)dietId); parameters.Add("_month", (month == 0) ? DBNull.Value : (object)month); parameters.Add("_year", (month == 0) ? DBNull.Value : (object)year); util _util = new util(); var rows = _database.QuerySP("receta_sp_GetCategoryByProgramation", parameters); foreach (var row in rows) { _vE_Programation = new BEReportCategoryByProgramationView(); _vE_Programation.week = string.IsNullOrEmpty(row["week"]) ? 0 : int.Parse(row["week"]); _vE_Programation.strInitialDate = string.IsNullOrEmpty(row["strInitialDate"]) ? string.Empty: row["strInitialDate"]; _vE_Programation.strFinalDate = string.IsNullOrEmpty(row["strFinalDate"]) ? string.Empty : row["strFinalDate"]; _vE_Programation.categoryId = string.IsNullOrEmpty(row["categoryId"]) ? 0 : int.Parse(row["categoryId"]); _vE_Programation.category = string.IsNullOrEmpty(row["category"]) ? string.Empty : row["category"]; _vE_Programation.subtotal = string.IsNullOrEmpty(row["subtotal"]) ? 0 : decimal.Parse(row["subtotal"]); _vE_Programation.percent = string.IsNullOrEmpty(row["percent"]) ? 0 : decimal.Parse(row["percent"]); _lstProgramation.Add(_vE_Programation); } return(_lstProgramation); }
public void getdata(string cangkubiaohao) { util util = new util(); DataTable dt = new DataTable(); dt = util.getdata(cangkubiaohao); this.gridControl1.DataSource = dt; gridControl1.DataSource = dt; }
public menu() { this.Load += new EventHandler(this.Menu_Load); this.HasConnected = false; this.cnn = new SqlConnection(); this.usua = "TEVOC"; this.dia_hoy = DateAndTime.Today; this.men = new MenuItem(); this.a = checked (Screen.PrimaryScreen.Bounds.Height - 50); this.l = checked (Screen.PrimaryScreen.Bounds.Width - 5); this.cs = new util(); this.hoy = DateAndTime.Today; this.InitializeComponent(); }
private void llena_produccion() { util util = new util(); int e = 0; do { this.cnn.ConnectionString = util.con_string(e); this.produccion(this.cnn); checked { ++e; } }while (e <= 2); this.crea_columna("TOTALES"); this.totales(); }
public static string ConvertExelToPDF(string b_file) { //b_file = HttpContext.Current.Server.MapPath("~") + b_file; string partShare = WebConfigurationManager.AppSettings["ServerLinkFile"]; string LinkServerLocal = WebConfigurationManager.AppSettings["ServerLocal"]; util a = new util(); if (!File.Exists(b_file)) { return(string.Empty); } string ex = ".xls"; if (b_file.IndexOf(".xlsx") > 0) { ex = ".xlsx"; } string b_out = b_file.Replace(ex, ".pdf"); if (File.Exists(b_out)) { //b_out = b_out.Replace(HttpContext.Current.Server.MapPath("~"), string.Empty); if (!string.IsNullOrEmpty(LinkServerLocal)) { b_out = b_out.Replace(LinkServerLocal, string.Empty); } else { b_out = b_out.Replace("////" + partShare, string.Empty); } return(b_out); } a.ConvertXLSToPdf(b_file, b_out, System.Drawing.Printing.PaperKind.A3); if (!string.IsNullOrEmpty(LinkServerLocal)) { b_out = b_out.Replace(LinkServerLocal, string.Empty); } else { b_out = b_out.Replace("////" + partShare, string.Empty); } //b_out = b_out.Replace(HttpContext.Current.Server.MapPath("~"), string.Empty); return(b_out); }
public List <VE_ProgramationDetail> GetProgramationDetailResumen(int year, int month, int headquartersId, int dietId) { VE_ProgramationDetail _vE_ProgramationDetail = null; List <VE_ProgramationDetail> _lstProgramationDetail = new List <VE_ProgramationDetail>(); Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("_headquartersId", (headquartersId == 0) ? DBNull.Value : (object)headquartersId); parameters.Add("_dietId", (dietId == 0) ? DBNull.Value : (object)dietId); parameters.Add("_month", (month == 0) ? DBNull.Value : (object)month); parameters.Add("_year", (year == 0) ? DBNull.Value : (object)year); util _util = new util(); var rows = _database.QuerySP("sp_getProgramationDetailResumen", parameters); foreach (var row in rows) { _vE_ProgramationDetail = new VE_ProgramationDetail(); _vE_ProgramationDetail.programationId = string.IsNullOrEmpty(row["programationId"]) ? 0 : int.Parse(row["programationId"]); _vE_ProgramationDetail.date = string.IsNullOrEmpty(row["date"]) ? DateTime.Now : DateTime.Parse(row["date"]); _vE_ProgramationDetail.dateFormat = _vE_ProgramationDetail.date.ToShortDateString(); _vE_ProgramationDetail.dayOfWeek = _vE_ProgramationDetail.date.DayOfWeek; _vE_ProgramationDetail.dayOfMonth = _vE_ProgramationDetail.date.Day; _vE_ProgramationDetail.weekOfMonth = _util.GetWeekOfMonth(_vE_ProgramationDetail.date).WeekOfMonth; _vE_ProgramationDetail.productCost = string.IsNullOrEmpty(row["productCost"]) ? 0 : decimal.Parse(row["productCost"]); _vE_ProgramationDetail.productId = string.IsNullOrEmpty(row["productId"]) ? 0 : int.Parse(row["productId"]); _vE_ProgramationDetail.productKcal = string.IsNullOrEmpty(row["productKcal"]) ? 0 : int.Parse(row["productKcal"]); _vE_ProgramationDetail.productCategoryId = string.IsNullOrEmpty(row["productCategoryId"]) ? 0 : int.Parse(row["productCategoryId"]); _vE_ProgramationDetail.productCategoryName = row["productCategoryName"]; _vE_ProgramationDetail.productName = row["productName"]; _vE_ProgramationDetail.headquartersName = row["headquartersName"]; _vE_ProgramationDetail.dietName = row["dietName"]; _vE_ProgramationDetail.quantity = string.IsNullOrEmpty(row["quantity"]) ? 0 : decimal.Parse(row["quantity"]); _lstProgramationDetail.Add(_vE_ProgramationDetail); } return(_lstProgramationDetail); }
public List <BEReportPodructCategoryByProgramationView> GetProductByCategoryByProgramation(int productCategoryId, int year, int month, int headquartersId, int dietId, int week) { BEReportPodructCategoryByProgramationView _vE_Programation = null; List <BEReportPodructCategoryByProgramationView> _lstProgramation = new List <BEReportPodructCategoryByProgramationView>(); Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("_productCategoryId", (productCategoryId == 0) ? DBNull.Value : (object)productCategoryId); parameters.Add("_headquartersId", (headquartersId == 0) ? DBNull.Value : (object)headquartersId); parameters.Add("_dietId", (dietId == 0) ? DBNull.Value : (object)dietId); parameters.Add("_month", (month == 0) ? DBNull.Value : (object)month); parameters.Add("_year", (year == 0) ? DBNull.Value : (object)year); parameters.Add("_week", (week == 0) ? DBNull.Value : (object)week); util _util = new util(); var rows = _database.QuerySP("receta_sp_GetProductByCategoryByProgramation", parameters); foreach (var row in rows) { _vE_Programation = new BEReportPodructCategoryByProgramationView(); _vE_Programation.week = string.IsNullOrEmpty(row["week"]) ? 0 : int.Parse(row["week"]); _vE_Programation.weekDay = string.IsNullOrEmpty(row["weekDay"]) ? 0 : int.Parse(row["weekDay"]); _vE_Programation.strInitialDate = string.IsNullOrEmpty(row["strInitialDate"]) ? string.Empty : row["strInitialDate"]; _vE_Programation.strFinalDate = string.IsNullOrEmpty(row["strFinalDate"]) ? string.Empty : row["strFinalDate"]; _vE_Programation.cost = string.IsNullOrEmpty(row["cost"]) ? 0 : decimal.Parse(row["cost"]); _vE_Programation.measure = string.IsNullOrEmpty(row["measure"]) ? string.Empty : row["measure"]; _vE_Programation.productDate = string.IsNullOrEmpty(row["productDate"]) ? string.Empty : row["productDate"]; _vE_Programation.productName = string.IsNullOrEmpty(row["productName"]) ? string.Empty : row["productName"]; _vE_Programation.quantity = string.IsNullOrEmpty(row["quantity"]) ? 0 : decimal.Parse(row["quantity"]); _vE_Programation.InvoiceItemId = string.IsNullOrEmpty(row["InvoiceItemId"]) ? 0 : int.Parse(row["InvoiceItemId"]); _vE_Programation.Requested = string.IsNullOrEmpty(row["Requested"]) ? 0 : decimal.Parse(row["Requested"]); _lstProgramation.Add(_vE_Programation); } return(_lstProgramation); }
public List <VE_Programation> GetProgramationResumen(int year, int month, int headquartersId, int dietId) { VE_Programation _vE_Programation = null; List <VE_Programation> _lstProgramation = new List <VE_Programation>(); Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("_headquartersId", (headquartersId == 0) ? DBNull.Value : (object)headquartersId); parameters.Add("_dietId", (dietId == 0) ? DBNull.Value : (object)dietId); parameters.Add("_month", (month == 0) ? DBNull.Value : (object)month); parameters.Add("_year", (month == 0) ? DBNull.Value : (object)year); util _util = new util(); var rows = _database.QuerySP("sp_getProgramationResumen", parameters); foreach (var row in rows) { _vE_Programation = new VE_Programation(); _vE_Programation.programationId = string.IsNullOrEmpty(row["programationId"]) ? 0 : int.Parse(row["programationId"]); _vE_Programation.date = string.IsNullOrEmpty(row["date"]) ? DateTime.Now : DateTime.Parse(row["date"]); _vE_Programation.dateFormat = _vE_Programation.date.ToString(util.CustomeDateFormat()); _vE_Programation.dayOfWeek = _vE_Programation.date.DayOfWeek; _vE_Programation.dayOfMonth = _vE_Programation.date.Day; _vE_Programation.weekOfMonth = _util.GetWeekOfMonth(_vE_Programation.date).WeekOfMonth; _vE_Programation.costTotal = string.IsNullOrEmpty(row["costTotal"]) ? 0 : decimal.Parse(row["costTotal"]); _vE_Programation.feedingTimeId = string.IsNullOrEmpty(row["feedingTimeId"]) ? 0 : int.Parse(row["feedingTimeId"]); _vE_Programation.feedingTimeName = row["feedingTimeName"]; _vE_Programation.kcalTotal = string.IsNullOrEmpty(row["kcalTotal"]) ? 0 : int.Parse(row["kcalTotal"]); _vE_Programation.isEnabled = string.IsNullOrEmpty(row["isEnabled"]) ? false : row["isEnabled"].Equals("1") ? true : false; _vE_Programation.productName = row["productName"]; _vE_Programation.headquartersName = row["headquartersName"]; _vE_Programation.dietName = row["dietName"]; _vE_Programation.quantity = string.IsNullOrEmpty(row["quantity"]) ? 0 : decimal.Parse(row["quantity"]); _lstProgramation.Add(_vE_Programation); } return(_lstProgramation); }
public ExtendedDebugTaskRunnerHostController(IUnitTestLaunchManager launchManager, IUnitTestAgentManager agentManager, util::JetBrains.Util.Lazy.Lazy<IVsDebugger2> debugger2, DTE dte, IThreading threading, IUnitTestLaunch launch, int port) : base(launchManager, agentManager, debugger2, dte, threading, launch, port) { this.port = port; }
public static string ConvertToImage(string b_file) { try { string temp_file = b_file; string partShare = WebConfigurationManager.AppSettings["ServerLinkFile"]; string LinkServerLocal = WebConfigurationManager.AppSettings["ServerLocal"]; if (string.IsNullOrEmpty(LinkServerLocal)) { b_file = string.Concat("////", partShare, "//", b_file.TrimStart('/')); } else { b_file = string.Concat(LinkServerLocal, "//", b_file.TrimStart('/')); } //b_file = HttpContext.Current.Server.MapPath("~") + b_file; util a = new util(); if (!File.Exists(b_file)) { return(string.Empty); } string b_out = b_file.Replace(".pdf", ".png"); if (File.Exists(b_out)) { //b_out = b_out.Replace(HttpContext.Current.Server.MapPath("~"), string.Empty); if (string.IsNullOrEmpty(LinkServerLocal)) { b_out = b_out.Replace("////" + partShare, ""); } else { b_out = b_out.Replace(LinkServerLocal, ""); } return(b_out); } string temp_temp = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png"; string temp_file_png = HttpContext.Current.Server.MapPath("~/Files/Temp/") + temp_temp; a.ConvertPdfToPng(b_file, temp_file_png, System.Drawing.Printing.PaperKind.A3); b_out = "/Files/Temp/" + temp_temp; //a.ConvertPdfToPng(b_file, b_out, System.Drawing.Printing.PaperKind.A3); //if (string.IsNullOrEmpty(LinkServerLocal)) //{ // b_out = b_out.Replace("////" + partShare, ""); //} //else //{ // b_out = b_out.Replace(LinkServerLocal, ""); //} //b_out = b_out.Replace(HttpContext.Current.Server.MapPath("~"), string.Empty); return(b_out); } catch { return(string.Empty); } }
public override void purgeGenericListener(util.IListener paramIListener) { throw new NotImplementedException(); }
public override void removeGenericListener(object paramObject, util.IListener paramIListener) { throw new NotImplementedException(); }
public ExtendedDebugTaskRunnerHostController(UnitTestManager manager, UnitTestSessionManager sessionManager, util::JetBrains.Util.Lazy.Lazy<IVsDebugger2> debugger2, DTE dte, IThreading threading, IUnitTestLaunch launch, string remotingAddress) : base(manager, sessionManager, debugger2, dte, threading, launch, remotingAddress) { }
public List <RequestResumenByWeekOfMonth> GetRequestResumen(int year, int month, int headquartersId, int dietId) { _database = new MySQLDatabase(connectionString); var listProgramationDetail = new DA_Programation(_database).GetProgramationDetailResumen(year, month, headquartersId, dietId); List <RequestResumenByWeekOfMonth> ListRequestResumenByWeek = new List <RequestResumenByWeekOfMonth>(); List <RequestResumen> ListRequestResumen = new List <RequestResumen>(); List <RequestByWeekOfMonth> ListRequestByWeekOfMonth = new List <RequestByWeekOfMonth>(); util _util = new util(); foreach (var item in listProgramationDetail) { var validate = ListRequestByWeekOfMonth.Find(x => x.WeekOfMonth.WeekOfMonth == item.weekOfMonth); if (validate == null) { RequestByWeekOfMonth rwm = new RequestByWeekOfMonth(); rwm.WeekOfMonth = _util.GetWeekOfMonth(item.date); rwm.listRequest.Add(item); ListRequestByWeekOfMonth.Add(rwm); } else { ListRequestByWeekOfMonth.Find(x => x.WeekOfMonth.WeekOfMonth == item.weekOfMonth).listRequest.Add(item); } } List <RequestResumen> lrr = null; foreach (var listByWeek in ListRequestByWeekOfMonth) { lrr = new List <RequestResumen>(); RequestResumen rr = null; decimal totalToWeek = 0; foreach (var item in listByWeek.listRequest) { rr = new RequestResumen(); var validProductCategoryId = lrr.Find(x => x.productCategoryId == item.productCategoryId); if (validProductCategoryId == null) { rr.headquartersName = item.headquartersName; rr.dietName = item.dietName; rr.productCategoryId = item.productCategoryId; rr.productCategoryName = item.productCategoryName; rr.amount = item.productCost; rr.dateFormat = item.dateFormat; totalToWeek += item.productCost; lrr.Add(rr); } else { lrr.Find(x => x.productCategoryId == item.productCategoryId).amount += item.productCost; totalToWeek += item.productCost; } } foreach (var p in lrr) { p.percentage = (totalToWeek == 0) ? 0 : Math.Round((p.amount / totalToWeek) * 100, 2); } RequestResumenByWeekOfMonth rrwm = new RequestResumenByWeekOfMonth(); rrwm.WeekOfMonth = listByWeek.WeekOfMonth; rrwm.listRequest = lrr; ListRequestResumenByWeek.Add(rrwm); } List <RequestResumenByWeekOfMonth> orderList = ListRequestResumenByWeek.OrderBy(x => x.WeekOfMonth.WeekOfMonth).ToList(); return(orderList); }
private void fire_PolygonPointSelected(OoPolygonPointsObserver ppobs, util.PolyPointDescriptor point) { if (PolygonPointSelected != null) { Task t = new Task(new Action(() => { try { PolygonPointSelected.Invoke(this, new PolygonPointSelectedEventArgs(ppobs, point)); } catch { } })); t.Start(); } }
public void senddata(string LGNUM, string MAKBH, string RFIDNO, string CHARG, string BQ, string PT, string BT) { util util = new util(); util.senddata(LGNUM, MAKBH, RFIDNO, CHARG, BQ, PT, BT); }
public List <ProgramationResumenByWeekOfMonth> GetProgramationResumen(int year, int month, int headquartersId, int dietId) { _database = new MySQLDatabase(connectionString); var listProgramation = new DA_Programation(_database).GetProgramationResumen(year, month, headquartersId, dietId); List <ProgramationByWeekOfMonth> ListProgramationByWeek = new List <ProgramationByWeekOfMonth>(); List <ProgramationResumenByWeekOfMonth> ListProgramationResumenByWeek = new List <ProgramationResumenByWeekOfMonth>(); util _util = new util(); foreach (var item in listProgramation) { var validate = ListProgramationByWeek.Find(x => x.WeekOfMonth.WeekOfMonth == item.weekOfMonth); if (validate == null) { ProgramationByWeekOfMonth pwm = new ProgramationByWeekOfMonth(); pwm.WeekOfMonth = _util.GetWeekOfMonth(item.date); pwm.listProgramation.Add(item); ListProgramationByWeek.Add(pwm); } else { ListProgramationByWeek.Find(x => x.WeekOfMonth.WeekOfMonth == item.weekOfMonth).listProgramation.Add(item); } } List <ProgramationResumen> lpr = null; foreach (var listByWeek in ListProgramationByWeek) { lpr = new List <ProgramationResumen>(); ProgramationResumen pr = null; foreach (var item in listByWeek.listProgramation) { pr = new ProgramationResumen(); var validFeedingTimeId = lpr.Find(x => x.feedingTimeId == item.feedingTimeId); if (validFeedingTimeId == null) { pr.feedingTimeId = item.feedingTimeId; pr.feedingTimeName = item.feedingTimeName; pr.monday.date = listByWeek.WeekOfMonth.MondayDate; pr.monday.dateFormat = listByWeek.WeekOfMonth.MondayDateFormat; pr.tuesday.date = listByWeek.WeekOfMonth.TuesdayDate; pr.tuesday.dateFormat = listByWeek.WeekOfMonth.TuesdayDateFormat; pr.wednesday.date = listByWeek.WeekOfMonth.WednesdayDate; pr.wednesday.dateFormat = listByWeek.WeekOfMonth.WednesdayDateFormat; pr.thursday.date = listByWeek.WeekOfMonth.ThursdayDate; pr.thursday.dateFormat = listByWeek.WeekOfMonth.ThursdayDateFormat; pr.friday.date = listByWeek.WeekOfMonth.FridayDate; pr.friday.dateFormat = listByWeek.WeekOfMonth.FridayDateFormat; pr.saturday.date = listByWeek.WeekOfMonth.SaturdayDate; pr.saturday.dateFormat = listByWeek.WeekOfMonth.SaturdayDateFormat; pr.sunday.date = listByWeek.WeekOfMonth.SundayDate; pr.sunday.dateFormat = listByWeek.WeekOfMonth.SundayDateFormat; switch (item.dayOfWeek) { case DayOfWeek.Monday: pr.monday.programation.Add(item); break; case DayOfWeek.Tuesday: pr.tuesday.programation.Add(item); break; case DayOfWeek.Wednesday: pr.wednesday.programation.Add(item); break; case DayOfWeek.Thursday: pr.thursday.programation.Add(item); break; case DayOfWeek.Friday: pr.friday.programation.Add(item); break; case DayOfWeek.Saturday: pr.saturday.programation.Add(item); break; case DayOfWeek.Sunday: pr.sunday.programation.Add(item); break; } lpr.Add(pr); } else { switch (item.dayOfWeek) { case DayOfWeek.Monday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).monday.programation.Add(item); break; case DayOfWeek.Tuesday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).tuesday.programation.Add(item); break; case DayOfWeek.Wednesday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).wednesday.programation.Add(item); break; case DayOfWeek.Thursday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).thursday.programation.Add(item); break; case DayOfWeek.Friday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).friday.programation.Add(item); break; case DayOfWeek.Saturday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).saturday.programation.Add(item); break; case DayOfWeek.Sunday: lpr.Find(x => x.feedingTimeId == item.feedingTimeId).sunday.programation.Add(item); break; } } } ProgramationResumenByWeekOfMonth prwm = new ProgramationResumenByWeekOfMonth(); prwm.WeekOfMonth = listByWeek.WeekOfMonth; prwm.listProgramation = lpr; ListProgramationResumenByWeek.Add(prwm); } List <ProgramationResumenByWeekOfMonth> orderList = ListProgramationResumenByWeek.OrderBy(x => x.WeekOfMonth.WeekOfMonth).ToList(); return(orderList); }