text stringlengths 13 6.01M |
|---|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PlayTennis.Model
{
public class AppointmentRecord : BaseEntity
{
public Guid AppointmentId { get; set; }
public virtual Appointment Appointment { get; set; }
public Guid UserBaseInfoId { get; set; }
public virtual UserBaseInfo UserBaseInfo { get; set; }
/// <summary>
/// -1:取消; 0:发起;1:接受;2 拒绝;3:完成;4:评论
/// </summary>
public byte AppointmentState { get; set; }
/// <summary>
/// 操作说明
/// </summary>
public string Remark { get; set; }
///// <summary>
///// 微信表单id
///// </summary>
//public string FormId { get; set; }
}
}
|
using System;
namespace NetPayroll.Guides.Constants
{
public enum WorkHealthTerms : uint
{
HEALTH_TERM_EMPLOYMENT = 0,
HEALTH_TERM_AGREE_WORK = 1,
HEALTH_TERM_AGREE_TASK = 2,
HEALTH_TERM_OUT_EMPLOY = 3
};
}
|
namespace ShCore.Caching
{
/// <summary>
///
/// </summary>
public interface ICacheFactory
{
/// <summary>
///
/// </summary>
ICacheProvider Provider { get; }
}
}
|
//
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
#region Usings
using System.Drawing;
using Telerik.Web.UI;
#endregion
namespace DotNetNuke.Web.UI.WebControls
{
public class DnnColorPickerItem : ColorPickerItem
{
public DnnColorPickerItem()
{
}
public DnnColorPickerItem(Color value) : base(value)
{
}
public DnnColorPickerItem(Color value, string title) : base(value, title)
{
}
}
}
|
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
namespace liatest_final.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
HtmlWeb web = new HtmlWeb();
HtmlDocument document = web.Load("https://activetracing.dhl.com/DatPublic/search.do?search=consignmentId&autoSearch=true&l=sv&at=consignment&a=9545980527");
// HtmlNode: Gets a collection of flags that define specific behaviors for specific element nodes.
var tdList = new List<HtmlNode>();
// Select all tables and remove tags with HtmlDecode then add to the tdList.
foreach (var cell in document.DocumentNode.SelectNodes("//table/tr/td"))
{
var decodedCell = WebUtility.HtmlDecode(cell.InnerHtml);
if(!String.IsNullOrWhiteSpace(decodedCell))
{
tdList.Add(cell);
}
}
// Debug, break point at ViewBag.Message to see the values of tdList, then select which information to show using a Dictionarylist with (Key,Value) as string
// little editing with replace
var returnDictionary = new Dictionary<string, string>();
for (int i = 8; i < 22; i=i+2)
{
returnDictionary.Add(tdList.ElementAt(i).InnerHtml, tdList.ElementAt(i+1).InnerHtml.Replace(" ", ""));
}
return View(returnDictionary);
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace bt
{
public partial class Suahdn : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getCncc();
getData();
}
}
public void getCncc()
{
banhang2Entities db = new banhang2Entities();
List<ncc> obj = db.ncc.ToList();
cmbncc.DataSource = obj;
cmbncc.DataValueField = "mancc";
cmbncc.DataTextField = "tenncc";
cmbncc.DataBind();
}
public void getData()
{
int id_dhn = Convert.ToInt32(Request.QueryString["id_hdn"]);
banhang2Entities db = new banhang2Entities();
hdn obj = db.hdn.FirstOrDefault(x => x.id_hdnhap == id_dhn);
if (obj == null)
{
Response.Redirect("Hoadonnhap.aspx");
}
else {
cmbncc.SelectedValue = obj.mancc.ToString();
txtNgay.Text =obj.ngaynhap.ToString() ;
txtten.Text = obj.tennguoigiao;
txtnd.Text = obj.noidung;
}
}
protected void tbnSua_Click(object sender, EventArgs e)
{
int id_dhn = Convert.ToInt32(Request.QueryString["id_hdn"]);
banhang2Entities db = new banhang2Entities();
hdn obj = db.hdn.FirstOrDefault(x => x.id_hdnhap == id_dhn);
obj.mancc = Convert.ToInt32(cmbncc.SelectedValue);
obj.ngaynhap = DateTime.Parse(txtNgay.Text);
obj.tennguoigiao = txtten.Text;
obj.noidung = txtnd.Text;
db.SaveChanges();
Response.Redirect("Hoadonnhap.aspx");
}
}
} |
/*
* Bungie.Net API
*
* These endpoints constitute the functionality exposed by Bungie.net, both for more traditional website functionality and for connectivity to Bungie video games and their related functionality.
*
* OpenAPI spec version: 2.1.1
* Contact: support@bungie.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = BungieNetPlatform.Client.SwaggerDateConverter;
namespace BungieNetPlatform.Model
{
/// <summary>
/// Many items can be rendered in 3D. When you request this block, you will obtain the custom data needed to render this specific instance of the item.
/// </summary>
[DataContract]
public partial class DestinyEntitiesItemsDestinyItemRenderComponent : IEquatable<DestinyEntitiesItemsDestinyItemRenderComponent>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="DestinyEntitiesItemsDestinyItemRenderComponent" /> class.
/// </summary>
/// <param name="UseCustomDyes">If you should use custom dyes on this item, it will be indicated here..</param>
/// <param name="ArtRegions">A dictionary for rendering gear components, with: key = Art Arrangement Region Index value = The chosen Arrangement Index for the Region, based on the value of a stat on the item used for making the choice..</param>
public DestinyEntitiesItemsDestinyItemRenderComponent(bool? UseCustomDyes = default(bool?), Dictionary<string, int?> ArtRegions = default(Dictionary<string, int?>))
{
this.UseCustomDyes = UseCustomDyes;
this.ArtRegions = ArtRegions;
}
/// <summary>
/// If you should use custom dyes on this item, it will be indicated here.
/// </summary>
/// <value>If you should use custom dyes on this item, it will be indicated here.</value>
[DataMember(Name="useCustomDyes", EmitDefaultValue=false)]
public bool? UseCustomDyes { get; set; }
/// <summary>
/// A dictionary for rendering gear components, with: key = Art Arrangement Region Index value = The chosen Arrangement Index for the Region, based on the value of a stat on the item used for making the choice.
/// </summary>
/// <value>A dictionary for rendering gear components, with: key = Art Arrangement Region Index value = The chosen Arrangement Index for the Region, based on the value of a stat on the item used for making the choice.</value>
[DataMember(Name="artRegions", EmitDefaultValue=false)]
public Dictionary<string, int?> ArtRegions { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class DestinyEntitiesItemsDestinyItemRenderComponent {\n");
sb.Append(" UseCustomDyes: ").Append(UseCustomDyes).Append("\n");
sb.Append(" ArtRegions: ").Append(ArtRegions).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as DestinyEntitiesItemsDestinyItemRenderComponent);
}
/// <summary>
/// Returns true if DestinyEntitiesItemsDestinyItemRenderComponent instances are equal
/// </summary>
/// <param name="input">Instance of DestinyEntitiesItemsDestinyItemRenderComponent to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(DestinyEntitiesItemsDestinyItemRenderComponent input)
{
if (input == null)
return false;
return
(
this.UseCustomDyes == input.UseCustomDyes ||
(this.UseCustomDyes != null &&
this.UseCustomDyes.Equals(input.UseCustomDyes))
) &&
(
this.ArtRegions == input.ArtRegions ||
this.ArtRegions != null &&
this.ArtRegions.SequenceEqual(input.ArtRegions)
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.UseCustomDyes != null)
hashCode = hashCode * 59 + this.UseCustomDyes.GetHashCode();
if (this.ArtRegions != null)
hashCode = hashCode * 59 + this.ArtRegions.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
|
namespace BarberShop.Infraestructure.Enums
{
enum Repositories
{
Catalog,
CatalogMedia,
Category,
Clasification,
Customer,
DocumentType,
Employee,
Person,
Role,
Service
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _15.SetOfNumbers
{
class SetOfNumbers
{
static void Min<T>(T[] setOfNumbers) where T : IComparable<T>
{
if (setOfNumbers.Length > 1)
{
T minValue = setOfNumbers[0];
for (int i = 0; i < setOfNumbers.Length - 1; i++)
{
if (minValue.CompareTo(setOfNumbers[i + 1]) > 0)
{
minValue = setOfNumbers[i + 1];
}
}
Console.WriteLine("The minimum value of your secuence is {0}.", minValue);
}
else if (setOfNumbers.Length == 1)
{
T minValue = setOfNumbers[0];
Console.WriteLine("The minimum value of your secuence is {0}.", minValue);
}
else
{
Console.WriteLine("You don't have any values in the array.");
}
}
static void Max<T>(T[] setOfNumbers) where T : IComparable<T>
{
if (setOfNumbers.Length > 1)
{
T maxValue = setOfNumbers[0];
for (int i = 0; i < setOfNumbers.Length - 1; i++)
{
if (maxValue.CompareTo(setOfNumbers[i + 1]) < 0)
{
maxValue = setOfNumbers[i + 1];
}
}
Console.WriteLine("The max value of your secuence is {0}.", maxValue);
}
else if (setOfNumbers.Length == 1)
{
T maxValue = setOfNumbers[0];
Console.WriteLine("The max value of your secuence is {0}.", maxValue);
}
else
{
Console.WriteLine("You don't have any values in the array.");
}
}
static T Add<T>(T num1, T num2)
{
dynamic number1 = num1;
dynamic number2 = num2;
return number1 + number2;
}
static T Divide<T>(T num1, int num2)
{
dynamic number1 = num1;
dynamic number2 = num2;
return number1 / number2;
}
static void Average<T>(T[] setOfNumbers) where T : IComparable<T>
{
if (setOfNumbers.Length > 1)
{
T average = setOfNumbers[0];
for (int i = 1; i < setOfNumbers.Length; i++)
{
average = Add(average, setOfNumbers[i]);
}
Console.WriteLine("The average value of your secuence is {0}.", Divide(average,setOfNumbers.Length));
}
else if (setOfNumbers.Length == 1)
{
T average = setOfNumbers[0];
Console.WriteLine("The average value of your secuence is {0}.", average);
}
else
{
Console.WriteLine("You don't have any values in the array.");
}
}
static void Sum<T>(T[] setOfNumbers) where T : IComparable<T>
{
if (setOfNumbers.Length > 1)
{
T sum = setOfNumbers[0];
for (int i = 1; i < setOfNumbers.Length; i++)
{
sum = Add(sum, setOfNumbers[i]);
}
Console.WriteLine("The sum of your secuence is {0}.", sum);
}
else if (setOfNumbers.Length == 1)
{
T sum = setOfNumbers[0];
Console.WriteLine("The sum of your secuence is {0}.", sum);
}
else
{
Console.WriteLine("You don't have any values in the array.");
}
}
static void Main(string[] args)
{
decimal[] arrayOdDec = { 2.3m, 3.2m, 8.1m, 4m};
Min(arrayOdDec);
Max(arrayOdDec);
Average(arrayOdDec);
Sum(arrayOdDec);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Template10.Services.FileService
{
class FileService
{
FileHelper _helper = new FileHelper();
//public async Task<List<Models.ColorInfo>> ReadColorsAsync(string key)
//{
// try
// {
// return await _helper.ReadFileAsync<List<Models.ColorInfo>>(key, FileHelper.StorageStrategies.Roaming);
// }
// catch { return null; }
//}
//public async Task WriteColors(string key, List<Models.ColorInfo> colors)
//{
// await _helper.WriteFileAsync(key, colors, FileHelper.StorageStrategies.Roaming);
//}
}
}
|
using Microsoft.Xna.Framework;
using WUIClient.Components;
using WUIShared.Objects;
using static WUIClient.Components.DragComponent;
namespace WUIClient.Gizmos {
public class ScaleGizmo : Gizmo{
private GameObject GizmoRight { get; }
private GameObject GizmoLeft { get; }
private GameObject GizmoUp { get; }
private GameObject GizmoDown { get; }
public ScaleGizmo() {
GizmoRight = MakeGizmo(0, 16, 0, Axis.X);
GizmoLeft = MakeGizmo(1, -16, 0, Axis.X);
GizmoUp = MakeGizmo(2, 0, -16, Axis.Y);
GizmoDown = MakeGizmo(3, 0, 16, Axis.Y);
}
private GameObject MakeGizmo(int i, float x, float y, Axis axis) {
GameObject res = new GameObject();
res.transform.Size = new Microsoft.Xna.Framework.Vector2(8, 8);
res.AddChild(new RawTextureRenderer() { texture = Game1.instance.UIRect, color = Color.White });
res.AddChild(new MouseClickableComponent());
res.AddChild(new DragComponent() { axis = axis });
AddChild(res);
return res;
}
public void UseOnBounds(RectangleF rect) {
GizmoRight.transform.Position = new Vector2(rect.Right, rect.Center.Y);
GizmoLeft.transform.Position = new Vector2(rect.Left, rect.Center.Y);
GizmoUp.transform.Position = new Vector2(rect.Center.X, rect.Top);
GizmoDown.transform.Position = new Vector2(rect.Center.X, rect.Bottom);
}
public Vector2 GetSize() {
return new Vector2(GizmoRight.transform.Position.X - GizmoLeft.transform.Position.X, GizmoDown.transform.Position.Y - GizmoUp.transform.Position.Y);
}
public Vector2 GetPosition() {
return new Vector2(GizmoLeft.transform.Position.X, GizmoUp.transform.Position.Y);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
namespace System_Activity_monitor.Iterator
{
public interface IIterator
{
Process First();
Process Next();
bool IsDone();
Process CurrentItem();
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using PetSharing.API.Extensions;
using PetSharing.API.SignalR;
using PetSharing.Contracts;
using PetSharing.Domain.Dtos;
using PetSharing.Domain.Services;
namespace PetSharing.API.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class ChatController : ControllerBase
{
readonly IUserService _userService;
readonly IMessageService _messageService;
readonly IHubContext<ChatHub> _hubContext;
public ChatController(IUserService userService, IMessageService messageService, IHubContext<ChatHub> hubContext)
{
_hubContext = hubContext;
_messageService = messageService;
_userService = userService;
}
public async Task<IActionResult> Index()
{
return Ok((await _userService.GetChats(User.Claims.FirstOrDefault(x => x.Type == "UserID").Value)).Select(x => x.ToContract()).ToList());
}
[Route("get")]
public async Task<IActionResult> GetChat(string id)
{
if (string.IsNullOrEmpty(id))
return BadRequest();
var user = _userService.FindById(id);
var messages = (await _messageService.GetMessages(User.Claims.FirstOrDefault(x => x.Type == "UserID").Value, id)).Select(x => x.ToContract()).ToList();
return Ok(new ChatContract { Date = messages.FirstOrDefault().Date, Name = user.Result.UserName, PicUrl = user.Result.PicUrl, LastMessage = messages.FirstOrDefault().Text }.Messages = messages);
}
[Route("delete")]
[HttpDelete]
public async Task<IActionResult> DeleteChat(string id)
{
if (string.IsNullOrEmpty(id))
return BadRequest();
await _messageService.DeleteChat(User.Claims.FirstOrDefault(x => x.Type == "UserID").Value, id);
return Ok();
}
[Route("send")]
[HttpPost]
public async Task<IActionResult> SendMessage(MessageContract message)
{
var userId = User.Claims.FirstOrDefault(x => x.Type == "UserID").Value;
if (userId != message.ReceiverId)
await _hubContext.Clients.User(userId).SendAsync("Receive", message);
await _hubContext.Clients.User(message.ReceiverId).SendAsync("Receive", message);
await _messageService.Create(new MessageDto { Date = DateTime.Now, Text = message.Text, ReceiverId = message.ReceiverId, UserId = userId });
return Ok();
}
[Route("deletemsg")]
[HttpDelete]
public async Task<IActionResult> DeleteMessage(int? id)
{
if (id == null)
return BadRequest();
await _messageService.Delete((int)id);
return Ok();
}
}
} |
namespace SGDE.Domain.ViewModels
{
public class PartidaViewModel : BaseEntityViewModel
{
public string codigo { get; set; }
public string orden { get; set; }
public string descripcion { get; set; }
public string unidades { get; set; }
public double? unidadesCertificacionAnterior { get; set; }
public double? unidadesCertificacionActual { get; set; }
public double? unidadesPresupuesto { get; set; }
public double? presupuestoCapitulo { get; set; }
public string type { get; set; }
}
}
|
using System;
using System.Collections.Generic;
namespace API_GiangVien.Models
{
public partial class Bacluong
{
public Bacluong()
{
Luong = new HashSet<Luong>();
}
public int MaBac { get; set; }
public string TenBac { get; set; }
public int? HsbacLuong { get; set; }
public string NhomBac { get; set; }
public virtual ICollection<Luong> Luong { get; set; }
}
}
|
using CMS_ShopOnline.Filter;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using CMS_Database.Entities;
using CMS_Database.Repositories;
using CMS_Database.Interfaces;
using CMS_ShopOnline.Areas.Administration.Models;
namespace CMS_ShopOnline.Areas.CMS_Sale.Controllers
{
[Authorize]
public class HomeController : Controller
{
DBConnection _db = new DBConnection();
private readonly INguyenLieu NguyenLieu;
private readonly INhaCungCap NhaCungCap;
private readonly IPhieuNhap PhieuNhap;
private readonly ICTPhieuNhap CTPhieuNhap;
private readonly ILoaiSP LoaiSP;
private readonly IPhieuXuat PhieuXuat;
private readonly ICTPhieuXuat CTPhieuXuat;
private readonly IHoaDon HoaDon;
private readonly IKhuyenMai KhuyenMai;
private DateTime datetimesetting = new DateTime(2010, 10, 10, 1, 1, 1);
public HomeController()
{
LoaiSP = new LoaiSPRepository();
NguyenLieu = new NguyenLieuRepository();
NhaCungCap = new NhaCungCapRepository();
PhieuNhap = new PhieuNhapRepository();
CTPhieuNhap = new ICTPhieuPhapRepository();
PhieuXuat = new PhieuXuatRepository();
CTPhieuXuat = new ICTPhieuXuatRepository();
HoaDon = new HoaDonRepository();
KhuyenMai = new KhuyenMaiRepository();
}
public HomeController(INguyenLieu _nl, INhaCungCap _ncc, IPhieuNhap _pn, ICTPhieuNhap _ctpn, ILoaiSP _loaisp, IPhieuXuat _px, ICTPhieuXuat _ctpx,IHoaDon _HoaDon, IKhuyenMai _KhuyenMai)
{
LoaiSP = _loaisp;
NguyenLieu = _nl;
NhaCungCap = _ncc;
PhieuNhap = _pn;
CTPhieuNhap = _ctpn;
PhieuXuat = _px;
CTPhieuXuat = _ctpx;
HoaDon = _HoaDon;
KhuyenMai = _KhuyenMai;
}
//
// GET: /CMS_Sale/Home/
public ActionResult Index()
{
double? tongtienthu = 0;
double? tongtienchi = 0;
double? tongtienthuhn = 0;
double? tongtienchihn = 0;
var year = DateTime.Now.Year;
var month = DateTime.Now.Month;
DateTime aDateTime = GetFistDayInMonth(DateTime.Now.Year, DateTime.Now.Month);
// Cộng thêm 1 tuần và trừ đi một ngày.
DateTime retDateTime = GetLastDayInMonth(DateTime.Now.Year, DateTime.Now.Month);
var startDate = Convert.ToDateTime(aDateTime.ToString("yyyy/MM/dd"));
var endDate = Convert.ToDateTime(retDateTime.ToString("yyyy/MM/dd"));
var datenow = Convert.ToDateTime(DateTime.Now.ToString("yyyy/MM/dd"));
var tongthuhn = HoaDon.SelectAll().Where(x => x.NgayTao >= datenow);
IEnumerable<KhuyenMaiViewModel> model = KhuyenMai.SelectAll().Where(x => x.IsDelete != true).Select(
item => new KhuyenMaiViewModel
{
Id = item.Id,
Ten = item.Ten,
NgayBD = item.NgayBD,
NgayKT = item.NgayKT,
IsDelete = item.IsDelete
}).OrderByDescending(x => x.NgayBD);
ViewBag.Ten = KhuyenMai.SelectAll().Where(x => x.IsDelete != true);
foreach (var item in tongthuhn)
{
tongtienthuhn += item.TongTien;
}
var tongchihn = PhieuNhap.SelectAll().Where(x => x.NgayTao >= datenow);
foreach (var item in tongchihn)
{
tongtienchihn += item.TongTien;
}
var tongthu = _db.Database.SqlQuery<DoanhThuTheoTungNgay>("exec DoanhThuTheoNgay @Month,@Year", new SqlParameter("@Month", month), new SqlParameter("@Year", year)).ToList();
foreach (var item in tongthu)
{
tongtienthu += item.Tongthu;
}
var tongchi = _db.Database.SqlQuery<DoanhThuTheoTungNgay>("exec DoanhThuTheoNgay @Month,@Year", new SqlParameter("@Month", month), new SqlParameter("@Year", year)).ToList();
foreach (var item in tongchi)
{
tongtienchi += item.Tongchi;
}
ViewBag.tongdonhang = HoaDon.SelectAll().Where(x => x.NgayTao >= aDateTime && x.NgayTao <= retDateTime || x.NgayTao >= datenow).Count();
ViewBag.countHangCon = NguyenLieu.SelectAll().Where(x => x.SoLuongKho > 0).Count();
ViewBag.tonghang = NguyenLieu.SelectAll().Count();
ViewBag.tongthu = tongtienthu;
ViewBag.tongchi = tongtienchi;
ViewBag.tongthuhn = tongtienthuhn;
ViewBag.tongchihn = tongtienchihn;
ViewBag.thuchi = tongtienthuhn - tongtienchihn;
ViewBag.countSapHetHang = NguyenLieu.SelectAll().Where(x => x.SoLuongKho >= 1 && x.SoLuongKho <= 5).Count();
ViewBag.countHetHang = NguyenLieu.SelectAll().Where(x => x.SoLuongKho == 0 && x.NgayNhap != datetimesetting).Count();
return View();
}
public ActionResult BarchatReal()
{
var year = DateTime.Now.Year;
var result = _db.Database.SqlQuery<DTTT>("exec DoanhThuTheoThang1 @Year", new SqlParameter("@Year", year)).ToList();
return Json(result, JsonRequestBehavior.AllowGet);
}
public ActionResult PieChartReal()
{
var year = DateTime.Now.Year;
var month = DateTime.Now.Month;
DateTime startDate = GetFistDayInMonth(year, month);
DateTime endDate = GetLastDayInMonth(year, month);
var model = _db.Database.SqlQuery<TopSanPhamBanChay>("exec topspbanchay @batdau,@ketthuc", new SqlParameter("@batdau", startDate), new SqlParameter("@ketthuc", endDate)).ToList();
return Json(model, JsonRequestBehavior.AllowGet);
}
public static DateTime GetFistDayInMonth(int year, int month)
{
DateTime aDateTime = new DateTime(year, month, 1);
return aDateTime;
}
// Trả về ngày cuối cùng của tháng.
public static DateTime GetLastDayInMonth(int year, int month)
{
DateTime aDateTime = new DateTime(year, month, 1);
// Cộng thêm 1 tháng và trừ đi một ngày.
DateTime retDateTime = aDateTime.AddMonths(1).AddDays(-1);
return retDateTime;
}
}
} |
using System;
namespace OSGeo.GDAL
{
public enum DataType
{
GDT_Unknown,
GDT_Byte,
GDT_UInt16,
GDT_Int16,
GDT_UInt32,
GDT_Int32,
GDT_Float32,
GDT_Float64,
GDT_CInt16,
GDT_CInt32,
GDT_CFloat32,
GDT_CFloat64,
GDT_TypeCount
}
} |
using System.Collections.Generic;
using Whale.Shared.Models.Participant;
namespace Whale.SignalR.Models.Room
{
public class RoomDTO
{
public string RoomId { get; set; }
public string Name { get; set; }
public ICollection<ParticipantDTO> Participants { get; set; } = new List<ParticipantDTO>();
}
}
|
using AKB.MVC5.HtmlHelperExtensions.MVC5.HelperExtensions.Componets.MVC5.Components.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace AKB.MVC5.HtmlHelperExtensions.MVC5.HelperExtensions.Componets.Helper.StringBuilderr.Extension
{
public static class BootstrapButtonHelper
{
/// <summary>
/// Bootstrap Submit Button Helper
/// </summary>
/// <param name="htmlHelper">The helper</param>
/// <param name="innerHtml">The text (or HTML) for the button</param>
/// <param name="htmlAttributes">An object that sets the HTML attributes for the element (optional)</param>
/// <returns>A HTML <button> element with the appropriate properties set.</returns>
public static MvcHtmlString BootstrapButton(this HtmlHelper htmlHelper,
string innerHtml,
object htmlAttributes = null)
{
return BootstrapButton(htmlHelper, innerHtml, null, null, null, false, false, HtmlHelperExtensionsCommon.HtmlButtonTypes.submit, htmlAttributes);
}
/// <summary>
/// Bootstrap Submit Button Helper
/// </summary>
/// <param name="htmlHelper">The helper</param>
/// <param name="innerHtml">The text (or HTML) for the button</param>
/// <param name="cssClass">CSS class(es) to add</param>
/// <param name="htmlAttributes">An object that sets the HTML attributes for the element (optional)</param>
/// <returns>A HTML <button> element with the appropriate properties set.</returns>
public static MvcHtmlString BootstrapButton(this HtmlHelper htmlHelper,
string innerHtml,
string cssClass,
object htmlAttributes = null)
{
return BootstrapButton(htmlHelper, innerHtml, cssClass, null, null, false, false, HtmlHelperExtensionsCommon.HtmlButtonTypes.submit, htmlAttributes);
}
/// <summary>
/// Bootstrap Submit Button Helper
/// </summary>
/// <param name="htmlHelper">The helper</param>
/// <param name="innerHtml">The text (or HTML) for the button</param>
/// <param name="cssClass">CSS class(es) to add</param>
/// <param name="name">The 'name' attribute for this element</param>
/// <param name="htmlAttributes">An object that sets the HTML attributes for the element (optional)</param>
/// <returns>A HTML <button> element with the appropriate properties set.</returns>
public static MvcHtmlString BootstrapButton(this HtmlHelper htmlHelper, string innerHtml, string cssClass, string name, object htmlAttributes = null)
{
return BootstrapButton(htmlHelper, innerHtml, cssClass, name, null, false, false, HtmlHelperExtensionsCommon.HtmlButtonTypes.submit, htmlAttributes);
}
/// <summary>
/// Bootstrap submit button helper
/// </summary>
/// <param name="helper">The helper</param>
/// <param name="innerHtml">The text (or HTML) for the button</param>
/// <param name="cssClass">CSS class(es) to add to the button</param>
/// <param name="name">The 'name' attributes for the button</param>
/// <param name="title">The 'title' attribute for the button</param>
/// <param name="isFormNoValidate">Whether or not this button validates the form</param>
/// <param name="isAutoFocous">Whether or not this button gets the input focus</param>
/// <param name="buttonType">The 'type' of button. Can be 'submit', 'reset', or 'button')</param>
/// <param name="htmlAttributes">An object that sets the HTML attributes for the element (optional)</param>
/// <returns>A HTML button element with the appropriate properties set.</returns>
public static MvcHtmlString BootstrapButton(this HtmlHelper helper, string innerHtml, string cssClass, string name, string title, bool isFormNoValidate, bool isAutoFocous, HtmlHelperExtensionsCommon.HtmlButtonTypes buttonType, object htmlAttributes = null)
{
//create a TagBuilder for the Button
TagBuilder tb = new TagBuilder("button");
//Check for we have btn-* class for the button
if (!string.IsNullOrEmpty(cssClass))
{
if (cssClass.Contains("btn-"))
{
cssClass = "btn-primary" + cssClass;
}
}
else
{
cssClass = "btn-primary";
}
//Add additional css classes to the Button
tb.AddCssClass(cssClass);
tb.AddCssClass("btn");
//Add name and id attributes of the button if present
HtmlHelperExtensionsCommon.AddName(tb, name, null);
//Adding HTML 5 attributes
if (!string.IsNullOrEmpty(title))
{
tb.MergeAttribute("title", title);
}
if (isFormNoValidate)
{
tb.MergeAttribute("formnovalidate", "formnovalidate");
}
if (isAutoFocous)
{
tb.MergeAttribute("autofocus", "autofocus");
}
//set inner html of the button
tb.InnerHtml = innerHtml;
//Add button type
switch (buttonType)
{
case HtmlHelperExtensionsCommon.HtmlButtonTypes.submit:
tb.MergeAttribute("type", "submit");
break;
case HtmlHelperExtensionsCommon.HtmlButtonTypes.button:
tb.MergeAttribute("type", "button");
break;
case HtmlHelperExtensionsCommon.HtmlButtonTypes.reset:
tb.MergeAttribute("type", "reset");
break;
}
//Add additional html attributes
tb.MergeAttributes(HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
return MvcHtmlString.Create(tb.ToString());
}
}
}
|
using System;
using System.Linq;
using System.Net.Http.Headers;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Web;
using Fundamentals.Models.DBContext;
using Microsoft.AspNet.Identity;
namespace Fundamentals.Utility
{
public sealed class BasicAuthHttpModule :IDisposable
{
private const string REALM_NAME = "Fundamentals Realm";
private readonly FundamentalsDBContext _context;
public BasicAuthHttpModule()
{
_context = new FundamentalsDBContext();
}
public void Init(HttpApplication context)
{
context.AuthenticateRequest += Context_AuthenticateRequest;
context.EndRequest += Context_EndRequest;
}
private void Context_EndRequest(object sender, EventArgs e)
{
var response = HttpContext.Current.Response;
if (response.StatusCode == 401)
{
response.Headers.Add("WWW-Authenticate", $"Basic realm=\"{REALM_NAME}\"");
}
}
private void Context_AuthenticateRequest(object sender, EventArgs e)
{
var request = HttpContext.Current.Request;
var authHeader = request.Headers["Authorization"];
if (IsApiRequest(request) && authHeader != null)
{
var authHeaderVal = AuthenticationHeaderValue.Parse(authHeader);
if (authHeaderVal.Parameter != null &&
authHeaderVal.Scheme.Equals("basic", StringComparison.OrdinalIgnoreCase))
{
AuthenticateUser(authHeaderVal.Parameter);
}
}
}
private void AuthenticateUser(string credentials)
{
try
{
credentials = Encoding.UTF8.GetString(Convert.FromBase64String(credentials));
int separator = credentials.IndexOf(':');
var name = credentials.Substring(0, separator);
var password = credentials.Substring(separator + 1);
if (CheckPassword(name, password))
{
var identity = new GenericIdentity(name);
SetPrincipal(new GenericPrincipal(identity, null));
}
else
{
HttpContext.Current.Response.StatusCode = 401;
throw new UnauthorizedAccessException();
}
}
catch (UnauthorizedAccessException ex)
{
throw;
}
catch (Exception ex)
{
throw;
}
}
private bool CheckPassword(string name, string password)
{
var user = _context.Users.SingleOrDefault(x => x.UserName == name);
if (user == null) return false;
var hasher = new FundamentalsPasswordHasher();
return hasher.VerifyHashedPassword(user.PasswordHash, password) == PasswordVerificationResult.Success;
}
private static void SetPrincipal(IPrincipal principal)
{
Thread.CurrentPrincipal = principal;
if (HttpContext.Current != null)
{
HttpContext.Current.User = principal;
}
}
private static bool IsApiRequest(HttpRequest request)
{
string apiPath = VirtualPathUtility.ToAbsolute("~/api/");
return request.Url.AbsolutePath.StartsWith(apiPath);
}
public void Dispose()
{
_context.Dispose();
}
}
} |
using System;
using System.Collections.Generic;
using System.Text;
namespace ExpenseTracker
{
public class Sync
{
public int ID { get; set; }
public int Users_ID { get; set; }
public DateTime LastSyncDate { get; set; }
public int LastExpense_ID { get; set; }
public int LastIncome_ID { get; set; }
public int LastAccount_ID { get; set; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ERP_Palmeiras_RH.Models
{
public partial class Medico
{
/// <summary>
/// Cria um médico a partir de um funcionário.
/// Se este objeto for persistido posteriormente e o objeto funcionário estiver persistido, recomenda-se remover o objeto funcionário.
/// </summary>
/// <param name="func"></param>
public Medico(Funcionario func, String crm, int especialidadeId)
{
Admissao = func.Admissao;
Beneficios = func.Beneficios;
Cargo = func.Cargo;
CargoId = func.CargoId;
Credencial = func.Credencial;
Curriculum = func.Curriculum;
CRM = crm;
DadosPessoais = func.DadosPessoais;
DadosBancarios = func.DadosBancarios;
EspecialidadeId = especialidadeId;
Permissao = func.Permissao;
PermissaoId = func.PermissaoId;
this.CartaoPonto = func.CartaoPonto;
Ramal = func.Ramal;
Salario = func.Salario;
Status = func.Status;
}
public Medico()
{
}
}
} |
using CarRental.Models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
namespace CarRental.Services
{
public class RentalService
{
private RentalService _rentalService;
private CarService _carService;
private ClientService _clientService;
public string connect = ConfigurationManager.ConnectionStrings["connection"].ConnectionString;
private SqlDataAdapter _adapter;
private DataSet _ds;
public IList<RentalModel> GetRentals()
{
_rentalService = new RentalService();
_carService = new CarService();
_clientService = new ClientService();
IList<RentalModel> list = new List<RentalModel>();
_ds = new DataSet();
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("GetRentals", con);
cmd.CommandType = CommandType.StoredProcedure;
_adapter = new SqlDataAdapter(cmd);
_adapter.Fill(_ds);
if (_ds.Tables.Count > 0)
{
for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
{
RentalModel obj = new RentalModel();
obj.Id = Convert.ToInt32(_ds.Tables[0].Rows[i]["id"]);
obj.Client = _clientService.GetClient(Convert.ToInt32(_ds.Tables[0].Rows[i]["client"]));
obj.Car = _carService.GetCar(Convert.ToInt32(_ds.Tables[0].Rows[i]["car"]));
obj.DateOfIssue = Convert.ToDateTime(_ds.Tables[0].Rows[i]["dateOfIssue"]);
obj.CountOfDays = Convert.ToInt32(_ds.Tables[0].Rows[i]["countOfDays"]);
obj.Amount = Convert.ToDecimal(_ds.Tables[0].Rows[i]["amount"]);
list.Add(obj);
}
}
}
return list;
}
public void AddRental(RentalModel model)
{
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("AddRental", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id_client", model.Client.Id);
cmd.Parameters.AddWithValue("@id_car", model.Car.Id);
cmd.Parameters.AddWithValue("@date", model.DateOfIssue);
cmd.Parameters.AddWithValue("@count_days", model.CountOfDays);
cmd.ExecuteNonQuery();
}
}
public RentalModel GetRental(int id)
{
_rentalService = new RentalService();
_carService = new CarService();
_clientService = new ClientService();
var model = new RentalModel();
_ds = new DataSet();
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("GetRentalById", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id", id);
_adapter = new SqlDataAdapter(cmd);
_adapter.Fill(_ds);
if (_ds.Tables.Count > 0)
{
for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
{
model.Id = Convert.ToInt32(_ds.Tables[0].Rows[i]["id"]);
model.Client = _clientService.GetClient(Convert.ToInt32(_ds.Tables[0].Rows[i]["client"]));
model.Car = _carService.GetCar(Convert.ToInt32(_ds.Tables[0].Rows[i]["car"]));
model.DateOfIssue = Convert.ToDateTime(_ds.Tables[0].Rows[i]["dateOfIssue"]);
model.CountOfDays = Convert.ToInt32(_ds.Tables[0].Rows[i]["countOfDays"]);
model.Amount = Convert.ToDecimal(_ds.Tables[0].Rows[i]["amount"]);
}
}
}
return model;
}
public void UpdateRental(RentalModel model)
{
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("UpdateRental", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id", model.Id);
cmd.Parameters.AddWithValue("@id_client", model.Client.Id);
cmd.Parameters.AddWithValue("@id_car", model.Car.Id);
cmd.Parameters.AddWithValue("@date", model.DateOfIssue);
cmd.Parameters.AddWithValue("@count_days", model.CountOfDays);
cmd.ExecuteNonQuery();
}
}
public void DeleteRental(int id)
{
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("DeleteRental", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@id", id);
cmd.ExecuteNonQuery();
}
}
public IList<RentalModel> GetRentalsOverPeriod(DateTime firstDay, DateTime lastDay)
{
_rentalService = new RentalService();
_carService = new CarService();
_clientService = new ClientService();
IList<RentalModel> list = new List<RentalModel>();
_ds = new DataSet();
using (SqlConnection con = new SqlConnection(connect))
{
con.Open();
SqlCommand cmd = new SqlCommand("GetRentalsOverPeriod", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@firstDay", firstDay);
cmd.Parameters.AddWithValue("@lastDay", lastDay);
_adapter = new SqlDataAdapter(cmd);
_adapter.Fill(_ds);
if (_ds.Tables.Count > 0)
{
for (int i = 0; i < _ds.Tables[0].Rows.Count; i++)
{
RentalModel obj = new RentalModel();
obj.Id = Convert.ToInt32(_ds.Tables[0].Rows[i]["id"]);
obj.Client = _clientService.GetClient(Convert.ToInt32(_ds.Tables[0].Rows[i]["client"]));
obj.Car = _carService.GetCar(Convert.ToInt32(_ds.Tables[0].Rows[i]["car"]));
obj.DateOfIssue = Convert.ToDateTime(_ds.Tables[0].Rows[i]["dateOfIssue"]);
obj.CountOfDays = Convert.ToInt32(_ds.Tables[0].Rows[i]["countOfDays"]);
obj.Amount = Convert.ToDecimal(_ds.Tables[0].Rows[i]["amount"]);
list.Add(obj);
}
}
}
return list;
}
}
} |
using Newtonsoft.Json;
namespace WeatherService.Entities
{
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public sealed class Clouds
{
[JsonProperty("all")]
public int All { get; set; }
}
} |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SpawnPosition : MonoBehaviour {
public Text playerText;
public Tank player;
public CanvasGroup canvasGroup;
public SpawnSide spawnSide;
// Use this for initialization
void Start () {
transform.Find("SpawnAvatar").gameObject.SetActive(false);
canvasGroup = transform.Find("Canvas").GetComponent<CanvasGroup>();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider col)
{
Tank tank = col.GetComponentInParent<Tank>();
if (tank != null)
{
player = tank;
playerText.text = player.playerName;
playerText.color = player.playerColor;
tank.spawnSide = spawnSide;
}
}
}
public enum SpawnSide
{
Left,
Right
}
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class LimitedQueue<T> : IEnumerable<T>
{
T[] queue;
int capacity;
int head;
int size;
public LimitedQueue(int capacity)
{
this.capacity = capacity;
this.queue = new T[capacity];
}
public void Enqueue(T value)
{
queue[head] = value;
head = (head + 1) % capacity;
size = Mathf.Min(size + 1, capacity);
}
public T Dequeue()
{
if(size == 0)
throw new System.InvalidOperationException();
var i = (capacity + head - size) % capacity;
size = Mathf.Max(size - 1, 0);
return queue[i];
}
public void Clear()
{
size = 0;
head = 0;
}
public int Count
{
get { return size; }
}
public T[] ToArray()
{
int idx;
T[] array = new T[size];
for(int i = 0; i < size; i++)
{
idx = (i + capacity + head - size) % capacity;
array[i] = queue[idx];
}
return array;
}
public List<T> ToList()
{
int idx;
List<T> list = new List<T>(size);
for(int i = 0; i < size; i++)
{
idx = (i + capacity + head - size) % capacity;
list.Add(queue[idx]);
}
return list;
}
public T this[int index]
{
get
{
index = Mathf.Clamp(index, 0, size - 1);
var i = (index + capacity + head - size) % capacity;
return queue[i];
}
set
{
index = Mathf.Clamp(index, 0, size - 1);
var i = (index + capacity + head - size) % capacity;
queue[i] = value;
}
}
public int LastIndex { get { return (capacity + head - 1) % capacity; } }
public int SecondLastIndex { get { return (capacity + head - 2) % capacity; } }
public T Last
{
get { return queue[LastIndex]; }
set { queue[LastIndex] = value; }
}
public T SecondLast
{
get { return queue[SecondLastIndex]; }
set { queue[SecondLastIndex] = value; }
}
public IEnumerator<T> GetEnumerator()
{
return new Enumerator(this);
}
IEnumerator IEnumerable.GetEnumerator()
{
return new Enumerator(this);
}
[Serializable]
public struct Enumerator : IEnumerator<T>, IDisposable, IEnumerator
{
private LimitedQueue<T> queue;
private int next;
private T current;
object IEnumerator.Current
{
get
{
this.VerifyState();
if (this.next <= 0)
{
throw new InvalidOperationException();
}
return this.current;
}
}
public T Current { get { return this.current; } }
internal Enumerator(LimitedQueue<T> queue)
{
this.queue = queue;
this.current = default(T);
this.next = 0;
}
void IEnumerator.Reset()
{
this.VerifyState();
this.next = 0;
}
public void Dispose()
{
this.queue = null;
}
private void VerifyState()
{
if (this.queue == null)
{
throw new ObjectDisposedException(base.GetType().FullName);
}
}
public bool MoveNext()
{
this.VerifyState();
if (this.next < 0)
{
return false;
}
if (this.next < this.queue.size)
{
this.current = this.queue[this.next++];
return true;
}
this.next = -1;
return false;
}
}
} |
namespace QuestionPaperGenerator.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class AddingDatabase : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.WorksheetDetails",
c => new
{
Id = c.Int(nullable: false, identity: true),
Frequency = c.Int(nullable: false),
Marks = c.Int(nullable: false),
Template_Id = c.Int(nullable: false),
Worksheet_Id = c.Int(nullable: false),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.TemplateMaster", t => t.Template_Id, cascadeDelete: true)
.ForeignKey("dbo.WorksheetMaster", t => t.Worksheet_Id, cascadeDelete: true)
.Index(t => t.Template_Id)
.Index(t => t.Worksheet_Id);
CreateTable(
"dbo.TemplateMaster",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(nullable: false),
Formula = c.String(nullable: false, maxLength: 100),
})
.PrimaryKey(t => t.Id);
CreateTable(
"dbo.TemplateDetails",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(nullable: false),
MinValue = c.Int(nullable: false),
MaxValue = c.Int(nullable: false),
Template_Id = c.Int(nullable: false),
})
.PrimaryKey(t => t.Id)
.ForeignKey("dbo.TemplateMaster", t => t.Template_Id, cascadeDelete: true)
.Index(t => t.Template_Id);
CreateTable(
"dbo.WorksheetMaster",
c => new
{
Id = c.Int(nullable: false, identity: true),
WorksheetName = c.String(nullable: false),
})
.PrimaryKey(t => t.Id);
}
public override void Down()
{
DropForeignKey("dbo.WorksheetDetails", "Worksheet_Id", "dbo.WorksheetMaster");
DropForeignKey("dbo.WorksheetDetails", "Template_Id", "dbo.TemplateMaster");
DropForeignKey("dbo.TemplateDetails", "Template_Id", "dbo.TemplateMaster");
DropIndex("dbo.TemplateDetails", new[] { "Template_Id" });
DropIndex("dbo.WorksheetDetails", new[] { "Worksheet_Id" });
DropIndex("dbo.WorksheetDetails", new[] { "Template_Id" });
DropTable("dbo.WorksheetMaster");
DropTable("dbo.TemplateDetails");
DropTable("dbo.TemplateMaster");
DropTable("dbo.WorksheetDetails");
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WhoManageCourses.Model;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace WhoManageCourses.Controllers
{
[ApiController]
[Route("[controller]")]
public class StudentController : Controller
{
private readonly ApplicationDbContext DbContext;
public StudentController([FromServices] ApplicationDbContext appDbContext)
{
DbContext = appDbContext;
}
[HttpGet]
[Route("/api/[controller]")]
public List<Student> Get()
{
return DbContext.Student
.Include(p => p.StudentCourse)
.ThenInclude(p => p.Course).ToList();
}
[HttpGet]
[Route("/api/[controller]/{id}")]
public List<Student> Get(int id)
{
return DbContext.Student.Include(p => p.StudentCourse).ThenInclude(p => p.Course).Where(p => p.studentId == id).ToList();
}
[HttpPost]
[Route("/api/[controller]/Add")]
public List<Student> Add([FromBody] Student student)
{
Student newStudent = new Student();
newStudent.firstName = student.firstName;
newStudent.lastName = student.lastName;
newStudent.dateAdded = DateTime.Now.ToString();
DbContext.Add(newStudent);
DbContext.SaveChanges();
return DbContext.Student
.Include(p => p.StudentCourse)
.ThenInclude(p => p.Course).ToList();
}
[HttpPost]
[Route("/api/[controller]/Update")]
public List<Student> Update([FromBody] Student student)
{
Student myStudent = DbContext.Student.Where(predicate=>predicate.studentId == student.studentId).Select(p => p).FirstOrDefault();
myStudent.firstName = student.firstName;
myStudent.lastName = student.lastName;
myStudent.dateAdded = DateTime.Now.ToString();
DbContext.SaveChanges();
return DbContext.Student
.Include(p => p.StudentCourse)
.ThenInclude(p => p.Course).ToList();
}
}
}
|
namespace Blorc.OpenIdConnect
{
using System;
public static class OidcProviderOptionsExtensions
{
public static TimeSpan GetTimeForUserInactivityAutomaticSignOut(this OidcProviderOptions options)
{
ArgumentNullException.ThrowIfNull(options);
return TimeSpan.FromMilliseconds(options.TimeForUserInactivityAutomaticSignOut);
}
public static TimeSpan GetTimeForUserInactivityNotification(this OidcProviderOptions options)
{
ArgumentNullException.ThrowIfNull(options);
var time = options.TimeForUserInactivityAutomaticSignOut;
if (options.TimeForUserInactivityNotification > 0)
{
time = Math.Min(time, options.TimeForUserInactivityNotification);
}
return TimeSpan.FromMilliseconds(time);
}
}
}
|
using DecoratorExample.Core;
using System;
using System.Collections.Generic;
using System.Linq;
namespace DecoratorExample.Logging
{
internal class LoggingDataService : IDataService
{
private readonly IDataService baseDataService;
private readonly ILogger logger;
public LoggingDataService(IDataService baseDataService, ILogger logger)
{
this.baseDataService = baseDataService;
this.logger = logger;
}
public IEnumerable<string> GetCustomers()
{
logger.Log($"{DateTime.Now.ToString("HH:mm:ss.fff")} | Customers laden gestartet.");
var customers = baseDataService.GetCustomers();
logger.Log($"{DateTime.Now.ToString("HH:mm:ss.fff")} | {customers.Count()} Customers wurden geladen.");
return customers;
}
}
}
|
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using RealEstate.BusinessObjects;
using RealEstate.DataAccess;
namespace RealEstate.BusinessLogic
{
public class LanguageBL
{
#region ***** Init Methods *****
LanguageDA objLanguageDA;
public LanguageBL()
{
objLanguageDA = new LanguageDA();
}
#endregion
#region ***** Get Methods *****
/// <summary>
/// Get Language by languageid
/// </summary>
/// <param name="languageid">LanguageId</param>
/// <returns>Language</returns>
public Language GetByLanguageId(int languageid)
{
return objLanguageDA.GetByLanguageId(languageid);
}
/// <summary>
/// Get all of Language
/// </summary>
/// <returns>List<<Language>></returns>
public List<Language> GetList()
{
string cacheName = "lstLanguage";
if( ServerCache.Get(cacheName) == null )
{
ServerCache.Insert(cacheName, objLanguageDA.GetList(), "Language");
}
return (List<Language>) ServerCache.Get(cacheName);
}
/// <summary>
/// Get DataSet of Language
/// </summary>
/// <returns>DataSet</returns>
public DataSet GetDataSet()
{
string cacheName = "dsLanguage";
if( ServerCache.Get(cacheName) == null )
{
ServerCache.Insert(cacheName, objLanguageDA.GetDataSet(), "Language");
}
return (DataSet) ServerCache.Get(cacheName);
}
/// <summary>
/// Get all of Language paged
/// </summary>
/// <param name="recperpage">recperpage</param>
/// <param name="pageindex">pageindex</param>
/// <returns>List<<Language>></returns>
public List<Language> GetListPaged(int recperpage, int pageindex)
{
return objLanguageDA.GetListPaged(recperpage, pageindex);
}
/// <summary>
/// Get DataSet of Language paged
/// </summary>
/// <param name="recperpage">recperpage</param>
/// <param name="pageindex">pageindex</param>
/// <returns>DataSet</returns>
public DataSet GetDataSetPaged(int recperpage, int pageindex)
{
return objLanguageDA.GetDataSetPaged(recperpage, pageindex);
}
#endregion
#region ***** Add Update Delete Methods *****
/// <summary>
/// Add a new Language within Language database table
/// </summary>
/// <param name="obj_language">Language</param>
/// <returns>key of table</returns>
public int Add(Language obj_language)
{
ServerCache.Remove("Language", true);
return objLanguageDA.Add(obj_language);
}
/// <summary>
/// updates the specified Language
/// </summary>
/// <param name="obj_language">Language</param>
/// <returns></returns>
public void Update(Language obj_language)
{
ServerCache.Remove("Language", true);
objLanguageDA.Update(obj_language);
}
/// <summary>
/// Delete the specified Language
/// </summary>
/// <param name="languageid">LanguageId</param>
/// <returns></returns>
public void Delete(int languageid)
{
ServerCache.Remove("Language", true);
objLanguageDA.Delete(languageid);
}
#endregion
}
}
|
using System;
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
{
/// <summary>
/// General client capabilities.
/// </summary>
[Obsolete(Constants.Proposal)]
public class ProposedGeneralClientCapabilities : GeneralClientCapabilities
{
}
}
|
using System.Collections.Generic;
using Task1_DAL.Entities;
namespace Task1_BLL.DTO
{
public class GenreDTO
{
public int Id { get; set; }
public string Name { get; set; }
public int? ParentId { get; set; }
public virtual ICollection<GenreDTO> SubGenres { get; set; }
public virtual ICollection<GameDTO> Games { get; set; }
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassLibrary2
{
public class Prodavac : Uposlenik
{
public Prodavac(string i, string p, DateTime dr, string mr, string JMBG, string u, string ps, string em, DateTime datum)
: base(i,p,dr,mr,JMBG,u,ps,em,datum)
{ }
}
}
|
namespace UInput
{
public class InputAutoMove : InputComponet
{
public override float GetHorizontal()
{
return 1.0f;
}
public override bool GetJump()
{
return false;
}
}
} // namespace UInput
|
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Yandex.Dialogs.Models.Buttons
{
[JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
public class ResponseButton : Button
{
public string Title { get; set; }
public bool Hide { get; set; }
}
}
|
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic; // generic list
using System.Linq;
public class LevelScript : MonoBehaviour {
public GameObject[,] tablica = new GameObject[5,5];
//public string[,] tablist = new string[,];
public List <EnemyScript> listek = new List<EnemyScript> ();
public int listint;
public List <string> listalist1 = new List<string> ();
public List <string> listalist = new List<string> ();
public List< List<string> > listalist3 = new List< List<string> >();
public List< List<string> > listaszer = new List< List<string> >();
// public List<string> listaUtyl = new List<string>();
public Vector3 pozycja;
public GameObject Enemy;
public GameObject Cube;
public GameObject Scene;
bool ruch = true;
public float czasprzerwy =(1.5f);
bool wlewo = true;
public bool wdol = false;
// public GUIText scoreText;
public GameObject scoreText;
public GameObject LivesText;
public GameObject GOText;
public static int score;
GameObject obcy;
string pomoc;
bool alienReloaded=true;
public static int wysSzer=2;
public static int szerSzer=3;
GameObject alien;
public int zycia=3;
bool koniecgry = true;
float timemulti = 0.001f;
int przysint=0;
Text szkorr;
Text txtt;
Text MainText;
public string sss;
//public Text aaa;
public GameObject[,] tablica2d = new GameObject[wysSzer,szerSzer];
// Use this for initialization
void Start () {
GOText.SetActive (false); //ukryj napis
score = 0;
txtt = scoreText.GetComponent<Text>();
szkorr = LivesText.GetComponent<Text> ();
MainText = GOText.GetComponent<Text> ();
UpdateScore ();
StartCoroutine ("NowyPoziom");
// AlienShoot ();
}
void nowaFala()
{
int y=0;
int x=0;
//tablica2d[x,y].Clear();
for (x=0; x<szerSzer; x++) {
listalist3.Add (new List<string> ());
//listaszer.Add (new List<string>());
}
for (y=0; y<wysSzer; y++) {
listaszer.Add (new List<string>());
//listalist3.Add (new List<string> ());
}
for(x=0; x<szerSzer; x++)
{
for(y=0; y<wysSzer; y++)
{
pozycja=gameObject.transform.position + new Vector3(x*2,y*2,0);
// Debug.Log (pozycja);
GameObject go = Instantiate (Enemy, pozycja,transform.rotation) as GameObject;
go.gameObject.name = "Obcy x"+x+" y"+y;
go.gameObject.tag = "Enemy";
go.transform.parent = GameObject.Find("Scene").transform;
listalist3[x].Add(go.name);
}
}
PrzypSzer();
}
IEnumerator NowyPoziom()
{
listalist3.Clear ();
listaszer.Clear ();
koniecgry=true;
GOText.SetActive (true);
MainText.text="Get Ready";
nowaFala ();
yield return new WaitForSeconds(2.0f);
GOText.SetActive (false);
koniecgry=false;
StopCoroutine ("NowyPoziom");
}
void PrzypSzer() //przypisz szereg
{
int ax = 0;
int ay = 0;
for (ay=0; ay<listalist3.Count(); ay++)
{
for (ax=0; ax<listalist3[ay].Count(); ax++)
{
listaszer[ax].Add(listalist3[ay][ax]);
}
}
}
// Update is called once per frame
void FixedUpdate () {
if(koniecgry==false){
if (ruch == true) {
ruch = false;
if(wdol){
StartCoroutine ("RuchwDol");
}
else{
StartCoroutine ("Ruch");
}
}
}
}
void Przyspiesz()
{ przysint++;
if (przysint >= 10) {
timemulti = timemulti + 0.1f;
czasprzerwy = czasprzerwy - timemulti;
przysint=0;
}
}
void GameOver()
{
if (zycia == 0)
{
GOText.SetActive (true);
MainText.text="Gejm Over";
koniecgry=true;
}
else if (zycia > 0) {
zycia--;
StartCoroutine("ReSpawn");
}
UpdateScore ();
// GameObject go = Instantiate (Cube, pozycja,transform.rotation) as GameObject;
}
IEnumerator ReSpawn()
{
// Debug.Log ("wachaj");
pozycja=gameObject.transform.position + new Vector3(0,-10.0f,0);
yield return new WaitForSeconds(2.0f);
GameObject go = Instantiate (Cube, pozycja,transform.rotation) as GameObject;
//reloaded = true;
// Debug.Log ("siura");
}
IEnumerator RuchwDol()
{
//Debug.Log ("ruchwdol");
//alien.BroadcastMessage ("wDol", null, SendMessageOptions.DontRequireReceiver);
for (int y=0; y<listaszer.Count(); y++) {
for (int x=0; x<listaszer[y].Count(); x++) {
GameObject.Find (listaszer [y] [x]).BroadcastMessage ("wDol", SendMessageOptions.DontRequireReceiver);
}
yield return new WaitForSeconds(czasprzerwy/10);
}
// GameObject.Find ("Scene").BroadcastMessage ("wDol", SendMessageOptions.DontRequireReceiver);
wdol = false;
if (wlewo)
{wlewo = false;
}
else
{wlewo = true;}
yield return new WaitForSeconds(czasprzerwy);
ruch = true;
StopCoroutine ("RuchwDol");
//yield break;
ruch = true;
}
IEnumerator Ruch()
{
//StartCoroutine ("ruchwBok");
ruchwBok ();
//AlienShoot (); //strzela po ruchu w czasie (albo i przed) przerwa
yield return new WaitForSeconds(czasprzerwy);
ruch = true;
StopCoroutine ("Ruch");
}
void ruchwBok()
{
if (wlewo) {
for(int y=0;y<listaszer.Count();y++){
for(int x=0;x<listaszer[y].Count();x++){
//GameObject.Find ("Scene").BroadcastMessage ("wLewo", SendMessageOptions.DontRequireReceiver);
GameObject.Find (listaszer[y][x]).BroadcastMessage ("wLewo", SendMessageOptions.RequireReceiver);
//GameObject.Find ("Scene").BroadcastMessage ("wLewo", SendMessageOptions.DontRequireReceiver);
// Debug.Log ("poszedl"+listaszer[y][x]);
}
//yield return new WaitForSeconds(czasprzerwy/10);
// Debug.Log ("poszedl rzad"+y);
}
}
else if (wlewo==false)
{
for(int y=0;y<listaszer.Count();y++){
for(int x=0;x<listaszer[y].Count();x++){
//GameObject.Find ("Scene").BroadcastMessage ("wLewo", SendMessageOptions.DontRequireReceiver);
GameObject.Find (listaszer[y][x]).BroadcastMessage ("wPrawo", SendMessageOptions.RequireReceiver);
//GameObject.Find ("Scene").BroadcastMessage ("wLewo", SendMessageOptions.DontRequireReceiver);
// Debug.Log ("poszedl"+listaszer[y][x]);
}
// yield return new WaitForSeconds(czasprzerwy/10);
// Debug.Log ("poszedl rzad"+y);
}
}
// ruch = true;
AlienShoot ();
StopCoroutine ("ruchwBok");
}
void zmienkier()
{
wdol = true;
}
void UpdateScore()
{
txtt.text = "score: "+score;
szkorr.text = "Lives: " +zycia;
}
public void AddScore()
{
score += 10;
UpdateScore ();
}
void AlienShoot()
{
int szansaStrzalu = Random.Range (0, 10);
// Debug.Log ("Wylosowal");
if ((szansaStrzalu < 2)&&(alienReloaded==true)) {
alienReloaded = false;
/// Debug.Log ("pierwszy if");
int wylosowanyRzad = Random.Range (0, szerSzer); //wylosuj rzad
if ((listalist3 [wylosowanyRzad].Count> 0)||(listalist3 [wylosowanyRzad]!=null)) //sprawdz czy lista nie jest pusta
{
// Debug.Log ("drugi if");
// pomoc = listalist3 [wylosowanyRzad].First();
obcy = GameObject.Find (listalist3 [wylosowanyRzad].First());
//Debug.Log ("najnizszy element " + listalist3 [wylosowanyRzad].Last ());
//GameObject obcy.name=Scene.Search(listalist3[wylosowanyRzad].First());
//obcy = listalist3 [wylosowanyRzad].FirstOrDefault ();
//EnemyScript uhu = obcy.GetComponent<EnemyScript>();
// obcy.BroadcastMessage ("AlienShoot", null, SendMessageOptions.RequireReceiver); //uzyealem tego przed pobieraniem componentu ze skryptu
//listalist3[wylosowanyRzad].First().AlienShoot();
//GameObject.Find ("Scene").BroadcastMessage ("AlienShoot",obcy, SendMessageOptions.DontRequireReceiver);
// StartCoroutine("alienReload");
/* EnemyScript uhu = obcy.GetComponent<EnemyScript>();
uhu.AlienShoot();*/
//listalist3 [wylosowanyRzad].RemoveAt (0);
}
// Debug.Log ("wychodzi z ifa");
/* EnemyScript uhu = obcy.GetComponent<EnemyScript>();
if(obcy!=null)
uhu.AlienShoot();*/
}
// Debug.Log ("Wyszedl z ifa2");
//alienReloaded = true;
}
IEnumerator alienReload()
{
Debug.Log ("Wyczekane Reload");
yield return new WaitForSeconds(3.0f);
alienReloaded = true;
StopCoroutine("alienReload");
}
public void usunzTab(GameObject alien)
{
int x = 0;
int y = 0;
for(int i=0;i<listaszer.Count();i++)
{
for(int j=0;j<listaszer[i].Count();j++)
// foreach(int j in listalist3[i][y])
{
if(listaszer[i][j]==alien.name)
{
/*Debug.Log("element i"+i+" j"+j+" to: "+listalist3[i][j]);
Debug.Log("o kurwa! rowna sie");*/
listaszer[i].RemoveAt(j);
// Debug.Log ("tablica: "+i+ "pozostalo "+listalist3[i].Count+"elementow");
if (listaszer[i].Count()==0)
listaszer.RemoveAt(i);
Przyspiesz();
//Debug.Log ("czasprzerwy: "+czasprzerwy+"multi"+"timemulti: "+timemulti);
// tablica[i,j].RemoveAt(j);
/* if (listalist3.Count==0)
Debug.Log ("Wygrales");*/
// break;
}
}
}
for(int i=0;i<listalist3.Count();i++)
{
for(int j=0;j<listalist3[i].Count();j++)
// foreach(int j in listalist3[i][y])
{
if(listalist3[i][j]==alien.name)
{
// Debug.Log("element i"+i+" j"+j+" to: "+listalist3[i][j]);
// Debug.Log("o kurwa! rowna sie");
listalist3[i].RemoveAt(j);
//Debug.Log ("tablica: "+i+ "pozostalo "+listalist3[i].Count+"elementow");
if (listalist3[i].Count()==0)
listalist3.RemoveAt(i);
// tablica[i,j].RemoveAt(j);
if (listalist3.Count()==0){
Debug.Log ("Wygrales");
StartCoroutine("NowyPoziom");}
break;
}
}
}
}
}
|
using UnityEngine;
using System.Collections;
public class WorldProperties : MonoBehaviour {
private static WorldProperties instance;
public static WorldProperties Instance{ get{ return instance; } private set{ instance = value; } }
[SerializeField]
private float gravity = 25.0f;
public float Gravity{ get{ return gravity; } }
// Use this for initialization
void Awake () {
instance = this;
}
}
|
using System;
using System.ComponentModel;
using Tindero.ViewModels;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace Tindero.Views
{
public partial class ProfilePage : ContentPage
{
private readonly ProfileViewModel _vm;
public ProfilePage()
{
InitializeComponent();
_vm = new ProfileViewModel();
BindingContext = _vm;
}
protected override void OnAppearing()
{
base.OnAppearing();
_vm.OnAppearing();
}
}
} |
using System;
using SLua;
using System.Collections.Generic;
[UnityEngine.Scripting.Preserve]
public class Lua_UnityEngine_ParticleSystem_ShapeModule : LuaObject {
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int constructor(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule o;
o=new UnityEngine.ParticleSystem.ShapeModule();
pushValue(l,true);
pushValue(l,o);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_enabled(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.enabled);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_enabled(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.enabled=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_shapeType(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.shapeType);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_shapeType(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemShapeType v;
v = (UnityEngine.ParticleSystemShapeType)LuaDLL.luaL_checkinteger(l, 2);
self.shapeType=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_randomDirectionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.randomDirectionAmount);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_randomDirectionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.randomDirectionAmount=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_sphericalDirectionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.sphericalDirectionAmount);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_sphericalDirectionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.sphericalDirectionAmount=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_randomPositionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.randomPositionAmount);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_randomPositionAmount(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.randomPositionAmount=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_alignToDirection(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.alignToDirection);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_alignToDirection(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.alignToDirection=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radius(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radius);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radius(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.radius=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radiusMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.radiusMode);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radiusMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemShapeMultiModeValue v;
v = (UnityEngine.ParticleSystemShapeMultiModeValue)LuaDLL.luaL_checkinteger(l, 2);
self.radiusMode=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radiusSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radiusSpread);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radiusSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.radiusSpread=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radiusSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radiusSpeed);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radiusSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.radiusSpeed=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radiusSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radiusSpeedMultiplier);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radiusSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.radiusSpeedMultiplier=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_radiusThickness(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.radiusThickness);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_radiusThickness(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.radiusThickness=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_angle(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.angle);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_angle(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.angle=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_length(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.length);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_length(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.length=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_boxThickness(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.boxThickness);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_boxThickness(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Vector3 v;
checkType(l,2,out v);
self.boxThickness=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshShapeType(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.meshShapeType);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshShapeType(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemMeshShapeType v;
v = (UnityEngine.ParticleSystemMeshShapeType)LuaDLL.luaL_checkinteger(l, 2);
self.meshShapeType=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_mesh(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.mesh);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_mesh(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Mesh v;
checkType(l,2,out v);
self.mesh=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.meshRenderer);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.MeshRenderer v;
checkType(l,2,out v);
self.meshRenderer=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_skinnedMeshRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.skinnedMeshRenderer);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_skinnedMeshRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.SkinnedMeshRenderer v;
checkType(l,2,out v);
self.skinnedMeshRenderer=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_sprite(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.sprite);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_sprite(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Sprite v;
checkType(l,2,out v);
self.sprite=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_spriteRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.spriteRenderer);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_spriteRenderer(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.SpriteRenderer v;
checkType(l,2,out v);
self.spriteRenderer=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_useMeshMaterialIndex(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.useMeshMaterialIndex);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_useMeshMaterialIndex(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.useMeshMaterialIndex=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshMaterialIndex(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.meshMaterialIndex);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshMaterialIndex(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
int v;
checkType(l,2,out v);
self.meshMaterialIndex=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_useMeshColors(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.useMeshColors);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_useMeshColors(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.useMeshColors=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_normalOffset(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.normalOffset);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_normalOffset(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.normalOffset=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshSpawnMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.meshSpawnMode);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshSpawnMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemShapeMultiModeValue v;
v = (UnityEngine.ParticleSystemShapeMultiModeValue)LuaDLL.luaL_checkinteger(l, 2);
self.meshSpawnMode=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshSpawnSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.meshSpawnSpread);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshSpawnSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.meshSpawnSpread=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshSpawnSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.meshSpawnSpeed);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshSpawnSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.meshSpawnSpeed=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_meshSpawnSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.meshSpawnSpeedMultiplier);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_meshSpawnSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.meshSpawnSpeedMultiplier=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_arc(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.arc);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_arc(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.arc=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_arcMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.arcMode);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_arcMode(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemShapeMultiModeValue v;
v = (UnityEngine.ParticleSystemShapeMultiModeValue)LuaDLL.luaL_checkinteger(l, 2);
self.arcMode=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_arcSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.arcSpread);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_arcSpread(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.arcSpread=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_arcSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.arcSpeed);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_arcSpeed(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystem.MinMaxCurve v;
checkValueType(l,2,out v);
self.arcSpeed=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_arcSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.arcSpeedMultiplier);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_arcSpeedMultiplier(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.arcSpeedMultiplier=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_donutRadius(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.donutRadius);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_donutRadius(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.donutRadius=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_position(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.position);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_position(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Vector3 v;
checkType(l,2,out v);
self.position=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_rotation(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.rotation);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_rotation(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Vector3 v;
checkType(l,2,out v);
self.rotation=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_scale(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.scale);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_scale(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Vector3 v;
checkType(l,2,out v);
self.scale=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_texture(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.texture);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_texture(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.Texture2D v;
checkType(l,2,out v);
self.texture=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureClipChannel(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushEnum(l,(int)self.textureClipChannel);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureClipChannel(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
UnityEngine.ParticleSystemShapeTextureChannel v;
v = (UnityEngine.ParticleSystemShapeTextureChannel)LuaDLL.luaL_checkinteger(l, 2);
self.textureClipChannel=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureClipThreshold(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.textureClipThreshold);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureClipThreshold(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
float v;
checkType(l,2,out v);
self.textureClipThreshold=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureColorAffectsParticles(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.textureColorAffectsParticles);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureColorAffectsParticles(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.textureColorAffectsParticles=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureAlphaAffectsParticles(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.textureAlphaAffectsParticles);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureAlphaAffectsParticles(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.textureAlphaAffectsParticles=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureBilinearFiltering(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.textureBilinearFiltering);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureBilinearFiltering(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
bool v;
checkType(l,2,out v);
self.textureBilinearFiltering=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int get_textureUVChannel(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
pushValue(l,true);
pushValue(l,self.textureUVChannel);
return 2;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[SLua.MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
[UnityEngine.Scripting.Preserve]
static public int set_textureUVChannel(IntPtr l) {
try {
#if DEBUG
var method = System.Reflection.MethodBase.GetCurrentMethod();
string methodName = GetMethodName(method);
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.BeginSample(methodName);
#else
Profiler.BeginSample(methodName);
#endif
#endif
UnityEngine.ParticleSystem.ShapeModule self;
checkValueType(l,1,out self);
int v;
checkType(l,2,out v);
self.textureUVChannel=v;
setBack(l,self);
pushValue(l,true);
return 1;
}
catch(Exception e) {
return error(l,e);
}
#if DEBUG
finally {
#if UNITY_5_5_OR_NEWER
UnityEngine.Profiling.Profiler.EndSample();
#else
Profiler.EndSample();
#endif
}
#endif
}
[UnityEngine.Scripting.Preserve]
static public void reg(IntPtr l) {
getTypeTable(l,"UnityEngine.ParticleSystem.ShapeModule");
addMember(l,"enabled",get_enabled,set_enabled,true);
addMember(l,"shapeType",get_shapeType,set_shapeType,true);
addMember(l,"randomDirectionAmount",get_randomDirectionAmount,set_randomDirectionAmount,true);
addMember(l,"sphericalDirectionAmount",get_sphericalDirectionAmount,set_sphericalDirectionAmount,true);
addMember(l,"randomPositionAmount",get_randomPositionAmount,set_randomPositionAmount,true);
addMember(l,"alignToDirection",get_alignToDirection,set_alignToDirection,true);
addMember(l,"radius",get_radius,set_radius,true);
addMember(l,"radiusMode",get_radiusMode,set_radiusMode,true);
addMember(l,"radiusSpread",get_radiusSpread,set_radiusSpread,true);
addMember(l,"radiusSpeed",get_radiusSpeed,set_radiusSpeed,true);
addMember(l,"radiusSpeedMultiplier",get_radiusSpeedMultiplier,set_radiusSpeedMultiplier,true);
addMember(l,"radiusThickness",get_radiusThickness,set_radiusThickness,true);
addMember(l,"angle",get_angle,set_angle,true);
addMember(l,"length",get_length,set_length,true);
addMember(l,"boxThickness",get_boxThickness,set_boxThickness,true);
addMember(l,"meshShapeType",get_meshShapeType,set_meshShapeType,true);
addMember(l,"mesh",get_mesh,set_mesh,true);
addMember(l,"meshRenderer",get_meshRenderer,set_meshRenderer,true);
addMember(l,"skinnedMeshRenderer",get_skinnedMeshRenderer,set_skinnedMeshRenderer,true);
addMember(l,"sprite",get_sprite,set_sprite,true);
addMember(l,"spriteRenderer",get_spriteRenderer,set_spriteRenderer,true);
addMember(l,"useMeshMaterialIndex",get_useMeshMaterialIndex,set_useMeshMaterialIndex,true);
addMember(l,"meshMaterialIndex",get_meshMaterialIndex,set_meshMaterialIndex,true);
addMember(l,"useMeshColors",get_useMeshColors,set_useMeshColors,true);
addMember(l,"normalOffset",get_normalOffset,set_normalOffset,true);
addMember(l,"meshSpawnMode",get_meshSpawnMode,set_meshSpawnMode,true);
addMember(l,"meshSpawnSpread",get_meshSpawnSpread,set_meshSpawnSpread,true);
addMember(l,"meshSpawnSpeed",get_meshSpawnSpeed,set_meshSpawnSpeed,true);
addMember(l,"meshSpawnSpeedMultiplier",get_meshSpawnSpeedMultiplier,set_meshSpawnSpeedMultiplier,true);
addMember(l,"arc",get_arc,set_arc,true);
addMember(l,"arcMode",get_arcMode,set_arcMode,true);
addMember(l,"arcSpread",get_arcSpread,set_arcSpread,true);
addMember(l,"arcSpeed",get_arcSpeed,set_arcSpeed,true);
addMember(l,"arcSpeedMultiplier",get_arcSpeedMultiplier,set_arcSpeedMultiplier,true);
addMember(l,"donutRadius",get_donutRadius,set_donutRadius,true);
addMember(l,"position",get_position,set_position,true);
addMember(l,"rotation",get_rotation,set_rotation,true);
addMember(l,"scale",get_scale,set_scale,true);
addMember(l,"texture",get_texture,set_texture,true);
addMember(l,"textureClipChannel",get_textureClipChannel,set_textureClipChannel,true);
addMember(l,"textureClipThreshold",get_textureClipThreshold,set_textureClipThreshold,true);
addMember(l,"textureColorAffectsParticles",get_textureColorAffectsParticles,set_textureColorAffectsParticles,true);
addMember(l,"textureAlphaAffectsParticles",get_textureAlphaAffectsParticles,set_textureAlphaAffectsParticles,true);
addMember(l,"textureBilinearFiltering",get_textureBilinearFiltering,set_textureBilinearFiltering,true);
addMember(l,"textureUVChannel",get_textureUVChannel,set_textureUVChannel,true);
createTypeMetatable(l,constructor, typeof(UnityEngine.ParticleSystem.ShapeModule),typeof(System.ValueType));
}
}
|
namespace BankClassLib
{
public class AccountListItem
{
public int AccountNumber { get; set; }
public string Name { get; set; }
public double Balance { get; set; }
public AccountType AccountType { get; set; }
}
}
|
namespace Triton.Game.Mapping
{
using ns26;
using System;
using Triton.Game;
using Triton.Game.Mono;
[Attribute38("BnetEventMgr")]
public class BnetEventMgr : MonoClass
{
public BnetEventMgr(IntPtr address) : this(address, "BnetEventMgr")
{
}
public BnetEventMgr(IntPtr address, string className) : base(address, className)
{
}
public static BnetEventMgr Get()
{
return MonoClass.smethod_15<BnetEventMgr>(TritonHs.MainAssemblyPath, "", "BnetEventMgr", "Get", Array.Empty<object>());
}
public void Initialize()
{
base.method_8("Initialize", Array.Empty<object>());
}
public void Shutdown()
{
base.method_8("Shutdown", Array.Empty<object>());
}
}
}
|
namespace CustomerManagement.Domain.Interfaces
{
public class DbContext
{
}
} |
using Migration.Common.Log;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
namespace Migration.WIContract
{
public class WiItemProvider
{
private readonly string _itemsDir;
public WiItemProvider(string itemsDir)
{
_itemsDir = itemsDir;
}
public WiItem Load(string originId)
{
var path = Path.Combine(_itemsDir, $"{originId}.json");
return LoadFile(path);
}
private WiItem LoadFile(string path)
{
var serialized = File.ReadAllText(path);
var deserialized = JsonConvert.DeserializeObject<WiItem>(serialized, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore});
foreach (var rev in deserialized.Revisions)
rev.ParentOriginId = deserialized.OriginId;
return deserialized;
}
public void Save(WiItem item)
{
string path = Path.Combine(_itemsDir, $"{item.OriginId}.json");
var serialized = JsonConvert.SerializeObject(item);
File.WriteAllText(path, serialized);
}
public IEnumerable<WiItem> EnumerateAllItems()
{
var result = new List<WiItem>();
foreach (var filePath in Directory.EnumerateFiles(_itemsDir, "*.json"))
{
try
{
result.Add(LoadFile(filePath));
}
catch(Exception)
{
Logger.Log(LogLevel.Warning, $"Failed to load '{Path.GetFileName(filePath)}' (perhaps not a migration file?).");
}
}
return result;
}
}
} |
using System;
using System.Collections.Generic;
#nullable disable
namespace Repository.Models
{
/// <summary>
/// Repo Model from database-first scaffolding
/// </summary>
public partial class UserLike
{
public string CommentId { get; set; }
public string UserId { get; set; }
public virtual Comment Comment { get; set; }
}
}
|
using Entidades;
using Entidades.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PetShopForms.Vistas.Ventas
{
public partial class VentaData : Form
{
Cliente clienteSeleccionado;
Producto productoSeleccionado;
int unidades;
double totalUnidades;
float costoEnvio;
double costoEnvioTotal;
double costoTotal;
public Cliente ClienteSeleccionado
{
get
{
return this.clienteSeleccionado;
}
set
{
this.clienteSeleccionado = value;
}
}
public Producto ProductoSeleccionado
{
get
{
return this.productoSeleccionado;
}
set
{
this.productoSeleccionado = value;
}
}
public int Unidades
{
get
{
return this.unidades;
}
set
{
this.unidades = value;
}
}
ETipoEnvio tipoEnvio;
public ETipoEnvio TipoEnvio
{
get
{
return this.tipoEnvio;
}
set
{
this.cmbTipoEnvio.SelectedIndex = (int)value;
this.tipoEnvio = value;
}
}
public VentaData()
{
InitializeComponent();
}
private void VentaData_Load(object sender, EventArgs e)
{
dgvProductos.DataSource = Producto.ListaProductos;
dgvClientes.DataSource = Core.ListaClientes;
this.txtUnidades.Text = "0";
ProductoSeleccionado = (Producto)this.dgvProductos.CurrentRow.DataBoundItem;
ClienteSeleccionado = (Cliente)this.dgvClientes.CurrentRow.DataBoundItem;
Array enums = Enum.GetValues(typeof(ETipoEnvio));
foreach (var item in enums)
{
this.cmbTipoEnvio.Items.Add(item);
}
this.cmbTipoEnvio.SelectedItem = this.cmbTipoEnvio.Items[0];
}
private void btnAddUnit_Click(object sender, EventArgs e)
{
if (this.txtUnidades.Text.Length > 0)
{
int value = int.Parse(this.txtUnidades.Text);
value++;
this.txtUnidades.Text = value.ToString();
}
}
private void txtUnidades_TextChanged(object sender, EventArgs e)
{
if (this.txtUnidades.Text.Length > 0)
{
if (Validaciones.ValidarDouble(this.txtUnidades.Text))
{
this.Unidades = int.Parse(this.txtUnidades.Text);
this.CargarCostos();
}
else
{
this.txtUnidades.Text = "0";
MessageBox.Show("Solo estan permitidos numeros",
"Error",
MessageBoxButtons.OK);
}
}
}
private void btnRemoveUnit_Click(object sender, EventArgs e)
{
if (this.txtUnidades.Text.Length > 0)
{
int value = int.Parse(this.txtUnidades.Text);
if (value > 0)
{
value--;
this.txtUnidades.Text = value.ToString();
}
}
}
private void dgvProductos_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
ProductoSeleccionado = (Producto)dgvProductos.CurrentRow.DataBoundItem;
this.CargarCostos();
}
private void dgvClientes_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
ClienteSeleccionado = (Cliente)dgvClientes.CurrentRow.DataBoundItem;
this.CargarCostos();
}
private void cmbTipoEnvio_SelectedIndexChanged(object sender, EventArgs e)
{
this.TipoEnvio = (ETipoEnvio)this.cmbTipoEnvio.SelectedItem;
this.CargarCostos();
}
void CargarCostos()
{
totalUnidades = ProductoSeleccionado.Precio * this.Unidades;
costoEnvio = Core.CostoTipoEnvio[TipoEnvio.ToString()];
costoEnvioTotal = Math.Round(this.ClienteSeleccionado.KmsEnvio / 2 + costoEnvio + this.ProductoSeleccionado.Peso * this.Unidades / 10f, 2, MidpointRounding.AwayFromZero);
costoTotal = Math.Round(totalUnidades + costoEnvioTotal, 2, MidpointRounding.AwayFromZero);
this.lblTotalUnidades.Text = totalUnidades.ToString();
this.lblCostoEnvio.Text = costoEnvioTotal.ToString();
this.lblTotal.Text = costoTotal.ToString();
Inicio.ResetTimeOutTime();
}
private void dgvClientes_MouseUp(object sender, MouseEventArgs e)
{
ClienteSeleccionado = (Cliente)dgvClientes.CurrentRow.DataBoundItem;
this.CargarCostos();
}
private void dgvProductos_MouseUp(object sender, MouseEventArgs e)
{
ProductoSeleccionado = (Producto)dgvProductos.CurrentRow.DataBoundItem;
this.CargarCostos();
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
namespace HotelManagement
{
public partial class Signin : Form
{
public Signin()
{
InitializeComponent();
HoanTat_Option.Click += new EventHandler(this.HoanTat_Option_Click);
}
private void Signin_Load(object sender, EventArgs e)
{
}
private void HoanTat_Option_Click(object sender, EventArgs e)
{
string name = hotentb.Text;
string username = textBox2.Text;
string pass = matkhautb.Text;
string repass = nhaplaimatkhautb.Text;
string cmnd = cmndtb.Text;
string address = diachitb.Text;
string phone = sdttb.Text;
string mail = emailtb.Text;
string description = motatb.Text;
if (pass == repass)
{
string strConn = ConfigurationManager.ConnectionStrings["Demo"].ToString();
SqlConnection conn = new SqlConnection(strConn);
try
{
using (SqlCommand cmd = new SqlCommand("SP_RegisterAccount", conn))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@HoTen", SqlDbType.NVarChar).Value = name;
cmd.Parameters.Add("@TenDangNhap", SqlDbType.NVarChar).Value = username;
cmd.Parameters.Add("@MatKhau", SqlDbType.VarChar).Value = pass;
cmd.Parameters.Add("@soCMND", SqlDbType.VarChar).Value = cmnd;
cmd.Parameters.Add("@diaChi", SqlDbType.NVarChar).Value = address;
cmd.Parameters.Add("@soDienThoai", SqlDbType.VarChar).Value = phone;
cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = mail;
cmd.Parameters.Add("@moTa", SqlDbType.VarChar).Value = description;
cmd.Parameters.Add("@RESULT", SqlDbType.TinyInt).Direction = ParameterDirection.Output;
conn.Open();
cmd.ExecuteNonQuery();
string retunvalue = cmd.Parameters["@RESULT"].Value.ToString();
switch (retunvalue)
{
case "0":
MessageBox.Show("Bạn Chưa Điền Đầy Đủ Thông Tin Đăng Ký.");
break;
case "1":
MessageBox.Show("Đăng Ký Thành Công.");
MainMenu menu = new MainMenu();
menu.Show();
this.Hide();
break;
case "2":
MessageBox.Show("Tên Đăng Nhập Đã Tồn Tại.");
break;
case "3":
MessageBox.Show("Số CMND Đã Tồn Tại.");
break;
case "4":
MessageBox.Show("Số Điện Thoại Đã Tồn Tại.");
break;
case "5":
MessageBox.Show("Địa Chỉ Email Đã Tồn Tại.");
break;
}
}
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
else
{
MessageBox.Show("Mật Khẩu Xác Nhận Không Khớp !!!.");
}
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class camMove : MonoBehaviour
{
public Transform player;
public float smooth;
// Start is called before the first frame update
void Start()
{
}
void LateUpdate()
{
if(transform.position != player.position)
{
Vector3 playerPosition = new Vector3(
player.position.x,
player.position.y,
transform.position.z);
transform.position = Vector3.Lerp(
transform.position,
playerPosition,
smooth);
}
}
}
|
using System.Collections.Generic;
namespace PathfindingVisualisation
{
public class MapPath
{
public MapPath(Point start, Point target, Dictionary<Point, Point> data)
{
Start = start;
Target = target;
Data = data;
Route = FindRoute();
}
public Point Start { get; }
public Point Target { get; }
public Dictionary<Point, Point> Data { get; }
public bool HasRoute => Route != null;
public Dictionary<Point, Point> Route { get; }
public int RouteLength => Route?.Count ?? int.MaxValue;
private Dictionary<Point, Point> FindRoute()
{
var route = new Dictionary<Point, Point>
{
[Target] = Target,
};
var current = Target;
if (!Data.TryGetValue(current, out var next))
{
return null;
}
while (current != Start)
{
route[next] = current;
current = next;
if (!Data.TryGetValue(current, out next))
{
return null;
}
}
if (!route.ContainsKey(Start))
{
return null;
}
return route;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SettingManager : MonoBehaviour
{
public void onLanguageButton()
{
SceneManager.LoadScene("LanguageSelection");
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;
namespace Combination
{
public partial class CheckExternalBoxAndLabel : Form
{
string querySum;
string queryDetail, queryHeader;
string path, inputPath, exportPath, filePath;
Excel.Application excelApp;
Excel._Workbook wBook;
Excel._Worksheet wSheet;
Excel.Range wRange;
Sql sql = new Sql();
public CheckExternalBoxAndLabel()
{
InitializeComponent();
}
private void ckbDetail_OnChange(object sender, EventArgs e)
{
if (ckbDetail.Checked == true)
{
dateTimePicker1.Enabled = false;
dateTimePicker2.Enabled = false;
label2.Visible = true;
txtOrderCode.Visible = true;
txtModel.Visible = true;
txtOrderQty.Visible = true;
txtStorageQty.Visible = true;
txtBoxQty.Visible = true;
txtLabelQty.Visible = true;
label5.Visible = true;
label6.Visible = true;
label7.Visible = true;
label8.Visible = true;
label9.Visible = true;
dgvTot.Visible = false;
dgv2.Visible = true;
}
else
{
dateTimePicker1.Enabled = true;
dateTimePicker2.Enabled = true;
label2.Visible = false;
txtOrderCode.Visible = false;
txtModel.Visible = false;
txtOrderQty.Visible = false;
txtStorageQty.Visible = false;
txtBoxQty.Visible = false;
txtLabelQty.Visible = false;
label5.Visible = false;
label6.Visible = false;
label7.Visible = false;
label8.Visible = false;
label9.Visible = false;
dgvTot.Visible = true;
dgv2.Visible = false;
}
}
private void Load_HeaderData(string query)
{
DataTable dt = new DataTable();
dt = sql.getQuery(query);
foreach (DataRow item in dt.Rows)
{
txtModel.Text = item["產品名稱"].ToString();
txtOrderQty.Text = Convert.ToDecimal(item["下單數"]).ToString("N0");
txtStorageQty.Text = Convert.ToDecimal(item["入庫量"]).ToString("N0");
txtBoxQty.Text = Convert.ToDecimal(item["外箱領料"]).ToString("N0");
txtLabelQty.Text = Convert.ToDecimal(item["標籤領料"]).ToString("N0");
}
}
public void Load_Data(string query)
{
Sql sql = new Sql();
DataTable dt = new DataTable();
dt = sql.getQuery(query);
if(query == querySum)
{
foreach (DataRow item in dt.Rows)
{
int n = this.dgvTot.Rows.Add();
dgvTot.Rows[n].Cells[0].Value = item["OID"].ToString();
dgvTot.Rows[n].Cells[1].Value = item["Fmodel"].ToString();
dgvTot.Rows[n].Cells[2].Value = Convert.ToDecimal(item["需求量"]).ToString("N0");
dgvTot.Rows[n].Cells[3].Value = Convert.ToDecimal(item["已入庫量"]).ToString("N0");
dgvTot.Rows[n].Cells[4].Value = Convert.ToDecimal(item["排程預計產量"]).ToString("N0");
dgvTot.Rows[n].Cells[5].Value = Convert.ToDecimal(item["外箱已領數量"]).ToString("N0");
dgvTot.Rows[n].Cells[6].Value = Convert.ToDecimal(item["標籤已領數量"]).ToString("N0");
dgvTot.Rows[n].Cells[7].Value = Convert.ToDecimal(item["現場外箱余量"]).ToString("N0");
dgvTot.Rows[n].Cells[8].Value = Convert.ToDecimal(item["現場標籤余量"]).ToString("N0");
dgvTot.Rows[n].Cells[9].Value = Convert.ToDecimal(item["外箱應發料數量"]).ToString("N0");
dgvTot.Rows[n].Cells[10].Value = Convert.ToDecimal(item["標籤應發料數量"]).ToString("N0");
dgvTot.Rows[n].Cells[11].Value = Convert.ToDecimal(item["外箱庫存"]).ToString("N0");
dgvTot.Rows[n].Cells[12].Value = Convert.ToDecimal(item["標籤庫存"]).ToString("N0");
dgvTot.Rows[n].Cells[13].Value = item["FbaseUnitID"].ToString();
}
}
else if(query == queryDetail)
{
foreach (DataRow item in dt.Rows)
{
int n = this.dgv2.Rows.Add();
dgv2.Rows[n].Cells[0].Value = item["日期"].ToString();
dgv2.Rows[n].Cells[1].Value = Convert.ToDecimal(item["Qty"]).ToString("N0");
dgv2.Rows[n].Cells[2].Value = item["FCUUnitName"].ToString();
dgv2.Rows[n].Cells[3].Value = Convert.ToDecimal(item["外箱當天領料"]).ToString("N0");
dgv2.Rows[n].Cells[4].Value = Convert.ToDecimal(item["標籤當天領料"]).ToString("N0");
dgv2.Rows[n].Cells[5].Value = Convert.ToDecimal(item["外箱累計余量"]).ToString("N0");
dgv2.Rows[n].Cells[6].Value = Convert.ToDecimal(item["標籤累計余量"]).ToString("N0");
dgv2.Rows[n].Cells[7].Value = item["FBaseUnitID"].ToString();
}
}
}
private void btnSearch_Click(object sender, EventArgs e)
{
if (ckbDetail.Checked == true)
{
dgv2.Rows.Clear();
queryHeader = "select c.FBillno as 製造單號,c.Fmodel as 產品名稱,c.FAuxQty as 下單數,isnull(a.Qty,0) as 入庫量,isnull(b.FBaseQty,0) as 外箱領料,isnull(d.FBaseQty,0) as 標籤領料 from " +
"(select b.Fbillno, b.FAuxQty, b.Fmodel from((select a.Fbillno, a.FAuxQty, b.FMODEL from[" + sql.CYDB + "].[dbo].[ICMO] a,[" + sql.CYDB + "].[dbo].[T_ICITem] b where a.FitemID = b.FitemID) union all(select a.Fbillno, a.FAuxQty, b.FMODEL from[" + sql.CKDB + "].[dbo].[ICMO] a,[" + sql.CYDB + "].[dbo].[T_ICITem] b where a.FitemID = b.FitemID)) b) c left join " +
"(select a.FbatchNo, a.Fmodel, SUM(a.Qty) as Qty, a.FCUUnitName from(select * from((select a.FKFDate, a.FbatchNo, a.Fmodel, a.Qty, a.FCUUnitName, isnull(b.FChildQty, 0) as FChildQty " +
"from(select d.Fnumber, a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty, 0)) as Qty, b.FCUUnitName, Sum(isnull(a.FAuxQty, 0)) * b.FEntrySelfA0245 as PCS " +
"from[" + sql.CYDB + "].[dbo].[ICStockbillentry] a,[" + sql.CYDB + "].[dbo].[vwICBill_2] b,[" + sql.CYDB + "].[dbo].[t_ICItem] d " +
"where a.FinterID = b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo <> '' " +
"group by a.FKFDate, a.FbatchNo, d.Fmodel, b.FEntrySelfA0245, b.FCUUnitName, d.Fnumber) a left join " +
"(select FNumber, FChildQty from[" + sql.CYDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber) union all " +
"(select a.FKFDate, a.FbatchNo, a.Fmodel, a.Qty, a.FCUUnitName, b.FChildQty from " +
"(select d.Fnumber, a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty, 0)) as Qty, b.FCUUnitName, Sum(isnull(a.FAuxQty, 0)) * b.FEntrySelfA0245 as PCS " +
"from[" + sql.CKDB + "].[dbo].[ICStockbillentry] a,[" + sql.CKDB + "].[dbo].[vwICBill_2] b,[" + sql.CKDB + "].[dbo].[t_ICItem] d " +
"where a.FinterID = b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo <> '' " +
"group by a.FKFDate, a.FbatchNo, d.Fmodel, b.FEntrySelfA0245, b.FCUUnitName, d.Fnumber) a left join " +
"(select FNumber, FChildQty from[" + sql.CKDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber)) a) a " +
"group by a.FbatchNo,a.Fmodel,a.FCUUnitName) a on a.Fbatchno = c.Fbillno left join " +
"(select* from ((select b.Fuse, d.Fmodel, SUM(b.FBaseQty) as FBaseQty,b.FBaseUnitID from[" + sql.CYDB + "].[dbo].[ICStockbillentry] a,[" + sql.CYDB + "].[dbo].[vwICBill_11] b,[" + sql.CYDB + "].[dbo].[ICStockbill] c,[" + sql.CYDB + "].[dbo].[T_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' group by b.Fuse,d.Fmodel,b.FBaseUnitID) Union all " +
"(select b.Fuse, d.Fmodel, SUM(b.FBaseQty) as FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' group by b.Fuse, d.Fmodel, b.FBaseUnitID))b) b on c.FBillNo = b.FUse left join " +
"(select* from ((select b.Fuse, SUM(b.FBaseQty) as FBaseQty, b.FBaseUnitID from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%' group by b.Fuse, b.FBaseUnitID) Union all " +
"(select b.Fuse, SUM(b.FBaseQty) as FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%' group by b.Fuse, b.FBaseUnitID))b) d on d.Fuse = c.Fbillno " +
"where c.FbillNo = '" + txtOrderCode.Text + "'";
queryDetail = @"select convert(char,V1.FKFdate,23) as 日期,V1.Qty,isnull(V1.FCUUnitName,'箱') as FCUUnitName,V1.FBaseQty as 外箱當天領料,V1.FBaseQty2 as 標籤當天領料,SUM(isnull(V2.余量,0)) as 外箱累計余量,SUM(isnull(V2.標籤余量,0)) as 標籤累計余量,isnull(V1.FBaseUnitID,'PCS') as FBaseUnitID from
(select isnull(isnull(b.Fdate,a.FKFDate),c.FDate) as FKFDate,a.FBatchNo,isnull(a.Qty,0) as Qty,a.FCUUnitName,isNULL(b.FBaseQty,0) as FBaseQty,b.FBaseUnitID,isNULL(b.FBaseQty,0)-isnull(a.Qty,0) as 余量,isNULL(c.FBaseQty,0) as FBaseQty2,isNULL(c.FBaseQty,0)-isnull(a.Qty,0)*isnull(c.FChildQty,a.FChildQty) as 標籤余量 from
(select * from((select a.FKFDate,a.FbatchNo,a.Fmodel,a.Qty,a.FCUUnitName,isnull(b.FChildQty,0) as FChildQty
from (select d.Fnumber,a.FKFDate,a.FbatchNo,d.Fmodel,Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty,0))*b.FEntrySelfA0245 as PCS
from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a,[" + sql.CYDB + "].[dbo].[vwICBill_2] b,[" + sql.CYDB + "].[dbo].[t_ICItem] d " +
"where a.FinterID = b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName,d.Fnumber) a left join " +
"(select FNumber, FChildQty from[" + sql.CYDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber) union all " +
"(select a.FKFDate, a.FbatchNo, a.Fmodel, a.Qty, a.FCUUnitName, b.FChildQty from " +
"(select d.Fnumber, a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty, 0)) * b.FEntrySelfA0245 as PCS " +
"from[" + sql.CKDB + "].[dbo].[ICStockbillentry] a,[" + sql.CKDB + "].[dbo].[vwICBill_2] b,[" + sql.CKDB + "].[dbo].[t_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName,d.Fnumber) a left join " +
"(select FNumber, FChildQty from [" + sql.CKDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber)) a " +
"where a.FbatchNo = '" + txtOrderCode.Text + "') a full outer join " +
"(select b.FDate, b.Fuse, b.Fmodel, SUM(b.FBaseQty) as FbaseQty, b.FBaseUnitID from ((select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and b.Fuse = '" + txtOrderCode.Text + "') union all " +
"(select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and b.Fuse = '" + txtOrderCode.Text + "'))b group by b.FDate, b.Fuse, b.Fmodel, b.FBaseUnitID)b on a.FKFdate = b.Fdate full outer join " +
"(select a.Fbillno, a.FchildQty, b.Fdate, SUM(b.FbaseQty) as FbaseQty, b.FBaseUnitID from " +
"((select Fbillno, c.FchildQty from [" + sql.CYDB + "].[dbo].[ICMO] a, [" + sql.CYDB + "].[dbo].[t_ICItem] b, [" + sql.CYDB + "].[dbo].[vICBOM] c where a.FitemID = b.FitemID and b.FNumber = c.Fnumber and c.Fchildmodel like '%贴纸%qs%' and c.FuseStatus = '使用') union all " +
"(select Fbillno, c.FchildQty from [" + sql.CKDB + "].[dbo].[ICMO] a, [" + sql.CKDB + "].[dbo].[t_ICItem] b, [" + sql.CKDB + "].[dbo].[vICBOM] c where a.FitemID = b.FitemID and b.FNumber = c.Fnumber and c.Fchildmodel like '%贴纸%qs%' and c.FuseStatus = '使用'))a left join " +
"((select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%') union all " +
"(select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%'))b on a.Fbillno = b.Fuse where a.Fbillno = '" + txtOrderCode.Text + "' " +
"group by a.Fbillno,a.FchildQty,b.Fdate,b.FBaseUnitID) c on isnull(a.FKFDate, b.Fdate) = c.Fdate) v1, " +
"(select isnull(isnull(a.FKFdate, b.FDate),c.Fdate) as FKFDate,a.FBatchNo,isnull(a.Qty,0) as Qty,a.FCUUnitName,isnull(isnull(b.Fdate, a.FKFDate), c.FDate) as FDate,isNULL(b.FBaseQty,0) as FBaseQty,isnull(b.FBaseUnitID,'PCS') as FBaseUnitID,isNULL(b.FBaseQty,0)-isnull(a.Qty,0) as 余量,isNULL(c.FBaseQty,0) as FBaseQty2,isNULL(c.FBaseQty,0)-isnull(a.Qty,0)*isnull(c.FChildQty, a.FChildQty) as 標籤余量 from " +
"(select* from((select a.FKFDate, a.FbatchNo, a.Fmodel, a.Qty, a.FCUUnitName, isnull(b.FChildQty,0) as FChildQty " +
"from(select d.Fnumber, a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty,0))*b.FEntrySelfA0245 as PCS " +
"from[" + sql.CYDB + "].[dbo].[ICStockbillentry] a,[" + sql.CYDB + "].[dbo].[vwICBill_2] b,[" + sql.CYDB + "].[dbo].[t_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName,d.Fnumber) a left join " +
"(select FNumber, FChildQty from [" + sql.CYDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber) union all " +
"(select a.FKFDate, a.FbatchNo, a.Fmodel, a.Qty, a.FCUUnitName, b.FChildQty from " +
"(select d.Fnumber, a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty,0))*b.FEntrySelfA0245 as PCS " +
"from[" + sql.CKDB + "].[dbo].[ICStockbillentry] a,[" + sql.CKDB + "].[dbo].[vwICBill_2] b,[" + sql.CKDB + "].[dbo].[t_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName,d.Fnumber) a left join " +
"(select FNumber, FChildQty from [" + sql.CKDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') b on a.FNumber = b.Fnumber)) a " +
"where a.FbatchNo = '" + txtOrderCode.Text + "') a full outer join " +
"(select b.FDate, b.Fuse, b.Fmodel, SUM(b.FBaseQty) as FbaseQty, b.FBaseUnitID from ((select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and b.Fuse = '" + txtOrderCode.Text + "') union all " +
"(select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and b.Fuse = '" + txtOrderCode.Text + "'))b group by b.FDate, b.Fuse, b.Fmodel, b.FBaseUnitID)b on a.FKFdate = b.Fdate full outer join " +
"(select a.Fbillno, a.FchildQty, b.Fdate, SUM(b.FbaseQty) as FbaseQty, b.FBaseUnitID from " +
"((select Fbillno, c.FchildQty from [" + sql.CYDB + "].[dbo].[ICMO] a, [" + sql.CYDB + "].[dbo].[t_ICItem] b, [" + sql.CYDB + "].[dbo].[vICBOM] c where a.FitemID = b.FitemID and b.FNumber = c.Fnumber and c.Fchildmodel like '%贴纸%qs%' and c.FuseStatus = '使用') union all " +
"(select Fbillno, c.FchildQty from [" + sql.CKDB + "].[dbo].[ICMO] a, [" + sql.CKDB + "].[dbo].[t_ICItem] b, [" + sql.CKDB + "].[dbo].[vICBOM] c where a.FitemID = b.FitemID and b.FNumber = c.Fnumber and c.Fchildmodel like '%贴纸%qs%' and c.FuseStatus = '使用'))a left join " +
"((select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%') union all " +
"(select c.Fdate, b.Fuse, d.Fmodel, b.FBaseQty, b.FBaseUnitID from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%贴纸%qs%'))b on a.Fbillno = b.Fuse where a.Fbillno = '" + txtOrderCode.Text + "' " +
"group by a.Fbillno,a.FchildQty,b.Fdate,b.FBaseUnitID) c on isnull(a.FKFDate, b.Fdate) = c.Fdate) v2 " +
"where v1.FKFDate > v2.FKFDate or(v1.FKFDate = v2.FKFDate and v1.Qty = V2.Qty and v1.FBaseQty = V2.FBaseQty) " +
"Group by V1.FKFdate,V1.Qty,V1.FCUUnitName,V1.FBaseQty,v1.FBaseUnitID,v1.FBaseQty2";
Load_HeaderData(queryHeader);
Load_Data(queryDetail);
}
else
{
dgvTot.Rows.Clear();
querySum = @"select v1.OID,v1.Fmodel,v2.FAuxQty as 需求量,isnull(v2.Qty,0) as 已入庫量,v1.應發料數量 as 排程預計產量,isnull(v2.FCUUnitName,'箱') as FCUUnitName,isnull(v2.FbaseQty,0) as 外箱已領數量,isnull(v2.FbaseQty2,0) as 標籤已領數量,
isnull(v2.FbaseQty,0)-isnull(v2.Qty,0) as 現場外箱余量,isnull(v2.FbaseQty2,0)-isnull(v2.Qty,0)*isnull(v2.FChildQty,0) as 現場標籤余量,
case when (v1.應發料數量-(isnull(v2.FbaseQty,0)-isnull(v2.Qty,0))) <0 then 0 else (v1.應發料數量-(isnull(v2.FbaseQty,0)-isnull(v2.Qty,0))) end as 外箱應發料數量,
case when (v1.應發料數量*isnull(v2.FChildQty,0)-(isnull(v2.FbaseQty2,0)-isnull(v2.Qty,0)*isnull(v2.FChildQty,0))) <0 then 0 else (v1.應發料數量*isnull(v2.FChildQty,0)-(isnull(v2.FbaseQty2,0)-isnull(v2.Qty,0)*isnull(v2.FChildQty,0))) end as 標籤應發料數量,isnull(v2.Qty1,0) as 外箱庫存,isnull(v2.Qty2,0) as 標籤庫存,
isnull(v2.FbaseUnitID,'PCS') as FbaseUnitID from
(Select b.OID,b.Fmodel,SUM(b.OHour) as 累積排程工時,SUM(b.應發料數量) as 應發料數量 from ((select OID,d.Fmodel,a.Ohour as OHour,left(a.OMachineCode,2) as 機台名稱,
Round((case when b.Munit = 'KG' then (case when d.FNumber like '12.C%' then a.Ohour*b.MSpeed*60/(F_122) else a.Ohour*b.MSpeed*60/(F_122+F_123) end)
when b.Munit = '米' then (a.Ohour*b.MSpeed*60*d.F_110*1000)/(d.F_108*d.F_102) when b.Munit = '张' then a.Ohour*b.MSpeed*60*d.F_110/d.F_102 when b.Munit = '箱' then a.Ohour*b.MSpeed*60 else a.Ohour*b.MSpeed*60/d.F_102 end),0) as 應發料數量
from [chengyiYuntech].[dbo].[ProduceOrder] a,[chengyiYuntech].[dbo].[Machine] b,[" + sql.CYDB + "].[dbo].[ICMO] c,[" + sql.CYDB + "].[dbo].[T_ICItem] d " +
"where a.OSample = '0' and a.OMachineCode = b.Mcode and b.MoutUnit = '箱' and a.OID = c.FbillNo and ODate between '" + dateTimePicker1.Value.ToString("yyyyMMdd") + "' and '" + dateTimePicker2.Value.ToString("yyyyMMdd") + "' and c.FitemID= d.FitemID and (d.F_102 <> '0' or d.F_108<> '0' or d.F_110<> '0')) union all " +
"(select OID, d.Fmodel, a.Ohour as OHour, left(a.OMachineCode, 2) as 機台名稱, " +
"Round((case when b.Munit = 'KG' then(case when d.FNumber like '12.C%' then a.Ohour * b.MSpeed * 60 / (F_122) else a.Ohour * b.MSpeed * 60 / (F_122 + F_123) end) " +
"when b.Munit = '米' then(a.Ohour * b.MSpeed * 60 * d.F_110 * 1000) / (d.F_108 * d.F_102) when b.Munit = '张' then a.Ohour * b.MSpeed * 60 * d.F_110 / d.F_102 when b.Munit = '箱' then a.Ohour * b.MSpeed * 60 else a.Ohour * b.MSpeed * 60 / d.F_102 end), 0) as 應發料數量 " +
"from[chengyiYuntech].[dbo].[ProduceOrder] a,[chengyiYuntech].[dbo].[Machine] b,[" + sql.CKDB + "].[dbo].[ICMO] c,[" + sql.CKDB + "].[dbo].[T_ICItem] " +
"d " +
"where a.OSample = '0' and a.OMachineCode = b.Mcode and b.MoutUnit = '箱' and a.OID = c.FbillNo and ODate between '" + dateTimePicker1.Value.ToString("yyyyMMdd") + "' and '" + dateTimePicker2.Value.ToString("yyyyMMdd") + "' and c.FitemID= d.FitemID and (d.F_102<> '0' or d.F_108<> '0' or d.F_110<> '0'))) b group by b.OID, b.Fmodel) v1 left join " +
"(select* from ((select a.Fbillno, a.Fmodel, a.FauxQty, b.Qty, b.FCUUnitName, c.FbaseQty, c.FbaseUnitID, d.FbaseQty as FbaseQty2, d.FbaseUnitID as FbaseUnitID2, c.Qty as Qty1, d.Qty as Qty2, e.FChildQty from " +
"(select a.Fbillno, a.FAuxQty, b.FMODEL, b.FNumber from [" + sql.CYDB + "].[dbo].[ICMO] a, [" + sql.CYDB + "].[dbo].[T_ICITem] b where a.FitemID = b.FitemID and b.Fnumber Like '14%') a left join " +
"(select a.FbatchNo, a.Fmodel, SUM(a.Qty) as Qty, a.FCUUnitName " +
"from(select a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty,0))*b.FEntrySelfA0245 as PCS " +
"from[" + sql.CYDB + "].[dbo].[ICStockbillentry] a,[" + sql.CYDB + "].[dbo].[vwICBill_2] b,[" + sql.CYDB + "].[dbo].[t_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName) a group by a.FbatchNo, a.Fmodel, a.FCUUnitName) b on a.Fbillno = b.FbatchNo left join " +
"(select b.Fuse, SUM(b.FBaseQty) as FBaseQty, e.Qty, b.FBaseUnitID " +
"from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d, (select FitemID, sum(FQty) as Qty from [" + sql.CYDB + "].[dbo].[ICinventory] where FStockID = '809' group by FitemID) e " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and e.FitemID = a.FitemID " +
"group by b.Fuse, b.FBaseUnitID, e.Qty) c on a.Fbillno = c.Fuse left join " +
"(select b.Fuse, SUM(b.FBaseQty) as FBaseQty, e.Qty, b.FBaseUnitID " +
"from [" + sql.CYDB + "].[dbo].[ICStockbillentry] a, [" + sql.CYDB + "].[dbo].[vwICBill_11] b, [" + sql.CYDB + "].[dbo].[ICStockbill] c, [" + sql.CYDB + "].[dbo].[T_ICItem] d, (select FitemID, sum(FQty) as Qty from [" + sql.CYDB + "].[dbo].[ICinventory] where FStockID = '809' group by FitemID) e " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '贴纸%QS%' and e.FitemID = a.FitemID " +
"group by b.Fuse, b.FBaseUnitID, e.Qty) d on a.Fbillno = d.Fuse left join " +
"(select* from [" + sql.CYDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') e on a.Fnumber = e.Fnumber) union all " +
"(select a.Fbillno, a.Fmodel, a.FauxQty, b.Qty, b.FCUUnitName, c.FbaseQty, c.FbaseUnitID, d.FbaseQty as FbaseQty2, d.FbaseUnitID as FbaseUnitID2, c.Qty as Qty1, d.Qty as Qty2, e.FChildQty from " +
"(select a.Fbillno, a.FAuxQty, b.FMODEL, b.FNumber from [" + sql.CKDB + "].[dbo].[ICMO] a, [" + sql.CKDB + "].[dbo].[T_ICITem] b where a.FitemID = b.FitemID) a left join " +
"(select a.FbatchNo, a.Fmodel, SUM(a.Qty) as Qty, a.FCUUnitName " +
"from(select a.FKFDate, a.FbatchNo, d.Fmodel, Sum(isnull(a.FAuxQty,0)) as Qty,b.FCUUnitName,Sum(isnull(a.FAuxQty,0))*b.FEntrySelfA0245 as PCS " +
"from[" + sql.CKDB + "].[dbo].[ICStockbillentry] a,[" + sql.CKDB + "].[dbo].[vwICBill_2] b,[" + sql.CKDB + "].[dbo].[t_ICItem] " +
"d " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FitemID = d.FitemID and FbatchNo<> '' " +
"group by a.FKFDate,a.FbatchNo,d.Fmodel,b.FEntrySelfA0245,b.FCUUnitName) a group by a.FbatchNo, a.Fmodel, a.FCUUnitName) b on a.Fbillno = b.FbatchNo left join " +
"(select b.Fuse, SUM(b.FBaseQty) as FBaseQty, e.Qty, b.FBaseUnitID " +
"from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d, (select FitemID, sum(FQty) as Qty from [" + sql.CKDB + "].[dbo].[ICinventory] where FStockID = '19761' group by FitemID) e " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '%外箱%' and e.FitemID = a.FitemID " +
"group by b.Fuse, b.FBaseUnitID, e.Qty) c on a.Fbillno = c.Fuse left join " +
"(select b.Fuse, SUM(b.FBaseQty) as FBaseQty, e.Qty, b.FBaseUnitID " +
"from [" + sql.CKDB + "].[dbo].[ICStockbillentry] a, [" + sql.CKDB + "].[dbo].[vwICBill_11] b, [" + sql.CKDB + "].[dbo].[ICStockbill] c, [" + sql.CKDB + "].[dbo].[T_ICItem] d, (select FitemID, sum(FQty) as Qty from [" + sql.CKDB + "].[dbo].[ICinventory] where FStockID = '19761' group by FitemID) e " +
"where a.FinterID= b.FinterID and a.FentryID = b.FentryID and a.FinterID = c.FinterID and d.FitemID = a.FitemID and d.Fmodel like '贴纸%QS%' and e.FitemID = a.FitemID " +
"group by b.Fuse, b.FBaseUnitID, e.Qty) d on a.Fbillno = d.Fuse left join " +
"(select* from [" + sql.CKDB + "].[dbo].[vICBOM] where Fchildmodel like '%贴纸%qs%' and FuseStatus = '使用') e on a.Fnumber = e.Fnumber))a) " +
"v2 on v1.OID = V2.FbillNo";
Load_Data(querySum);
}
if (dgvTot.Rows.Count == 0 && ckbDetail.Checked == false)
{
MessageBox.Show("查无信息");
}
else if (dgv2.Rows.Count == 0 && ckbDetail.Checked == true)
{
MessageBox.Show("查无信息");
}
}
private void btnExport_Click(object sender, EventArgs e)
{
path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
inputPath = System.Environment.CurrentDirectory;
if(ckbDetail.Checked == true)
{
exportPath = path + @"\标签外箱发料入庫明细表导出";
filePath = inputPath + @"\标签外箱发料入庫明细表";
}
else
{
exportPath = path + @"\标签外箱发料入庫汇总表导出";
filePath = inputPath + @"\标签外箱发料入庫汇总表";
}
// 開啟一個新的應用程式
excelApp = new Excel.Application();
// 讓Excel文件可見
excelApp.Visible = false;
// 停用警告訊息
excelApp.DisplayAlerts = false;
// 加入新的活頁簿
excelApp.Workbooks.Add(Type.Missing);
wBook = excelApp.Workbooks.Open(filePath,
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",
true, false, 0, true, false, false);
// 設定活頁簿焦點
wBook.Activate();
wSheet = (Excel._Worksheet)wBook.Worksheets[1];
if (ckbDetail.Checked == true)
{
wSheet.Name = "标签外箱发料入庫明细表";
wSheet.Cells[3, 3] = txtOrderCode.Text;
wSheet.Cells[3, 6] = txtModel.Text;
wSheet.Cells[4, 2] = txtOrderQty.Text;
wSheet.Cells[4, 4] = txtStorageQty.Text;
wSheet.Cells[4, 6] = txtBoxQty.Text;
wSheet.Cells[4, 8] = txtLabelQty.Text;
for (int i = 0; i < dgv2.Rows.Count; i++)
{
for (int j = 0; j < dgv2.ColumnCount; j++)
{
wSheet.Cells[i + 6, j + 1] = Convert.ToString(dgv2.Rows[i].Cells[j].Value);
}
}
}
else
{
wSheet.Name = "标签外箱发料入庫汇总表";
for (int i = 0; i < dgvTot.Rows.Count; i++)
{
for (int j = 0; j < dgvTot.ColumnCount; j++)
{
wSheet.Cells[i + 4, j + 1] = Convert.ToString(dgvTot.Rows[i].Cells[j].Value);
}
}
}
wRange = wSheet.Range[wSheet.Cells[2, 1], wSheet.Cells[2, 1]];
wRange.HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
// storing Each row and column value to excel sheet
Excel.Range last = wSheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell, Type.Missing);
Excel.Range allRange = wSheet.get_Range("A1", last);
allRange.Font.Size = "14";
allRange.Borders.LineStyle = Excel.XlLineStyle.xlContinuous; //格線
allRange.Columns.AutoFit();
//Save Excel
wBook.SaveAs(exportPath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
excelApp.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp);
wBook = null;
wSheet = null;
wRange = null;
excelApp = null;
GC.Collect();
MessageBox.Show("导出成功");
}
}
}
|
using System;
using System.Threading.Tasks;
using Discord;
using Discord.Commands;
namespace Jet_Bot.Modules
{
public class RainBowRole : ModuleBase<SocketCommandContext>
{
[Command("Rainbow")]
[RequireUserPermission(GuildPermission.Administrator)]
[RequireBotPermission(GuildPermission.Administrator)]
public async Task RainbowAsync([Remainder]IRole role)
{
DateTime finishTime = System.DateTime.Now.AddSeconds(200);
byte r = role.Color.R, g = role.Color.G, b = role.Color.B;
while (System.DateTime.Now.CompareTo(finishTime) < 0)
{
if ( r == 255 && g < 255 && b == 0 )
{
g+=3;
if (g > 255) g = 255;
}
if ( g == 255 && r > 0 && b == 0 )
{
r-=3;
}
if ( g == 255 && b < 255 && r == 0 )
{
b+=3;
if (b > 255) b = 255;
}
if ( b == 255 && g > 0 && r == 0 )
{
g-=3;
}
if ( b == 255 && r < 255 && g == 0 )
{
r+=3;
if (r > 255) r = 255;
}
if ( r == 255 && b > 0 && g == 0 )
{
b-=3;
}
await role.ModifyAsync(x => { x.Color = new Color(r, g, b); });
}
Console.WriteLine("Finished");
}
}
} |
using BPiaoBao.AppServices.Contracts.DomesticTicket;
using BPiaoBao.AppServices.DataContracts.DomesticTicket.DataObject;
using BPiaoBao.Client.DomesticTicket.Model;
using BPiaoBao.Client.UIExt;
using BPiaoBao.Client.UIExt.Helper;
using BPiaoBao.Common.Enums;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Threading;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace BPiaoBao.Client.DomesticTicket.ViewModel
{
public class InsuranceViewModel : BaseVM
{
/// <summary>
/// 构造函数
/// </summary>
public InsuranceViewModel()
{
_allInsurancesStatus.Add(new KeyValuePair<EnumInsuranceStatus?, string>(null, "请选择"));
_allInsurancesStatus.Add(new KeyValuePair<EnumInsuranceStatus?, string>(EnumInsuranceStatus.NoInsurance, EnumHelper.GetDescription(EnumInsuranceStatus.NoInsurance)));
_allInsurancesStatus.Add(new KeyValuePair<EnumInsuranceStatus?, string>(EnumInsuranceStatus.GotInsurance, EnumHelper.GetDescription(EnumInsuranceStatus.GotInsurance)));
_allInsurancesStatus.Add(new KeyValuePair<EnumInsuranceStatus?, string>(EnumInsuranceStatus.Canceled, EnumHelper.GetDescription(EnumInsuranceStatus.Canceled)));
Initialize();
}
/// <summary>
/// 初始化数据
/// </summary>
public override void Initialize()
{
if (CanExecuteQueryCommand())
ExecuteQueryCommand();
}
#region 公开属性
#region RequestQueryInsurance
/// <summary>
/// The <see /> property's name.
/// </summary>
private const string RequestQueryInsurancePropertyName = "RequestQueryInsurance";
private QueryInsuranceModel _queryInsurance = new QueryInsuranceModel();
/// <summary>
/// 查询实体
/// </summary>
public QueryInsuranceModel QueryInsurance
{
get { return _queryInsurance; }
set
{
if (_queryInsurance == value) return;
RaisePropertyChanging(RequestQueryInsurancePropertyName);
_queryInsurance = value;
RaisePropertyChanged(RequestQueryInsurancePropertyName);
}
}
#endregion
#region AllInsurancesStatus
/// <summary>
/// The <see cref="AllInsurancesStatus" /> property's name.
/// </summary>
private const string AllInsurancesStatusPropertyName = "AllInsurancesStatus";
private ObservableCollection<KeyValuePair<EnumInsuranceStatus?, String>> _allInsurancesStatus = new ObservableCollection<KeyValuePair<EnumInsuranceStatus?, string>>();
/// <summary>
/// 所有保单状态
/// </summary>
public ObservableCollection<KeyValuePair<EnumInsuranceStatus?, String>> AllInsurancesStatus
{
get { return _allInsurancesStatus; }
set
{
if (_allInsurancesStatus == value) return;
RaisePropertyChanging(AllInsurancesStatusPropertyName);
_allInsurancesStatus = value;
RaisePropertyChanged(AllInsurancesStatusPropertyName);
}
}
#endregion
#region Insurances
/// <summary>
/// The <see cref="Insurances" /> property's name.
/// </summary>
private const string InsurancesPropertyName = "Insurances";
private ObservableCollection<ResponseInsurance> _insurances = new ObservableCollection<ResponseInsurance>();
/// <summary>
/// 显示的保单
/// </summary>
public ObservableCollection<ResponseInsurance> Insurances
{
get { return _insurances; }
set
{
if (_insurances == value) return;
RaisePropertyChanging(InsurancesPropertyName);
_insurances = value;
RaisePropertyChanged(InsurancesPropertyName);
}
}
#endregion
#region IsBusy
/// <summary>
/// The <see cref="IsBusy" /> property's name.
/// </summary>
//public const string IsBusyPropertyName = "IsBusy";
//private bool isBusy = false;
/// <summary>
/// 是否正在忙碌
/// </summary>
public new bool IsBusy
{
get { return isBusy; }
set
{
if (isBusy == value) return;
RaisePropertyChanging(IsBusyPropertyName);
isBusy = value;
RaisePropertyChanged(IsBusyPropertyName);
if (_queryCommand != null)
_queryCommand.RaiseCanExecuteChanged();
}
}
#endregion
#region 翻页
#region PageSize
/// <summary>
/// The <see cref="PageSize" /> property's name.
/// </summary>
private const string PageSizePropertyName = "PageSize";
private int _pageSize = 20;
/// <summary>
/// 翻页
/// </summary>
public int PageSize
{
get { return _pageSize; }
set
{
if (_pageSize == value) return;
RaisePropertyChanging(PageSizePropertyName);
_pageSize = value;
RaisePropertyChanged(PageSizePropertyName);
}
}
#endregion
#region CurrentPageIndex
/// <summary>
/// The <see cref="CurrentPageIndex" /> property's name.
/// </summary>
private const string CurrentPageIndexPropertyName = "CurrentPageIndex";
private int _currentPageIndex = 1;
/// <summary>
/// 当前索引页
/// </summary>
public int CurrentPageIndex
{
get { return _currentPageIndex; }
set
{
if (_currentPageIndex == value) return;
RaisePropertyChanging(CurrentPageIndexPropertyName);
_currentPageIndex = value;
RaisePropertyChanged(CurrentPageIndexPropertyName);
}
}
#endregion
#region TotalCount
/// <summary>
/// The <see cref="TotalCount" /> property's name.
/// </summary>
private const string TotalCountPropertyName = "TotalCount";
private int _totalCount;
/// <summary>
/// 总数量
/// </summary>
public int TotalCount
{
get { return _totalCount; }
set
{
if (_totalCount == value) return;
RaisePropertyChanging(TotalCountPropertyName);
_totalCount = value;
RaisePropertyChanged(TotalCountPropertyName);
}
}
#endregion
#endregion
#endregion
#region 公开命令
#region QueryCommand
private RelayCommand _queryCommand;
/// <summary>
/// 查询命令
/// </summary>
public RelayCommand QueryCommand
{
get
{
return _queryCommand ?? (_queryCommand = new RelayCommand(ExecuteQueryCommand, CanExecuteQueryCommand));
}
}
protected virtual void ExecuteQueryCommand()
{
#region 日期判断处理
if (QueryInsurance.BuyStartTime != null && QueryInsurance.BuyEndTime != null)
{
if (QueryInsurance.BuyStartTime.Value.CompareTo(QueryInsurance.BuyEndTime.Value) > 0)
{
UIManager.ShowMessage("航班日期选择开始日期大于结束日期");
return;
}
}
if (QueryInsurance.InsuranceLimitStartTime != null && QueryInsurance.InsuranceLimitEndTime != null)
{
if (QueryInsurance.InsuranceLimitStartTime.Value.CompareTo(QueryInsurance.InsuranceLimitEndTime.Value) > 0)
{
UIManager.ShowMessage("保险有限期日期选择开始日期大于结束日期");
return;
}
}
if (QueryInsurance.FlyStartTime != null && QueryInsurance.FlyEndTime != null)
{
if (QueryInsurance.FlyStartTime.Value.CompareTo(QueryInsurance.FlyEndTime.Value) > 0)
{
UIManager.ShowMessage("航班日期选择开始日期大于结束日期");
return;
}
}
#endregion
//保单接口查询实体
var reQueryInsurance = new RequestQueryInsurance
{
IsClientCall = true,
BuyEndTime = QueryInsurance.BuyEndTime,
BuyStartTime = QueryInsurance.BuyStartTime,
EnumInsuranceStatus = QueryInsurance.EnumInsuranceStatus.HasValue ? QueryInsurance.EnumInsuranceStatus : null,
FlyEndTime = QueryInsurance.FlyEndTime,
FlyStartTime = QueryInsurance.FlyStartTime,
InsuranceLimitEndTime = QueryInsurance.InsuranceLimitEndTime,
InsuranceLimitStartTime = QueryInsurance.InsuranceLimitStartTime,
InsuranceNo = QueryInsurance.InsuranceNo,
Mobile = QueryInsurance.Mobile,
OrderId = QueryInsurance.OrderId,
PassengerName = QueryInsurance.PassengerName,
CardNo = QueryInsurance.IdNo
};
IsBusy = true;
Insurances.Clear();
Action action = () => CommunicateManager.Invoke<IInsuranceService>(service =>
{
var data = service.QueryInsurance(reQueryInsurance, CurrentPageIndex, PageSize);
if (data.List == null)
return;
TotalCount = data.TotalCount;
foreach (var item in data.List)
{
DispatcherHelper.UIDispatcher.Invoke(new Action<ResponseInsurance>(Insurances.Add), item);
}
}, UIManager.ShowErr);
Task.Factory.StartNew(action).ContinueWith(task =>
{
Action setBusyAction = () => { IsBusy = false; };
DispatcherHelper.UIDispatcher.Invoke(setBusyAction);
});
}
protected virtual bool CanExecuteQueryCommand()
{
return !isBusy;
}
#endregion
#region ClearCommand 清空
private RelayCommand _clearCommand;
/// <summary>
/// 导入命令
/// </summary>
public RelayCommand ClearCommand
{
get
{
return _clearCommand ?? (_clearCommand = new RelayCommand(ExecuteClearCommand, CanExecuteClearCommand));
}
}
private void ExecuteClearCommand()
{
QueryInsurance.BuyEndTime = null;
QueryInsurance.BuyStartTime = null;
QueryInsurance.EnumInsuranceStatus = null;
QueryInsurance.FlightNumber = string.Empty;
QueryInsurance.FlyEndTime = null;
QueryInsurance.FlyStartTime = null;
QueryInsurance.IdNo = string.Empty;
QueryInsurance.InsuranceLimitEndTime = null;
QueryInsurance.InsuranceLimitStartTime = null;
QueryInsurance.InsuranceNo = string.Empty;
QueryInsurance.Mobile = string.Empty;
QueryInsurance.OrderId = string.Empty;
QueryInsurance.PassengerName = string.Empty;
QueryInsurance.PNR = string.Empty;
}
private bool CanExecuteClearCommand()
{
return !IsBusy;
}
#endregion
#region ExportCommand 导出
private bool IsExporting = false;
private RelayCommand _exportCommand;
/// <summary>
/// 导出文件
/// </summary>
public RelayCommand ExportCommand
{
get
{
return _exportCommand ?? (_exportCommand = new RelayCommand(ExecuteExportCommand, CanExecuteExportCommand));
}
}
private void ExecuteExportCommand()
{
//DataTable dt = new DataTable("常旅客明细");
//KeyValuePair<string, Type>[] headArray = new KeyValuePair<string, Type>[]
//{
// new KeyValuePair<string,Type>("保单号",typeof(string)),
// new KeyValuePair<string,Type>("订单号",typeof(string)),
// new KeyValuePair<string,Type>("投保时间",typeof(string)),
// new KeyValuePair<string,Type>("被保人姓名",typeof(string)),
// new KeyValuePair<string,Type>("证件号",typeof(string)),
// new KeyValuePair<string,Type>("手机号",typeof(string)),
// new KeyValuePair<string,Type>("航空公司卡号",typeof(string)),
// new KeyValuePair<string,Type>("备注",typeof(string))
//};
//foreach (var item in headArray)
//{
// dt.Columns.Add(item.Key, item.Value);
//}
//SaveFileDialog dlg = new SaveFileDialog();
//dlg.FileName = "常旅客明细";
//dlg.DefaultExt = ".xls";
//dlg.Filter = "Excel documents (.xls)|*.xls";
//var result = dlg.ShowDialog();
//if (result == true)
//{
// isExporting = IsBusy = true;
// var exportAction = new Action(() =>
// {
// try
// {
// List<FrePasserDto> DetailList = GetPassengersList();
// if (DetailList != null)
// {
// foreach (var item in DetailList)
// {
// dt.Rows.Add(
// item.Name,
// item.PasserType,
// item.CertificateType,
// item.CertificateNo,//item.PasserType != EnumHelper.GetDescription(AgeType.Baby) ? item.CertificateNo : "",
// item.Mobile,
// item.PasserType == EnumHelper.GetDescription(AgeType.Baby) ? Convert.ToDateTime(item.CertificateNo).ToString("yyyy-MM-dd") : "",
// item.AirCardNo,
// item.Remark
// );
// }
// }
// string filename = dlg.FileName;
// ExcelHelper.RenderToExcel(dt, filename);
// UIManager.ShowMessage("导出成功");
// }
// catch (Exception ex)
// {
// UIManager.ShowErr(ex);
// }
// });
// Task.Factory.StartNew(exportAction).ContinueWith((task) =>
// {
// isExporting = IsBusy = false;
// });
//}
}
//private List<ResponseInsurance> GetList()
//{
// List<ResponseInsurance> result = null;
// CommunicateManager.Invoke<IInsuranceService>(service =>
// {
// //result = service.Export(QueryInsurance);
// });
// return result;
//}
private bool CanExecuteExportCommand()
{
return !IsExporting && !IsBusy;
}
#endregion
#region DetailCommand
private RelayCommand<ResponseInsurance> _detailCommand;
/// <summary>
/// 打开详情命令
/// </summary>
public RelayCommand<ResponseInsurance> DetailCommand
{
get
{
return _detailCommand ?? (_detailCommand = new RelayCommand<ResponseInsurance>(ExecuteDetailCommand, CanExecuteDetailCommand));
}
}
private void ExecuteDetailCommand(ResponseInsurance model)
{
LocalUIManager.ShowInsuranceDetailWindow(model);
}
private bool CanExecuteDetailCommand(ResponseInsurance model)
{
return !isBusy;
}
#endregion
#endregion
}
}
|
using System;
using EPiServer.Events.Providers;
namespace HansKindberg.EPiServer.Events
{
public interface IEventSubscriber
{
#region Events
event EventHandler<EventMissedEventArgs> EventMissed;
event EventHandler<EventReceivedEventArgs> EventReceived;
#endregion
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using KT.EmailSender;
namespace KT.Services.Helpers
{
public class KtEmailSender
{
private static IEmailSender _sender;
public static IEmailSender Sender
{
get { return _sender; }
}
public static void Init()
{
_sender = new EmailSender.EmailSender();
}
}
} |
/*
Marshall Harris
Assignment 4
6/2/16
*/
//static class for handling actual file data processing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace SEA_SHARP
{
public static class TransactionHistory
{
private const string dir = @"D:\";
private const string path = dir + "TransactionHistory.txt";
//Save Transaction class objects to disk file
//inputs - collection of customer objects
// - device/directory, pathname
//outputs - write to text file customer
public static void SaveTransactions(List<Transaction> trList)
{
// create the output stream for a text file (file mode is create, file access is write)
//CODE HERE to create a "chain" instantiation of a FileStream and StreamWriter for output
//FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite); //filestream object
StreamWriter textOut = new StreamWriter(new FileStream(path, FileMode.Create, FileAccess.Write));
// write each transaction field to the text file
// include an <eoln>
foreach (Transaction transaction in trList)
{
//CODE HERE to write to the file
textOut.WriteLine(transaction.ToString() + "|");
}
// write the end of the document
textOut.Close(); //closes the current StreamWriter object and the underlying stream
}
public static List<Transaction> GetTransactions()
{
// Directory Class - static methods for creating, moving, and enumerating thru directories/subdirectories
// if the directory doesn't exist, create it
if (!Directory.Exists(dir)) //determines whether given path refers to an existing directory on disk
Directory.CreateDirectory(dir); //creates all the directories in a specified path
// create the object for the input stream for a text file (file mode is open or create, file access is read)
//CODE HERE to create a "chain" instantiation of a FileStream and Streamreader for input
StreamReader textIn = new StreamReader(new FileStream(path, FileMode.OpenOrCreate, FileAccess.Read));
// create the array list for customers read from file
List<Transaction> transactions = new List<Transaction>();
// read the data from the file and store it in the ArrayList
//CODE HERE to make sure the file has data (use Peek method)
while (textIn.Peek() != -1)
{
string row = textIn.ReadLine();
/*
* Split - returns a string array that contains the substrings in this instance
* that are delimited by elements of a specified string or Unicode character array
*/
string[] columns = row.Split('|');
Transaction transaction = new Transaction(); //new transaction object
transaction.TransactionDate.ToString(columns[0]); //populate using Properties (set)
transaction.Amount.ToString(columns[1]);
transaction.Payee = columns[2];
transaction.TransactionType = columns[3];
transaction.CheckNumber = columns[4];
transaction.CheckCleared = Convert.ToBoolean(columns[5]);
transactions.Add(transaction);
}
textIn.Close();
return transactions;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BLL.ORDER;
using System.Data;
using Model.Domain.Common;
using Model.Domain.Order;
using Common;
/// <summary>
/// OrderListDataHandler 的摘要说明
/// </summary>
public class OrderListDataHandler : BaseDataHandler
{
private OrderBLL bll = new OrderBLL();
#region 重写父类
public override void DealBussiness(HttpContext context)
{
try
{
string strType = context.Request["handlerType"] ?? string.Empty;//获取操作类型
//定义返回结果,所有处理逻辑返回的均为json字符串
string dealResult = string.Empty;
if (!string.IsNullOrEmpty(strType))
{
switch (strType.ToLower())
{
case "list":
dealResult = List(context);
break;
case "pj":
dealResult = PJ(context);
break;
case "myd"://满意度
dealResult = MYD(context);
break;
}
}
LogHelper.WriteLog(string.Format(@"
请求页面:{0},
时间:{1},
方法:{2},
返回结果:{3}。",
context.Request.Url.ToString(), DateTime.Now.ToLongTimeString(), strType, dealResult));
context.Response.Clear();
context.Response.Write(dealResult);
}
catch (Exception ex)
{
LogHelper.WriteLog(ex.Message);
}
}
#endregion
#region 业务处理
private string List(HttpContext context)
{
IDictionary<string, string> idic = new Dictionary<string, string>();
int PageSize = int.Parse(context.Request["rows"]);
int PageNo = int.Parse(context.Request["page"]);
idic.Add("#CustName#", context.Request["CustName"]);// 客户名称
idic.Add("#ContactMan#", context.Request["ContactMan"]);
if (!string.IsNullOrWhiteSpace(context.Request["ServiceType"]))
{
idic.Add("#ServiceType#", context.Request["ServiceType"]);
}
idic.Add("#StartTime#", context.Request["StartTime"]);
idic.Add("#EndTime#", context.Request["EndTime"]);
if (!string.IsNullOrWhiteSpace(context.Request["DealStatus"]))
{
idic.Add("#DealStatus#", context.Request["DealStatus"]);
}
idic.Add("#DealUserName#", context.Request["DealUserName"]);
idic.Add("#DealDept#", context.Request["DealDept"]);
idic.Add("#QusDesc#", context.Request["QusDesc"]);
//不同状态的工单
if (!string.IsNullOrWhiteSpace(context.Request["urlDealStatus"]))
{
idic.Add("#urlDealStatus#", context.Request["urlDealStatus"]);
}
//当前用户所在部门
//1. 客户公司员工只能查看对应客户公司的工单
//2. 集团公司员工可以看到所有工单
//3. 子公司员工只能看到分配到该公司下的工单
int userType = -1;
switch (user.UserType)
{
case "V":
userType = 0; //客户公司员工
break;
case "U":
{
if (user.JgOrBm == "1")
{
userType = 2; //子公司员工
}
else
{
userType = 1; //集团公司员工
}
}
break;
}
idic.Add("#CurUserType#", userType.ToString());
idic.Add("#CurUserDeptId#", user.DeptID.ToString());
DataSet ds = bll.GetOrderList(idic, PageNo, PageSize);
ListResult list = new ListResult();
list.total = int.Parse(ds.Tables[0].Rows[0][0].ToString());
for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
{
DataRow dr = ds.Tables[1].Rows[i];
OrderRow row = new OrderRow();
row.rowno = i + 1;
row.Step = int.Parse(dr["CurStep"].ToString());
row.CreateUserId = int.Parse(dr["CreateUserId"].ToString());
row.CurrUserId = user.UserID;
row.OrderId = int.Parse(dr["OrderId"].ToString());
row.OrderNo = dr["OrderNo"].ToString();
row.CustName = dr["CustName"].ToString();
row.ContactMan = dr["ContactMan"].ToString();
row.ServiceType = dr["ServiceType"].ToString();
row.QusDesc = dr["QusDesc"].ToString();
row.AcceptUserName = dr["AcceptUserName"].ToString();
row.DealStatus = dr["DealStatus"].ToString();
row.DealResult = dr["DealResult"].ToString();
row.DealTime = !string.IsNullOrWhiteSpace(dr["DealTime"].ToString()) ? Convert.ToDateTime(dr["DealTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss") : null;
row.DealUserName = dr["DealUserName"].ToString();
row.DealDeptName = dr["DealDeptName"].ToString();
switch (dr["Satisfaction"].ToString())
{
case "0":
row.SatisfactionDesc = "非常满意";
break;
case "1":
row.SatisfactionDesc = "满意";
break;
case "2":
row.SatisfactionDesc = "不满意";
break;
}
switch (dr["DealStatus"].ToString())
{
case "结束":
{
DateTime endTime = DateTime.Now;
if (dr["IsNewBook"].ToString() == "1")
{
endTime = Convert.ToDateTime(dr["NewBookTime"]).AddDays(1);
}
else if (dr["IsBook"].ToString() == "1")
{
endTime = Convert.ToDateTime(dr["BookTime"]).AddDays(1);
}
if (Convert.ToDateTime(dr["dealTime"]) > endTime)
{
row.StatusColor = "purple";
}
break;
}
case "处理中":
{
if (dr["NeedBack"].ToString() == "1")
{
row.StatusColor = "blue";
}
bool isYY = false;
if (dr["IsNewBook"].ToString() == "1")
{
isYY = true;
}
else if (dr["IsBook"].ToString() == "1")
{
isYY = true;
}
if (isYY)
{
row.StatusColor = "Maroon";
}
break;
}
default:
{
DateTime endTime = Convert.ToDateTime(dr["SubmitTime"]).AddDays(1);
if (DateTime.Now > endTime)
{
row.StatusColor = "purple";
}
else
{
row.StatusColor = "red";
}
break;
}
}
row.edit = row.OrderId.ToString();
list.rows.Add(row);
}
string jsonResult = JsonHelper.ToJson(list);
//context.Response.Clear();
//context.Response.Write(jsonResult);
return jsonResult;
}
/// <summary>
/// 评价工单
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
private string PJ(HttpContext context)
{
HandlerResult result = new HandlerResult();
string strOrderId = context.Request["OrderId"] ?? "-1";
BLL.ORDER.OrderStatusBLL bllStatus = new BLL.ORDER.OrderStatusBLL();
MODEL.ORDER.OrderStatusModel modelStatus = new MODEL.ORDER.OrderStatusModel();
modelStatus = bllStatus.GetModelByOrderId(int.Parse(strOrderId));
if (modelStatus != null)
{
modelStatus.CurStep += 1;
modelStatus.Satisfaction = int.Parse(context.Request["radPJ"] ?? "-1");
modelStatus.Opinion = context.Request["txtOpinion"] ?? string.Empty;
bool statusFlag = bllStatus.Update(modelStatus) > 0;
if (statusFlag)
{
BLL.ORDER.OrderStepBLL bllStep = new BLL.ORDER.OrderStepBLL();
MODEL.ORDER.OrderStepModel modelStep = new MODEL.ORDER.OrderStepModel();
MODEL.ORDER.OrderStepModel preStepModel = bllStep.GetLastModelByOrderId(int.Parse(strOrderId));
modelStep.OrderId = int.Parse(strOrderId);
modelStep.Step = preStepModel.Step + 1;
modelStep.LastUserId = preStepModel.CurUserId;
modelStep.LastDeptId = preStepModel.CurDeptId;
modelStep.CurUserId = user.UserID;
modelStep.CurDeptId = user.DeptID;
modelStep.DealOpinion = "评价工单";
modelStep.Remark = string.Empty;
bllStep.Insert(modelStep);
result.success = true;
result.msg = "评价成功";
}
}
string jsonResult = JsonHelper.ToJson(result);
return jsonResult;
}
//满意度
private string MYD(HttpContext context)
{
IDictionary<string, string> idic = new Dictionary<string, string>();
int PageSize = int.Parse(context.Request["rows"]);
int PageNo = int.Parse(context.Request["page"]);
idic.Add("#CustName#", context.Request["CustName"]);// 客户名称
DataSet ds = bll.GetOrderMYD(idic, PageNo, PageSize);
ListResult list = new ListResult();
list.total = int.Parse(ds.Tables[0].Rows[0][0].ToString());
for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
{
DataRow dr = ds.Tables[1].Rows[i];
OrderMYD row = new OrderMYD();
row.rowno = i + 1;
row.CustName = dr["CustName"].ToString();
row.OrderNum = dr["OrderSum"].ToString();
row.MY0 = dr["MY0"].ToString();
row.MY1 = dr["MY1"].ToString();
row.MY2 = dr["MY2"].ToString();
list.rows.Add(row);
}
string jsonResult = JsonHelper.ToJson(list);
return jsonResult;
}
#endregion
} |
using UnityEngine;
using System.Collections;
public class SoundPack : ScriptableObject
{
public float longestClipLength;
public AudioClip[] clips;
public string[] keys;
public bool[] loops;
}
|
namespace Koek
{
/// <summary>
/// A choke implementation that applies no limits to throughput.
/// </summary>
public sealed class UnlimitedChoke : IChoke
{
public static UnlimitedChoke Instance { get; } = new UnlimitedChoke();
public DataRate RateLimit { get; } = DataRate.FromBitsPerSecond(long.MaxValue);
public long BucketSizeBytes => long.MaxValue;
public bool RequestBytes(ushort count) => true;
}
}
|
using System;
namespace ShogunOptimizer.Weapons
{
public class Whiteblind : Weapon
{
public Whiteblind(int refine = 1) : base(refine)
{
BaseAtk = 510;
Stats = new Tuple<StatType, double>[]
{
new(StatType.DefPercent, .517 ),
new(StatType.AtkPercent, 4 * (.045 + .015 * Refine)),
new(StatType.DefPercent, 4 * (.045 + .015 * Refine)),
};
Type = WeaponType.Claymore;
}
}
}
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class FlagsManager
{
#region "Types"
public abstract class Flag
{
public string Key = "";
public abstract object GetValue();
}
public class BoolFlag : Flag
{
private bool value;
public override object GetValue()
{
return value;
}
public bool Get() { return this.value; }
public BoolFlag(string key, bool value) { this.Key = key; this.value = value; }
}
public class NumberFlag : Flag
{
private double value;
public override object GetValue()
{
return value;
}
public double Get() { return this.value; }
public NumberFlag(string key, double value) { this.Key = key; this.value = value; }
}
public class StringFlag : Flag
{
private string value;
public override object GetValue()
{
return value;
}
public string Get() { return this.value; }
public StringFlag(string key, string value) { this.Key = key; this.value = value; }
}
#endregion
#region "Initizalition"
public void Initialize()
{
this.flagsDictionary = new Dictionary<string, Flag>();
}
#endregion
#region "Flags dictionary"
private Dictionary<string, Flag> flagsDictionary;
public void SetFlag(string key, bool val)
{
if (flagsDictionary.ContainsKey(key))
{
flagsDictionary.Remove(key);
}
flagsDictionary.Add(key, new BoolFlag(key, val));
}
public void SetFlag(string key, double val)
{
if (flagsDictionary.ContainsKey(key))
{
flagsDictionary.Remove(key);
}
flagsDictionary.Add(key, new NumberFlag(key, val));
}
public void SetFlag(string key, string val)
{
if (flagsDictionary.ContainsKey(key))
{
flagsDictionary.Remove(key);
}
flagsDictionary.Add(key, new StringFlag(key, val));
}
public bool GetFlagBool(string key)
{
Flag f = null;
flagsDictionary.TryGetValue(key, out f);
BoolFlag bF = f as BoolFlag;
return (bF != null) ? bF.Get() : false;
}
public double GetFlagNumber(string key)
{
Flag f = null;
flagsDictionary.TryGetValue(key, out f);
NumberFlag nF = f as NumberFlag;
return (nF != null) ? nF.Get() : 0.0f;
}
public string GetFlagString(string key)
{
Flag f = null;
flagsDictionary.TryGetValue(key, out f);
StringFlag sF = f as StringFlag;
return (sF != null) ? sF.Get() : "";
}
public bool IsFlagSet(string key)
{
return flagsDictionary.ContainsKey(key);
}
public void Clear()
{
this.flagsDictionary.Clear();
}
#endregion
#region "Savegame integration"
/// <summary>
/// Returns a list of all the flags currently in memory
/// </summary>
public Flag[] GetForSavegame()
{
Flag[] flagArray = new Flag[this.flagsDictionary.Count];
this.flagsDictionary.Values.CopyTo(flagArray, 0);
return flagArray;
}
#endregion
}
|
using Microsoft.AspNetCore.Mvc;
using Abp.AspNetCore.Mvc.Authorization;
using Mattelsa.Mindfulness.Controllers;
namespace Mattelsa.Mindfulness.Web.Controllers
{
[AbpMvcAuthorize]
public class HomeController : MindfulnessControllerBase
{
public ActionResult Index()
{
return View();
}
}
}
|
//
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
using Dnn.PersonaBar.Library.Containers;
using DotNetNuke.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace Dnn.PersonaBar.Library
{
class Startup : IDnnStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IPersonaBarContainer, PersonaBarContainer>();
}
}
}
|
using System;
using System.Data;
using System.Collections.Generic;
using Maticsoft.Common;
using PDTech.OA.Model;
namespace PDTech.OA.BLL
{
/// <summary>
/// VIEW_USER_MSGINFO
/// </summary>
public partial class VIEW_USER_MSGINFO
{
private readonly PDTech.OA.DAL.VIEW_USER_MSGINFO dal=new PDTech.OA.DAL.VIEW_USER_MSGINFO();
public VIEW_USER_MSGINFO()
{}
#region BasicMethod
/// <summary>
/// 获取公告信息列表---未分页
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public IList<Model.VIEW_USER_MSGINFO> get_MsgList(Model.VIEW_USER_MSGINFO model)
{
return dal.get_MsgList(model);
}
/// <summary>
/// 获取符合条件的公告信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public Model.VIEW_USER_MSGINFO get_MsgInfo(Model.VIEW_USER_MSGINFO model)
{
return dal.get_MsgInfo(model);
}
/// <summary>
/// 获取符合条件的公告信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public Model.VIEW_USER_MSGINFO get_MsgInfo(decimal msgID)
{
return dal.get_MsgInfo(msgID);
}
/// <summary>
/// 获取公告信息列表-使用分页
/// </summary>
/// <param name="where"></param>
/// <param name="currentpage"></param>
/// <param name="pagesize"></param>
/// <param name="totalrecord"></param>
/// <returns></returns>
public IList<Model.VIEW_USER_MSGINFO> get_Paging_MsgInfoList(Model.VIEW_USER_MSGINFO where, int currentpage, int pagesize, out int totalrecord)
{
return dal.get_Paging_MsgInfoList(where, currentpage, pagesize, out totalrecord);
}
#endregion BasicMethod
#region ExtensionMethod
#endregion ExtensionMethod
}
}
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Alword.Algoexpert.Tier0
{
public class InsertionSortTask
{
public static int[] InsertionSort(int[] array)
{
for (int i = 1; i < array.Length; i++)
{
for (int j = i; j > 0; j--)
{
if (array[j] < array[j - 1])
{
var temp = array[j];
array[j] = array[j - 1];
array[j - 1] = temp;
}
else
{
break;
}
}
}
return array;
}
}
}
|
using AutoMapper;
using dotnet_rpg.Dtos.Character;
using dotnet_rpg.Models;
namespace dotnet_rpg{
public class AutoMapperProfile:Profile{
public AutoMapperProfile(){
CreateMap<Character,GetDtoCharacter>();
CreateMap<AddDtoCharacter,Character>();
}
}
} |
using System;
using System.Collections.Generic;
using System.Text;
namespace Chess2_redo
{
class Player
{
public string color { get; set; }
public List<Piece> onBoard { get; set; }
public bool check = false;
public Player(string side)
{
onBoard = new List<Piece>();
color = side;
}
public King getKing()
{
if (this.color == "b") return Program.game.bkk;
else if (this.color == "w") return Program.game.wkk;
return null;
}
}
}
|
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Specialized;
namespace Hybrid.Quartz.InMemory
{
/// <summary>
///
/// </summary>
internal class InMemoryStorageOptionsExtension : IQuartzOptionsExtension
{
private readonly Action<InMemoryStorageQuartzOptions> _inMemoryQuartzOptions;
public InMemoryStorageOptionsExtension(Action<InMemoryStorageQuartzOptions> inMemoryQuartzOptions)
{
_inMemoryQuartzOptions = inMemoryQuartzOptions;
}
public void AddServices(IServiceCollection services)
{
var inMemoryQuartzOptions = new InMemoryStorageQuartzOptions();
_inMemoryQuartzOptions?.Invoke(inMemoryQuartzOptions);
services.AddSingleton(inMemoryQuartzOptions);
IScheduler scheduler = new StdSchedulerFactory(SetProperties(inMemoryQuartzOptions)).GetScheduler().Result;
services.AddSingleton(scheduler);
}
protected NameValueCollection SetProperties(InMemoryStorageQuartzOptions inMemoryQuartzOptions)
{
var properties = new NameValueCollection();
properties.Set(StdSchedulerFactory.PropertySchedulerName, inMemoryQuartzOptions.SchedulerName);
properties.Set(StdSchedulerFactory.PropertyJobStoreType, "Quartz.Simpl.RAMJobStore, Quartz");
//properties.Set(QuartzConsts.PropertySerializerType, inMemoryQuartzOptions.SerializerType.ToString());
//properties.Remove(QuartzConsts.PropertyDataSourceDatabaseConnectionString);
//properties.Remove(QuartzConsts.PropertyDataSourceDatabaseProvider);
//properties.Remove(QuartzConsts.PropertyJobStoreDataSource);
//properties.Remove(QuartzConsts.PropertyJobStoreDriverDelegateType);
//properties.Remove(QuartzConsts.PropertyJobStoreTablePrefix);
//properties.Remove(QuartzConsts.PropertyJobStoreUseProperties);
if (inMemoryQuartzOptions.IsUseHistoryPlugin)
{
// 加载插件
// properties.Set("quartz.plugin.自定义名称.type","命名空间.类名,程序集名称");
properties.Set("quartz.plugin.InMemoryExecutionHistory.type", "Hybrid.Quartz.Plugins.History.InMemoryExecutionHistoryPlugin, Hybrid.Quartz");
properties.Set("quartz.plugin.InMemoryExecutionHistory.storeType", "Hybrid.Quartz.Plugins.History.InMemoryExecutionHistoryStore, Hybrid.Quartz");
}
return properties;
}
}
} |
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
public partial class Yonetici_Ayar : System.Web.UI.Page
{
DataTable _dtMenu;
DataTable _dtYonetici;
DataTable _dtAyar;
Data _sysData = new Data();
OleDbConnection _cnn;
OleDbCommand _cmd;
private bool _blSil;
string Baglan = "Provider=Microsoft.jet.OLEDB.4.0; data source=" + HttpContext.Current.Server.MapPath("~/App_Data\\MercanYazilimDataBase.mdb");
protected void Page_Load(object sender, EventArgs e)
{
if (Session["idYonetici"] == null)
{
Response.Redirect("Giris.aspx");
}
if (!Page.IsPostBack)
{
_fncYoneticiListesi();
_fncMenuListesi();
_fncAyarListesi();
}
}
//private void _fncKayitSistemi(string[] array,string[] field,int FieldCount)
//{
// string sql = "INSERT INTO Yonetici (";
// for (int i = 0; i < field.Length; i++)
// {
// if (i == FieldCount)
// {
// sql += field[i].ToString();
// }
// else
// {
// sql += field[i].ToString() + ",";
// }
// }
// sql += ") VALUES (";
// for (int i = 0; i < array.Length; i++)
// {
// if (i == FieldCount)
// {
// sql += array[i].ToString();
// }
// else
// {
// sql += array[i].ToString() + ",";
// }
// }
// sql += ")";
// _cnn = new OleDbConnection(Baglan);
// _cnn.Open();
// _cmd = _cnn.CreateCommand();
// _cmd.CommandText = sql;
// _cmd.ExecuteNonQuery();
//}
private void _fncYoneticiListesi()
{
try
{
_dtYonetici = _sysData._fncSelect("SELECT idYonetici,Yonetici FROM Yonetici");
ListBox1.DataSource = _dtYonetici;
ListBox1.DataValueField = "idYonetici";
ListBox1.DataTextField = "Yonetici";
ListBox1.DataBind();
}
catch (Exception)
{
Response.Write("_fncYoneticiListesi()");
}
}
private void _fncAyarListesi()
{
try
{
_dtAyar = _sysData._fncSelect("SELECT PageTitle,PageFooter,Keywords,Description,Email,Telefon,AdSoyad FROM Ayar");
TextBox20.Text = _dtAyar.Rows[0]["PageTitle"].ToString();
TextBox21.Text = _dtAyar.Rows[0]["PageFooter"].ToString();
TextBox25.Text = _dtAyar.Rows[0]["Keywords"].ToString();
TextBox26.Text = _dtAyar.Rows[0]["Description"].ToString();
TextBox22.Text = _dtAyar.Rows[0]["Email"].ToString();
TextBox23.Text = _dtAyar.Rows[0]["Telefon"].ToString();
TextBox24.Text = _dtAyar.Rows[0]["AdSoyad"].ToString();
}
catch (Exception)
{
Response.Write("_fncAyarListesi()");
}
}
private void _fncMenuListesi()
{
try
{
_dtMenu = _sysData._fncSelect("SELECT idMenu,MenuAdi FROM Menu");
ListBox2.DataSource = _dtMenu;
ListBox2.DataValueField = "idMenu";
ListBox2.DataTextField = "MenuAdi";
ListBox2.DataBind();
}
catch (Exception)
{
Response.Write("_fncMenuListesi()");
}
}
protected void Button3_Click(object sender, EventArgs e)
{
try
{
_blSil = _sysData._fncExecuteNonQuery("DELETE FROM Yonetici WHERE idYonetici=" + ListBox1.SelectedValue + "");
_lblMesaj3.Text = "Silindi.";
_fncYoneticiListesi();
}
catch (Exception)
{
Response.Write("Button3_Click = Yonetici Sil");
}
}
//protected void _btnYoneticiKaydet_Click(object sender, EventArgs e)
//{
// string[] FieldArray = new string[2];
// FieldArray[0] = "Yonetici";
// FieldArray[1] = "Sifre";
// string[] YoneticiArray = new string[2];
// YoneticiArray[0] = TextBox1.Text;
// YoneticiArray[1] = TextBox2.Text;
// this._fncKayitSistemi(YoneticiArray,FieldArray,1);
//}
protected void _btnYoneticiKaydet_Click(object sender, EventArgs e)
{
try
{
_cnn = new OleDbConnection(Baglan);
_cnn.Open();
_cmd = _cnn.CreateCommand();
_cmd.CommandText = "INSERT INTO Yonetici (Yonetici,Sifre) VALUES (@Yonetici,@Sifre)";
_cmd.Parameters.AddWithValue("Yonetici", TextBox1.Text);
_cmd.Parameters.AddWithValue("Sifre", TextBox2.Text);
_cmd.ExecuteNonQuery();
_cnn.Close();
TextBox1.Text = "";
TextBox2.Text = "";
_lblMesaj.Text = "Kayıt Edildi.";
_fncYoneticiListesi();
}
catch (Exception)
{
Response.Write("_btnYoneticiKaydet_Click");
}
}
protected void Button15_Click(object sender, EventArgs e)
{
try
{
_dtYonetici = null;
_dtYonetici = _sysData._fncSelect("SELECT Yonetici,Sifre FROM Yonetici WHERE idYonetici=" + ListBox1.SelectedValue + "");
TextBox1.Text = _dtYonetici.Rows[0]["Yonetici"].ToString();
TextBox2.Text = _dtYonetici.Rows[0]["Sifre"].ToString();
}
catch (Exception)
{
Response.Write("Button15_Click= Yonetici Duzenle");
}
}
protected void _btnAyarKaydet_Click(object sender, EventArgs e)
{
try
{
_cnn = new OleDbConnection(Baglan);
_cnn.Open();
_cmd = _cnn.CreateCommand();
_cmd.CommandText = "UPDATE Ayar SET PageTitle=@PageTitle,PageFooter=@PageFooter,Keywords=@Keywords,Description=@Description,Email=@Email,Telefon=@Telefon,AdSoyad=@AdSoyad WHERE idAyar=@idAyar";
_cmd.Parameters.AddWithValue("PageTitle", TextBox20.Text);
_cmd.Parameters.AddWithValue("PageFooter", TextBox21.Text);
_cmd.Parameters.AddWithValue("Keywords", TextBox25.Text);
_cmd.Parameters.AddWithValue("Description", TextBox26.Text);
_cmd.Parameters.AddWithValue("Email", TextBox22.Text);
_cmd.Parameters.AddWithValue("Telefon", TextBox23.Text);
_cmd.Parameters.AddWithValue("AdSoyad", TextBox24.Text);
_cmd.Parameters.AddWithValue("idAyar", 1);
_cmd.ExecuteNonQuery();
_cnn.Close();
_fncAyarListesi();
_lblMesaj1.Text = "Güncellendi.";
}
catch (Exception)
{
Response.Write("_btnAyarKaydet_Click");
}
}
protected void Button19_Click(object sender, EventArgs e)
{
try
{
_blSil = _sysData._fncExecuteNonQuery("DELETE FROM Menu WHERE idMenu=" + ListBox2.SelectedValue + "");
_lblMesaj4.Text = "Silindi.";
_fncMenuListesi();
}
catch (Exception)
{
Response.Write("Hata.aspx");
}
}
protected void Button18_Click(object sender, EventArgs e)
{
try
{
_dtMenu = null;
_dtYonetici = _sysData._fncSelect("SELECT MenuAdi,MenuUrl FROM Menu WHERE idMenu=" + ListBox2.SelectedValue + "");
TextBox11.Text = _dtYonetici.Rows[0]["MenuAdi"].ToString();
TextBox12.Text = _dtYonetici.Rows[0]["MenuUrl"].ToString();
}
catch (Exception)
{
Response.Write("Hata.aspx");
}
}
protected void _btnMenuKaydet_Click(object sender, EventArgs e)
{
try
{
_cnn = new OleDbConnection(Baglan);
_cnn.Open();
_cmd = _cnn.CreateCommand();
_cmd.CommandText = "INSERT INTO Menu (MenuAdi,MenuUrl) VALUES (@MenuAdi,@MenuUrl)";
_cmd.Parameters.AddWithValue("MenuAdi", TextBox11.Text);
_cmd.Parameters.AddWithValue("MenuUrl", TextBox12.Text);
_cmd.ExecuteNonQuery();
_cnn.Close();
_fncMenuListesi();
TextBox11.Text = "";
TextBox12.Text = "";
_lblMesaj0.Text = "Kayıt Edildi.";
}
catch (Exception)
{
Response.Write("Hata.aspx");
}
}
protected void _btnYoneticiKaydet0_Click(object sender, EventArgs e)
{
try
{
_cnn = new OleDbConnection(Baglan);
_cnn.Open();
_cmd = _cnn.CreateCommand();
_cmd.CommandText = "UPDATE Yonetici SET Yonetici=@Yonetici,Sifre=@Sifre WHERE idYonetici=@idYonetici";
_cmd.Parameters.AddWithValue("Yonetici",TextBox1.Text);
_cmd.Parameters.AddWithValue("Sifre", TextBox2.Text);
_cmd.Parameters.AddWithValue("idYonetici", ListBox1.SelectedValue);
_cmd.ExecuteNonQuery();
_fncYoneticiListesi();
_lblMesaj3.Text = "Güncellendi.";
}
catch (Exception)
{
Response.Redirect("Hata.aspx");
}
}
protected void Button20_Click(object sender, EventArgs e)
{
try
{
_cnn = new OleDbConnection(Baglan);
_cnn.Open();
_cmd = _cnn.CreateCommand();
_cmd.CommandText = "UPDATE Menu SET MenuAdi=@MenuAdi,MenuUrl=@MenuUrl WHERE idMenu=@idMenu";
_cmd.Parameters.AddWithValue("MenuAdi", TextBox11.Text);
_cmd.Parameters.AddWithValue("MenuUrl", TextBox12.Text);
_cmd.Parameters.AddWithValue("idMenu", ListBox2.SelectedValue);
_cmd.ExecuteNonQuery();
_cnn.Close();
TextBox11.Text = "";
TextBox12.Text = "";
_fncMenuListesi();
}
catch (Exception)
{
Response.Redirect("Hata.aspx");
}
}
} |
using Microsoft.AspNetCore.Mvc;
using ProConstructionsManagment.Core.Entities;
using ProConstructionsManagment.Core.Enums;
using ProConstructionsManagment.Core.Interfaces;
using System;
using System.Threading.Tasks;
namespace ProConstructionsManagment.Web.Controllers
{
[Route("api/v1/")]
public class ProjectsController : Controller
{
private readonly IAsyncRepository<Project, ProjectStatus> _asyncRepository;
private readonly IAsyncRepository<ProjectCost> _repo;
private readonly IProjectsRepository _projectsRepository;
private readonly IAsyncRepository<ProjectRecruitment> _projectRecruitmentRepository;
public ProjectsController(IAsyncRepository<Project, ProjectStatus> asyncRepository, IAsyncRepository<ProjectCost> repo, IProjectsRepository projectsRepository, IAsyncRepository<ProjectRecruitment> projectRecruitmentRepository)
{
_asyncRepository = asyncRepository;
_repo = repo;
_projectsRepository = projectsRepository;
_projectRecruitmentRepository = projectRecruitmentRepository;
}
[HttpGet]
[Route("projects")]
public async Task<IActionResult> GetProjects()
{
var result = await _asyncRepository.GetAll();
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/recruitments")]
public async Task<IActionResult> GetProjectsRecruitments()
{
var result = await _projectRecruitmentRepository.GetAll();
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/started")]
public async Task<IActionResult> GetStartedProjects()
{
var result = await _asyncRepository.GetAllByStatus(ProjectStatus.Started);
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/start")]
public async Task<IActionResult> GetProjectsForStart()
{
var result = await _asyncRepository.GetAllByStatus(ProjectStatus.WaitingToStart);
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/settlement")]
public async Task<IActionResult> GetProjectsForSettlement()
{
var result = await _asyncRepository.GetAllByStatus(ProjectStatus.ForSettlement);
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/settled")]
public async Task<IActionResult> GetSettledProjects()
{
var result = await _asyncRepository.GetAllByStatus(ProjectStatus.Settled);
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/ended")]
public async Task<IActionResult> GetEndedProjects()
{
var result = await _asyncRepository.GetAllByStatus(ProjectStatus.Ended);
return Ok(new
{
data = result,
summaries = new
{
count = result.Count
}
});
}
[HttpGet]
[Route("projects/{projectId}")]
public async Task<IActionResult> GetProjectById(Guid projectId)
{
var result = await _asyncRepository.GetById(projectId);
return Ok(new
{
data = result
});
}
[HttpGet]
[Route("projects/{projectId}/recruitments")]
public async Task<IActionResult> GetProjectRecruitments(Guid projectId)
{
var result = await _projectsRepository.GetProjectRecruitments(projectId);
return Ok(new
{
data = result
});
}
[HttpGet]
[Route("projects/recruitments/{projectRecruitmentId}")]
public async Task<IActionResult> GetProjectRecruitmentById(Guid projectRecruitmentId)
{
var result = await _projectsRepository.GetProjectRecruitment(projectRecruitmentId);
return Ok(new
{
data = result
});
}
[HttpPost]
[Route("projects/{projectId}/recruitment/add")]
public async Task<IActionResult> AddProjectRecruitment([FromBody] ProjectRecruitment entity, Guid projectId)
{
var data = new ProjectRecruitment
{
Id = entity.Id,
ProjectId = projectId,
PositionId = entity.PositionId,
RequiredNumberOfEmployees = entity.RequiredNumberOfEmployees
};
var result = await _projectRecruitmentRepository.Add(data);
return Ok(result);
}
[HttpPost]
[Route("project/add")]
public async Task<IActionResult> AddProject([FromBody] Project entity)
{
var result = await _asyncRepository.Add(entity);
return Ok(result);
}
[HttpPost]
[Route("projects/{projectId}/update")]
public async Task<IActionResult> UpdateProject([FromBody] Project entity, Guid projectId)
{
var result = await _asyncRepository.Update(entity, projectId);
return Ok(result);
}
[HttpPost]
[Route("projects/{projectId}/recruitment/update")]
public async Task<IActionResult> UpdateAddProjectRecruitment([FromBody] ProjectRecruitment entity, Guid projectId)
{
var result = await _projectRecruitmentRepository.Update(entity, projectId);
return Ok(result);
}
[HttpGet]
[Route("projects/{projectId}/costs")]
public async Task<IActionResult> GetProjectCosts(Guid projectId)
{
var result = await _projectsRepository.GetAllProjectCosts(projectId);
return Ok(new
{
data = result
});
}
[HttpGet]
[Route("projects/{projectCostId}/cost")]
public async Task<IActionResult> GetProjectCostById(Guid projectCostId)
{
var result = await _projectsRepository.GetProjectCost(projectCostId);
return Ok(new
{
data = result
});
}
[HttpPost]
[Route("projects/{projectId}/costs/add")]
public async Task<IActionResult> AddProjectCost([FromBody] ProjectCost entity, Guid projectId)
{
var data = new ProjectCost
{
Id = entity.Id,
ProjectId = projectId,
GrossAmount = entity.GrossAmount,
CostDescription = entity.CostDescription
};
var result = await _repo.Add(data);
return Ok(result);
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
namespace Psns.Common.Web.Adapters
{
/// <summary>
/// An adapter for HttpRequest.ClientCertificate to better enable loose coupling
/// </summary>
public class HttpClientCertificateAdapter
{
static string _subject;
/// <summary>
/// Unless explicitly set, HttpContext.Current.Request.ClientCertificate.Subject is returned
/// </summary>
public static string Subject
{
get
{
return _subject ?? HttpContext.Current.Request.ClientCertificate.Subject;
}
set { _subject = value; }
}
}
}
|
using ALM.ServicioAdminEmpresas.Entidades;
using ALM.ServicioAdminEmpresas.Negocio;
using System;
using System.Web.Http;
namespace ALM.ServicioAdminEmpresas.RestService.Controllers
{
public class InicioController : ApiController
{
[HttpGet]
[Route("api/v1/Inicio/Empresa/{dominio}/{origen}/{usuarios}/{clientes}/{registros}/{productKey}/{fechaLlamada}")]
public IHttpActionResult ValidarEmpresa(string dominio, int origen, short usuarios, short clientes, Int64 registros, string productKey, int fechaLlamada)
{
string valor;
string key = productKey.Replace("__", "+");
try
{
valor = new NEmpresa().ValidarEmpresa(dominio, origen, usuarios, clientes, registros, key, fechaLlamada);
return Json(valor);
}
catch (Exception ex)
{
return InternalServerError(ex);
}
}
[HttpGet]
[Route("api/v1/Inicio/SuperUsuario/{login}/{password}/{dominio}/{productKey}/{fechaLlamada}")]
public IHttpActionResult ValidarSuperUsuario(string login, string password, string dominio, string productKey, int fechaLlamada)
{
string valor;
string key = productKey.Replace("__", "+");
try
{
valor = new NSuperAdministrador().ValidarSuperUsuario(login, password, dominio, key, fechaLlamada);
return Json(valor);
}
catch (Exception ex)
{
return InternalServerError(ex);
}
}
[HttpGet]
[Route("api/v1/Inicio/LimpiarEmpresa/{codigo}/{productKey}/{fechaLlamada}")]
public IHttpActionResult LimpiarEmpresa(string codigo, string productKey, int fechaLlamada)
{
string key = productKey.Replace("__", "+");
try
{
return Json(new NSuperAdministrador().LimpiarEmpresa(codigo, key, fechaLlamada));
}
catch (Exception ex)
{
return InternalServerError(ex);
}
}
}
} |
using ETModel;
namespace ETHotfix
{
[ActorMessageHandler(AppType.Map)]
public class Movement_JumpHandler : AMActorLocationHandler<Unit, Movement_Jump>
{
protected override async ETTask Run(Unit entity, Movement_Jump message)
{
M2C_MovementResult m2C_MovementResult = new M2C_MovementResult();
m2C_MovementResult.Id = entity.Id;
MessageHelper.Broadcast(m2C_MovementResult);
await ETTask.CompletedTask;
}
}
} |
using System;
using BPiaoBao.Client.UIExt;
using BPiaoBao.Common.Enums;
using GalaSoft.MvvmLight;
namespace BPiaoBao.Client.DomesticTicket.Model
{
/// <summary>
/// 线下婴儿实体
/// </summary>
public class BabyModel : ObservableObject
{
#region 线下婴儿姓名
public const string BabyNamePropertyName = "BabyName";
private string _babyName;
/// <summary>
/// 线下婴儿姓名
/// </summary>
public string BabyName
{
get { return _babyName; }
set
{
if (_babyName == value) return;
RaisePropertyChanging(BabyNamePropertyName);
_babyName = value;
RaisePropertyChanged(BabyNamePropertyName);
}
}
#endregion
#region 线下婴儿性别
public const string SexTypeProprtyName = "SexType";
private EnumSexType _sexType;
/// <summary>
/// 被投保人性别
/// </summary>
public EnumSexType SexType
{
get { return _sexType; }
set
{
if (_sexType == value) return;
RaisePropertyChanging(SexTypeProprtyName);
_sexType = value;
RaisePropertyChanged(SexTypeProprtyName);
}
}
#endregion
#region 被投保人出生日期
public const string BornDatePropertyName = "BornDate";
private DateTime? _bornDate;
/// <summary>
/// 被投保人出生日期
/// </summary>
public DateTime? BornDate
{
get { return _bornDate; }
set
{
if (_bornDate == value) return;
RaisePropertyChanging(BornDatePropertyName);
_bornDate = value;
RaisePropertyChanged(BornDatePropertyName);
}
}
#endregion
#region DisplayDateEnd
protected const string CDisplayDateEndPropertyName = "DisplayDateEnd";
private DateTime _displayDateEnd;
/// <summary>
/// DisplayDateEnd
/// </summary>
public DateTime DisplayDateEnd
{
get { return _displayDateEnd; }
set
{
if (_displayDateEnd == value) return;
RaisePropertyChanging(CDisplayDateEndPropertyName);
_displayDateEnd = value;
RaisePropertyChanged(CDisplayDateEndPropertyName);
}
}
#endregion
#region DisplayDateStart
protected const string CDisplayDateStartPropertyName = "DisplayDateStart";
private DateTime _displayDateStart;
/// <summary>
/// DisplayDateStart
/// </summary>
public DateTime DisplayDateStart
{
get { return _displayDateStart; }
set
{
if (_displayDateStart == value) return;
RaisePropertyChanging(CDisplayDateStartPropertyName);
_displayDateStart = value;
RaisePropertyChanged(CDisplayDateStartPropertyName);
}
}
#endregion
/// <summary>
/// 验证input
/// </summary>
public bool CheckInput()
{
try
{
if (!string.IsNullOrWhiteSpace(BabyName))
{
//1.全中文
//2.英文/英文
//3.中文英文
//4.全中文长度<15;英文<30;中文英文<30
if (SexType != EnumSexType.UnKnown)
{
if (BornDate != null && BornDate >= DisplayDateStart && BornDate <= DisplayDateEnd) return true;
UIManager.ShowMessage(string.Format("请核对出生日期范围{0:yyyy-MM-dd}",BornDate));
return false;
}
UIManager.ShowMessage(string.Format("请选择性别"));
return false;
}
UIManager.ShowMessage(string.Format("姓名不能为空"));
return false;
}
catch (Exception ex)
{
UIManager.ShowErr(ex);
return false;
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Text;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using WpfTesting.Model;
namespace WpfTesting.ViewModel {
/// <summary>
/// This class contains properties that the main View can data bind to.
/// <para>
/// Use the <strong>mvvminpc</strong> snippet to add bindable properties to this ViewModel.
/// </para>
/// <para>
/// You can also use Blend to data bind with the tool's support.
/// </para>
/// <para>
/// See http://www.galasoft.ch/mvvm
/// </para>
/// </summary>
public class MainViewModel : ViewModelBase {
/*/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel() {
Collection = new ObservableCollection<int>();
Categories = new ObservableCollection<ComboItem> {
new ComboItem(0, 5),
};
for (int i = 0; i < 4; i++) {
Categories.Add(Categories[i].Items[0]);
}
Action = new RelayCommand(ActionExecute);
for (int i = 0; i < 4; i++) {
Collection.Add(i);
}
Categories.CollectionChanged += Categories_CollectionChanged;
}
private void Categories_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) {
Console.WriteLine($"{e.Action} Start={e.NewStartingIndex} Count={e.NewItems.Count}");
}
private Random random = new Random();
public ObservableCollection<ComboItem> Categories { get; }
public ObservableCollection<int> Collection { get; }
public RelayCommand Action { get; }
private void ActionExecute() {
Collection[random.Next(Collection.Count)]++;
}*/
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel() {
Collection = new ObservableCollection<int>();
Categories = new ObservableArray<ComboItem>(5);
this[0] = new ComboItem(0, 5);
for (int i = 0; i < 4; i++) {
this[i + 1] = this[i].Items[0];
}
ComboItem.TotalItems = 0;
Categories[0] = new ComboItem(0, 5);
for (int i = 0; i < 4; i++) {
Categories[i + 1] = Categories[i].Items[0];
}
Action = new RelayCommand(ActionExecute);
for (int i = 0; i < 4; i++) {
Collection.Add(i);
}
Categories.CollectionChanged += Categories_CollectionChanged;
}
private Random random = new Random();
public ObservableArray<ComboItem> Categories { get; }
public ObservableCollection<int> Collection { get; }
public RelayCommand Action { get; }
private ComboItem c0;
private ComboItem c1;
private ComboItem c2;
private ComboItem c3;
private ComboItem c4;
public ComboItem this[int index] {
get => (ComboItem) typeof(MainViewModel).GetProperty($"Categories{index}").GetValue(this);
set => typeof(MainViewModel).GetProperty($"Categories{index}").SetValue(this, value);
}
public ComboItem Categories0 { get => c0; set => Set(ref c0, value); }
public ComboItem Categories1 { get => c1; set => Set(ref c1, value); }
public ComboItem Categories2 { get => c2; set => Set(ref c2, value); }
public ComboItem Categories3 { get => c3; set => Set(ref c3, value); }
public ComboItem Categories4 { get => c4; set => Set(ref c4, value); }
private void ActionExecute() {
Collection[random.Next(Collection.Count)]++;
}
private void Categories_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) {
//Console.WriteLine($"{e.Action} Start={e.NewStartingIndex} Count={e.NewItems.Count}");
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SoundScript : MonoBehaviour
{
public static AudioClip slideSound, victorySound;
static AudioSource source;
public Sprite soundOff;
public Sprite soundOn;
public Button soundBtn;
public void switchSound()
{
if (soundBtn.image.sprite == soundOn)
{
soundBtn.image.sprite = soundOff;
GameData.Audio = false;
}
else
{
soundBtn.image.sprite = soundOn;
GameData.Audio = true;
}
}
void Start()
{
slideSound = Resources.Load<AudioClip> ("ClickSound");
victorySound = Resources.Load<AudioClip> ("VictorySound");
source = GetComponent<AudioSource>();
if(GameData.Audio) soundBtn.image.sprite = soundOn;
else soundBtn.image.sprite = soundOff;
}
public static void playSound (string audio)
{
if (audio == "ClickSound")
{
source.PlayOneShot(slideSound);
}
else if (audio == "VictorySound")
{
source.PlayOneShot(victorySound);
}
}
}
|
/*
* Bungie.Net API
*
* These endpoints constitute the functionality exposed by Bungie.net, both for more traditional website functionality and for connectivity to Bungie video games and their related functionality.
*
* OpenAPI spec version: 2.1.1
* Contact: support@bungie.com
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = BungieNetPlatform.Client.SwaggerDateConverter;
namespace BungieNetPlatform.Model
{
/// <summary>
/// In an attempt to categorize items by type, usage, and other interesting properties, we created DestinyItemCategoryDefinition: information about types that is assembled using a set of heuristics that examine the properties of an item such as what inventory bucket it's in, its item type name, and whether it has or is missing certain blocks of data. This heuristic is imperfect, however. If you find an item miscategorized, let us know on the Bungie API forums! We then populate all of the categories that we think an item belongs to in its DestinyInventoryItemDefinition.itemCategoryHashes property. You can use that to provide your own custom item filtering, sorting, aggregating... go nuts on it! And let us know if you see more categories that you wish would be added!
/// </summary>
[DataContract]
public partial class DestinyDefinitionsDestinyItemCategoryDefinition : IEquatable<DestinyDefinitionsDestinyItemCategoryDefinition>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="DestinyDefinitionsDestinyItemCategoryDefinition" /> class.
/// </summary>
/// <param name="DisplayProperties">DisplayProperties.</param>
/// <param name="Visible">If True, this category should be visible in UI. Sometimes we make categories that we don't think are interesting externally. It's up to you if you want to skip on showing them..</param>
/// <param name="ShortTitle">A shortened version of the title. The reason why we have this is because the Armory in German had titles that were too long to display in our UI, so these were localized abbreviated versions of those categories. The property still exists today, even though the Armory doesn't exist for D2... yet..</param>
/// <param name="ItemTypeRegex">The janky regular expression we used against the item type to try and discern whether the item belongs to this category..</param>
/// <param name="ItemTypeRegexNot">If the item type matches this janky regex, it does *not* belong to this category..</param>
/// <param name="OriginBucketIdentifier">If the item belongs to this bucket, it does belong to this category..</param>
/// <param name="GrantDestinyItemType">If an item belongs to this category, it will also receive this item type. This is now how DestinyItemType is populated for items: it used to be an even jankier process, but that's a story that requires more alcohol..</param>
/// <param name="GrantDestinySubType">If an item belongs to this category, it will also receive this subtype enum value. I know what you're thinking - what if it belongs to multiple categories that provide sub-types? The last one processed wins, as is the case with all of these \"grant\" enums. Now you can see one reason why we moved away from these enums... but they're so convenient when they work, aren't they?.</param>
/// <param name="GrantDestinyClass">If an item belongs to this category, it will also get this class restriction enum value. See the other \"grant\"-prefixed properties on this definition for my color commentary..</param>
/// <param name="GroupedCategoryHashes">If this category is a \"parent\" category of other categories, those children will have their hashes listed in rendering order here, and can be looked up using these hashes against DestinyItemCategoryDefinition. In this way, you can build up a visual hierarchy of item categories. That's what we did, and you can do it too. I believe in you. Yes, you, Carl. (I hope someone named Carl reads this someday).</param>
/// <param name="Hash">The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to..</param>
/// <param name="Index">The index of the entity as it was found in the investment tables..</param>
/// <param name="Redacted">If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry!.</param>
public DestinyDefinitionsDestinyItemCategoryDefinition(DestinyDefinitionsCommonDestinyDisplayPropertiesDefinition DisplayProperties = default(DestinyDefinitionsCommonDestinyDisplayPropertiesDefinition), bool? Visible = default(bool?), string ShortTitle = default(string), string ItemTypeRegex = default(string), string ItemTypeRegexNot = default(string), string OriginBucketIdentifier = default(string), DestinyDestinyItemType GrantDestinyItemType = default(DestinyDestinyItemType), DestinyDestinyItemSubType GrantDestinySubType = default(DestinyDestinyItemSubType), DestinyDestinyClass GrantDestinyClass = default(DestinyDestinyClass), List<uint?> GroupedCategoryHashes = default(List<uint?>), uint? Hash = default(uint?), int? Index = default(int?), bool? Redacted = default(bool?))
{
this.DisplayProperties = DisplayProperties;
this.Visible = Visible;
this.ShortTitle = ShortTitle;
this.ItemTypeRegex = ItemTypeRegex;
this.ItemTypeRegexNot = ItemTypeRegexNot;
this.OriginBucketIdentifier = OriginBucketIdentifier;
this.GrantDestinyItemType = GrantDestinyItemType;
this.GrantDestinySubType = GrantDestinySubType;
this.GrantDestinyClass = GrantDestinyClass;
this.GroupedCategoryHashes = GroupedCategoryHashes;
this.Hash = Hash;
this.Index = Index;
this.Redacted = Redacted;
}
/// <summary>
/// Gets or Sets DisplayProperties
/// </summary>
[DataMember(Name="displayProperties", EmitDefaultValue=false)]
public DestinyDefinitionsCommonDestinyDisplayPropertiesDefinition DisplayProperties { get; set; }
/// <summary>
/// If True, this category should be visible in UI. Sometimes we make categories that we don't think are interesting externally. It's up to you if you want to skip on showing them.
/// </summary>
/// <value>If True, this category should be visible in UI. Sometimes we make categories that we don't think are interesting externally. It's up to you if you want to skip on showing them.</value>
[DataMember(Name="visible", EmitDefaultValue=false)]
public bool? Visible { get; set; }
/// <summary>
/// A shortened version of the title. The reason why we have this is because the Armory in German had titles that were too long to display in our UI, so these were localized abbreviated versions of those categories. The property still exists today, even though the Armory doesn't exist for D2... yet.
/// </summary>
/// <value>A shortened version of the title. The reason why we have this is because the Armory in German had titles that were too long to display in our UI, so these were localized abbreviated versions of those categories. The property still exists today, even though the Armory doesn't exist for D2... yet.</value>
[DataMember(Name="shortTitle", EmitDefaultValue=false)]
public string ShortTitle { get; set; }
/// <summary>
/// The janky regular expression we used against the item type to try and discern whether the item belongs to this category.
/// </summary>
/// <value>The janky regular expression we used against the item type to try and discern whether the item belongs to this category.</value>
[DataMember(Name="itemTypeRegex", EmitDefaultValue=false)]
public string ItemTypeRegex { get; set; }
/// <summary>
/// If the item type matches this janky regex, it does *not* belong to this category.
/// </summary>
/// <value>If the item type matches this janky regex, it does *not* belong to this category.</value>
[DataMember(Name="itemTypeRegexNot", EmitDefaultValue=false)]
public string ItemTypeRegexNot { get; set; }
/// <summary>
/// If the item belongs to this bucket, it does belong to this category.
/// </summary>
/// <value>If the item belongs to this bucket, it does belong to this category.</value>
[DataMember(Name="originBucketIdentifier", EmitDefaultValue=false)]
public string OriginBucketIdentifier { get; set; }
/// <summary>
/// If an item belongs to this category, it will also receive this item type. This is now how DestinyItemType is populated for items: it used to be an even jankier process, but that's a story that requires more alcohol.
/// </summary>
/// <value>If an item belongs to this category, it will also receive this item type. This is now how DestinyItemType is populated for items: it used to be an even jankier process, but that's a story that requires more alcohol.</value>
[DataMember(Name="grantDestinyItemType", EmitDefaultValue=false)]
public DestinyDestinyItemType GrantDestinyItemType { get; set; }
/// <summary>
/// If an item belongs to this category, it will also receive this subtype enum value. I know what you're thinking - what if it belongs to multiple categories that provide sub-types? The last one processed wins, as is the case with all of these \"grant\" enums. Now you can see one reason why we moved away from these enums... but they're so convenient when they work, aren't they?
/// </summary>
/// <value>If an item belongs to this category, it will also receive this subtype enum value. I know what you're thinking - what if it belongs to multiple categories that provide sub-types? The last one processed wins, as is the case with all of these \"grant\" enums. Now you can see one reason why we moved away from these enums... but they're so convenient when they work, aren't they?</value>
[DataMember(Name="grantDestinySubType", EmitDefaultValue=false)]
public DestinyDestinyItemSubType GrantDestinySubType { get; set; }
/// <summary>
/// If an item belongs to this category, it will also get this class restriction enum value. See the other \"grant\"-prefixed properties on this definition for my color commentary.
/// </summary>
/// <value>If an item belongs to this category, it will also get this class restriction enum value. See the other \"grant\"-prefixed properties on this definition for my color commentary.</value>
[DataMember(Name="grantDestinyClass", EmitDefaultValue=false)]
public DestinyDestinyClass GrantDestinyClass { get; set; }
/// <summary>
/// If this category is a \"parent\" category of other categories, those children will have their hashes listed in rendering order here, and can be looked up using these hashes against DestinyItemCategoryDefinition. In this way, you can build up a visual hierarchy of item categories. That's what we did, and you can do it too. I believe in you. Yes, you, Carl. (I hope someone named Carl reads this someday)
/// </summary>
/// <value>If this category is a \"parent\" category of other categories, those children will have their hashes listed in rendering order here, and can be looked up using these hashes against DestinyItemCategoryDefinition. In this way, you can build up a visual hierarchy of item categories. That's what we did, and you can do it too. I believe in you. Yes, you, Carl. (I hope someone named Carl reads this someday)</value>
[DataMember(Name="groupedCategoryHashes", EmitDefaultValue=false)]
public List<uint?> GroupedCategoryHashes { get; set; }
/// <summary>
/// The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to.
/// </summary>
/// <value>The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to.</value>
[DataMember(Name="hash", EmitDefaultValue=false)]
public uint? Hash { get; set; }
/// <summary>
/// The index of the entity as it was found in the investment tables.
/// </summary>
/// <value>The index of the entity as it was found in the investment tables.</value>
[DataMember(Name="index", EmitDefaultValue=false)]
public int? Index { get; set; }
/// <summary>
/// If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry!
/// </summary>
/// <value>If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry!</value>
[DataMember(Name="redacted", EmitDefaultValue=false)]
public bool? Redacted { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class DestinyDefinitionsDestinyItemCategoryDefinition {\n");
sb.Append(" DisplayProperties: ").Append(DisplayProperties).Append("\n");
sb.Append(" Visible: ").Append(Visible).Append("\n");
sb.Append(" ShortTitle: ").Append(ShortTitle).Append("\n");
sb.Append(" ItemTypeRegex: ").Append(ItemTypeRegex).Append("\n");
sb.Append(" ItemTypeRegexNot: ").Append(ItemTypeRegexNot).Append("\n");
sb.Append(" OriginBucketIdentifier: ").Append(OriginBucketIdentifier).Append("\n");
sb.Append(" GrantDestinyItemType: ").Append(GrantDestinyItemType).Append("\n");
sb.Append(" GrantDestinySubType: ").Append(GrantDestinySubType).Append("\n");
sb.Append(" GrantDestinyClass: ").Append(GrantDestinyClass).Append("\n");
sb.Append(" GroupedCategoryHashes: ").Append(GroupedCategoryHashes).Append("\n");
sb.Append(" Hash: ").Append(Hash).Append("\n");
sb.Append(" Index: ").Append(Index).Append("\n");
sb.Append(" Redacted: ").Append(Redacted).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as DestinyDefinitionsDestinyItemCategoryDefinition);
}
/// <summary>
/// Returns true if DestinyDefinitionsDestinyItemCategoryDefinition instances are equal
/// </summary>
/// <param name="input">Instance of DestinyDefinitionsDestinyItemCategoryDefinition to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(DestinyDefinitionsDestinyItemCategoryDefinition input)
{
if (input == null)
return false;
return
(
this.DisplayProperties == input.DisplayProperties ||
(this.DisplayProperties != null &&
this.DisplayProperties.Equals(input.DisplayProperties))
) &&
(
this.Visible == input.Visible ||
(this.Visible != null &&
this.Visible.Equals(input.Visible))
) &&
(
this.ShortTitle == input.ShortTitle ||
(this.ShortTitle != null &&
this.ShortTitle.Equals(input.ShortTitle))
) &&
(
this.ItemTypeRegex == input.ItemTypeRegex ||
(this.ItemTypeRegex != null &&
this.ItemTypeRegex.Equals(input.ItemTypeRegex))
) &&
(
this.ItemTypeRegexNot == input.ItemTypeRegexNot ||
(this.ItemTypeRegexNot != null &&
this.ItemTypeRegexNot.Equals(input.ItemTypeRegexNot))
) &&
(
this.OriginBucketIdentifier == input.OriginBucketIdentifier ||
(this.OriginBucketIdentifier != null &&
this.OriginBucketIdentifier.Equals(input.OriginBucketIdentifier))
) &&
(
this.GrantDestinyItemType == input.GrantDestinyItemType ||
(this.GrantDestinyItemType != null &&
this.GrantDestinyItemType.Equals(input.GrantDestinyItemType))
) &&
(
this.GrantDestinySubType == input.GrantDestinySubType ||
(this.GrantDestinySubType != null &&
this.GrantDestinySubType.Equals(input.GrantDestinySubType))
) &&
(
this.GrantDestinyClass == input.GrantDestinyClass ||
(this.GrantDestinyClass != null &&
this.GrantDestinyClass.Equals(input.GrantDestinyClass))
) &&
(
this.GroupedCategoryHashes == input.GroupedCategoryHashes ||
this.GroupedCategoryHashes != null &&
this.GroupedCategoryHashes.SequenceEqual(input.GroupedCategoryHashes)
) &&
(
this.Hash == input.Hash ||
(this.Hash != null &&
this.Hash.Equals(input.Hash))
) &&
(
this.Index == input.Index ||
(this.Index != null &&
this.Index.Equals(input.Index))
) &&
(
this.Redacted == input.Redacted ||
(this.Redacted != null &&
this.Redacted.Equals(input.Redacted))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.DisplayProperties != null)
hashCode = hashCode * 59 + this.DisplayProperties.GetHashCode();
if (this.Visible != null)
hashCode = hashCode * 59 + this.Visible.GetHashCode();
if (this.ShortTitle != null)
hashCode = hashCode * 59 + this.ShortTitle.GetHashCode();
if (this.ItemTypeRegex != null)
hashCode = hashCode * 59 + this.ItemTypeRegex.GetHashCode();
if (this.ItemTypeRegexNot != null)
hashCode = hashCode * 59 + this.ItemTypeRegexNot.GetHashCode();
if (this.OriginBucketIdentifier != null)
hashCode = hashCode * 59 + this.OriginBucketIdentifier.GetHashCode();
if (this.GrantDestinyItemType != null)
hashCode = hashCode * 59 + this.GrantDestinyItemType.GetHashCode();
if (this.GrantDestinySubType != null)
hashCode = hashCode * 59 + this.GrantDestinySubType.GetHashCode();
if (this.GrantDestinyClass != null)
hashCode = hashCode * 59 + this.GrantDestinyClass.GetHashCode();
if (this.GroupedCategoryHashes != null)
hashCode = hashCode * 59 + this.GroupedCategoryHashes.GetHashCode();
if (this.Hash != null)
hashCode = hashCode * 59 + this.Hash.GetHashCode();
if (this.Index != null)
hashCode = hashCode * 59 + this.Index.GetHashCode();
if (this.Redacted != null)
hashCode = hashCode * 59 + this.Redacted.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace GetLabourManager.Models
{
public class EmployeeRelations
{
public int Id { get; set; }
public int StaffId { get; set; }
public string GuarantorName { get; set; }
public string GuarantorPhone { get; set; }
public string GuarantorRelation { get; set; }
public string GuarantorAddress { get; set; }
public string NextofKinName { get; set; }
public string NextofKinPhone { get; set; }
public string NextofKinRelation { get; set; }
public string NextofKinAddress { get; set; }
}
} |
using System.Linq;
using Microsoft.Dynamics365.UIAutomation.Browser;
using OpenQA.Selenium;
using TechTalk.SpecFlow;
using Vantage.Automation.LegalFlowUITest.Context;
using Vantage.Automation.LegalFlowUITest.Helpers;
namespace Vantage.Automation.LegalFlowUITest.Steps
{
[Binding]
public class ServiceRequestNotificationSteps
{
private readonly UIContext _uiContext;
private const string _newActivityButton = "//button[contains(@title,'New Activity')]";
private const string _emailButton = "//button[contains(@title,'Email')]";
private const string _emailBodyXPath = "//body[contains(@class,'cke_editable')]";
private const string _designerFrameXPath = "//iframe[@title='Designer']";
private const string _editorFrameXPath = "//iframe[contains(@class,'cke_wysiwyg_frame')]";
private const string _signatureDocumentInput = "//div[contains(@data-id,'ulx_documentstosign')]//following::input";
private const string _signatureDocumentCheckBox = "//div[@role='checkbox']";
private const string _signatureDocumentButton = "//div[contains(@data-id,'ulx_documentstosign')]//following::button";
public ServiceRequestNotificationSteps(UIContext context)
{
_uiContext = context;
}
[When("I select the Service Request Activities tab")]
public void SelectServiceRequestActivitiesTab()
{
_uiContext.XrmApp.Entity.SelectTab("Related", "Activities");
}
[When("I add an Email to the Service Request with the following properties")]
public void AddAnEmailToAServiceRequest(Table table)
{
var newActivityButton = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_newActivityButton));
newActivityButton.Click();
_uiContext.XrmApp.ThinkTime(500);
var emailButton = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_emailButton));
emailButton.Click();
_uiContext.XrmApp.ThinkTime(500);
_uiContext.WebClient.Browser.Driver.WaitForTransaction();
FieldFiller fieldFiller = new FieldFiller(_uiContext);
var keyValues = table.Header.ToArray().ToDictionary(h => h, h => table.Rows[0][h]);
fieldFiller.EntityFillOutFields(keyValues, true);
_uiContext.XrmApp.ThinkTime(500);
}
[When("I send the Email")]
public void ClickSendButton()
{
_uiContext.XrmApp.CommandBar.ClickCommand("Send");
_uiContext.WebClient.Browser.Driver.WaitForTransaction();
}
[When("I set the email body to '(.*)'")]
public void SetEmailBodyTo(string body)
{
var designerFrame = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_designerFrameXPath));
_uiContext.WebClient.Browser.Driver.SwitchTo().Frame(designerFrame);
var editorFrame = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_editorFrameXPath));
_uiContext.WebClient.Browser.Driver.SwitchTo().Frame(editorFrame);
var articleBody = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_emailBodyXPath));
articleBody.SendKeys(body);
_uiContext.WebClient.Browser.Driver.SwitchTo().ParentFrame();
_uiContext.WebClient.Browser.Driver.SwitchTo().ParentFrame();
_uiContext.XrmApp.ThinkTime(500);
}
[Then("I verify that I can click Initiate BriefBox")]
public void ClickInitiateBriefbox()
{
_uiContext.XrmApp.CommandBar.ClickCommand("Initiate BriefBox");
}
[When("I click Request Signature")]
public void ClickRequestSignature()
{
_uiContext.XrmApp.CommandBar.ClickCommand("Request Signature");
_uiContext.WebClient.Browser.Driver.WaitForTransaction();
}
[When("I select Signature Document '(.*)'")]
public void SelectSignatureDocument(string document)
{
var documentInput = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_signatureDocumentInput));
documentInput.SendKeys(document);
var documentCheckBox = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_signatureDocumentCheckBox));
documentCheckBox.Click();
_uiContext.XrmApp.ThinkTime(500);
var documentOkButton = _uiContext.WebClient.Browser.Driver.WaitUntilAvailable(By.XPath(_signatureDocumentButton));
documentOkButton.Click();
}
[When("I add a Signee to the Signature Request with the following properties")]
public void AddASigneeSignatureRequest(Table table)
{
_uiContext.XrmApp.Entity.SubGrid.ClickCommand("SigneesSubGrid", "New Signee");
FieldFiller fieldFiller = new FieldFiller(_uiContext);
var keyValues = table.Header.ToArray().ToDictionary(h => h, h => table.Rows[0][h]);
fieldFiller.QuickCreateFillOutFields(keyValues);
_uiContext.XrmApp.QuickCreate.Save();
}
[When("I submit the Signature Request")]
public void ClickSubmit()
{
_uiContext.XrmApp.CommandBar.ClickCommand("Submit");
_uiContext.WebClient.Browser.Driver.WaitForTransaction();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AlienEngine.ASL;
namespace AlienEngine.Core.Graphics.Shaders.Samples
{
[Version(330)]
internal class BumpedDiffuseFragmentShader : FragmentShader
{
#region Structs
// --------------------
// Material state
// --------------------
struct MaterialState
{
public uint blendMode;
public float bumpScaling;
public vec4 colorAmbient;
public vec4 colorDiffuse;
public vec4 colorEmissive;
public vec4 colorReflective;
public vec4 colorSpecular;
public vec4 colorTransparent;
public bool hasBlendMode;
public bool hasBumpScaling;
public bool hasColorAmbient;
public bool hasColorDiffuse;
public bool hasColorEmissive;
public bool hasColorReflective;
public bool hasColorSpecular;
public bool hasColorTransparent;
public bool hasName;
public bool hasOpacity;
public bool hasReflectivity;
public bool hasShadingMode;
public bool hasShininess;
public bool hasShininessStrength;
public bool hasTextureAmbient;
public bool hasTextureDiffuse;
public bool hasTextureDisplacement;
public bool hasTextureEmissive;
public bool hasTextureHeight;
public bool hasTextureLightMap;
public bool hasTextureNormal;
public bool hasTextureOpacity;
public bool hasTextureReflection;
public bool hasTextureSpecular;
public bool hasTwoSided;
public bool hasWireFrame;
public bool isTwoSided;
public bool isWireFrameEnabled;
public float opacity;
public int propertyCount;
public float reflectivity;
public uint shadingMode;
public float shininess;
public float shininessStrength;
public sampler2D textureAmbient;
public sampler2D textureDiffuse;
public sampler2D textureDisplacement;
public sampler2D textureEmissive;
public sampler2D textureHeight;
public sampler2D textureLightMap;
public sampler2D textureNormal;
public sampler2D textureOpacity;
public sampler2D textureReflection;
public sampler2D textureSpecular;
}
// --------------------
// Light State
// --------------------
struct LightState
{
// The type of the light.
// 1 = Spot
// 2 = Directional
// 3 = Point
public int Type;
// Light colors (all lights).
public vec4 AmbientColor;
public vec4 DiffuseColor;
public vec4 SpecularColor;
// Ambient light intensity
public float Intensity;
// The light direction vector (directional and spot lights).
public vec3 Direction;
// The light position vector (point and spot lights).
public vec3 Position;
// The light attenuation factors (X: constant; Y: linear; Z: quadratic; point and spot lights).
public vec3 AttenuationFactors;
// The spot fall-off parameters (X: fall-off angle in degrees; Y: fall-off exponent, spot lights).
public float FallOffExponent;
// The spot light cut-off
public vec2 CutOff;
}
// --------------------
#endregion
[In] vec3 normal;
[In] vec2 uv;
//[In] vec2 color;
//[In] vec2 tbn;
[In] vec3 position;
// [Out] vec4 fragment;
#region Lights
// Lights
[Uniform]
[ArraySize("MAX_NUMBER_OF_LIGHTS")]
LightState[] lights;
// Number of lights
[Uniform]
int lights_nb;
#endregion
#region Materials
// Matrial state
[Uniform]
MaterialState materialState;
#endregion
#region Camera informations
//[Uniform]
//[InterfaceBlock]
//[Layout(UniformLayout.Shared)]
//struct CameraInformations
//{
// // Position
// public vec3 c_position;
// // Rotation
// public vec3 c_rotation;
// // Near/Far planes distances
// public vec2 c_depthDistances;
//}
// Position
[Uniform]
vec3 c_position;
// Rotation
[Uniform]
vec3 c_rotation;
// Near/Far planes distances
[Uniform]
vec2 c_depthDistances;
#endregion
mat3 CotangentFrame(vec3 N, vec3 p, vec2 uv)
{
// récupère les vecteurs du triangle composant le pixel
vec3 dp1 = dFdx(p);
vec3 dp2 = dFdy(p);
vec2 duv1 = dFdx(uv);
vec2 duv2 = dFdy(uv);
// résout le système linéaire
vec3 dp2perp = cross(dp2, N);
vec3 dp1perp = cross(N, dp1);
vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
// construit une trame invariante à l'échelle
float invmax = inversesqrt(max(dot(T, T), dot(B, B)));
return new mat3(T * invmax, B * invmax, N);
}
vec3 PerturbNormal(vec3 N, vec3 V, vec2 texcoord)
{
// N, la normale interpolée et
// V, le vecteur vue (vertex dirigé vers l'œil)
vec3 map = texture(materialState.textureNormal, texcoord).rgb;
map = map * 255f / 127f - 128f / 127f;
mat3 TBN = CotangentFrame(N, -V, texcoord);
return normalize(TBN * map);
}
vec4 CalcLightInternal(LightState light, vec3 direction, vec3 normal)
{
vec4 mat = (materialState.hasColorAmbient ? materialState.colorAmbient : new vec4(1));
vec4 AmbientColor = new vec4(light.AmbientColor.rgb * mat.rgb, light.AmbientColor.a * mat.a);
vec4 DiffuseColor = new vec4(0, 0, 0, 0);
vec4 SpecularColor = new vec4(0, 0, 0, 0);
//if (materialState.hasColorDiffuse)
//{
float diffuseFactor = max(0.0f, dot(normal, -direction));
if (diffuseFactor > 0)
{
DiffuseColor = new vec4(light.DiffuseColor.rgb * materialState.colorDiffuse.rgb * diffuseFactor, light.DiffuseColor.a * materialState.colorDiffuse.a);
//if (materialState.hasColorSpecular)
//{
vec3 vertexToEye = normalize(c_position - position);
vec3 lv = -direction + vertexToEye;
vec3 halfway = lv / length(lv);
vec3 PN = PerturbNormal(normalize(normal), -vertexToEye, uv);
//vec3 lightReflect = normalize(reflect(direction, normal));
float specularFactor = max(0.0f, dot(PN, halfway));
if (specularFactor > 0)
{
specularFactor = pow(specularFactor, materialState.shininess);
SpecularColor = new vec4(light.SpecularColor.rgb * materialState.colorSpecular.rgb * materialState.shininessStrength * specularFactor, light.SpecularColor.a * materialState.colorSpecular.a);
}
//}
}
//}
vec4 color = (AmbientColor + DiffuseColor + SpecularColor);
return new vec4(color.rgb * light.Intensity, color.a);
}
vec4 CalcDirectionalLight(LightState light, vec3 Normal)
{
return CalcLightInternal(light, light.Direction, Normal);
}
vec4 CalcPointLight(LightState light, vec3 Normal)
{
vec3 LightDirection = position - light.Position;
float Distance = length(LightDirection);
LightDirection = normalize(LightDirection);
vec4 Color = CalcLightInternal(light, LightDirection, Normal);
float Attenuation = light.AttenuationFactors.x +
light.AttenuationFactors.y * Distance +
light.AttenuationFactors.z * Distance * Distance;
return Color / Attenuation;
}
vec4 CalcSpotLight(LightState light, vec3 Normal)
{
vec3 LightToPixel = normalize(position - light.Position);
float SpotFactor = max(0.0f, dot(LightToPixel, normalize(light.Direction)));
if (SpotFactor > light.CutOff.x)
{
float spotValue = smoothstep(light.CutOff.x, light.CutOff.y, SpotFactor);
float spotAttenuation = pow(spotValue, light.FallOffExponent);
vec4 Color = CalcPointLight(light, Normal);
return Color * spotAttenuation;//(1.0f - (1.0f - SpotFactor) * 1.0f / (1.0f - light.CutOff.x));
}
else
{
return new vec4(0, 0, 0, 0);
}
}
void main()
{
vec3 _normal = normalize(normal);
vec4 _totalLight = new vec4(0);
for (int i = 0; i < lights_nb; i++)
{
// If it is a spot light
if (lights[i].Type == 1)
{
_totalLight += CalcSpotLight(lights[i], _normal);
}
// If it is a directional light
if (lights[i].Type == 2)
{
_totalLight += CalcDirectionalLight(lights[i], _normal);
}
// If it is a point light
if (lights[i].Type == 3)
{
_totalLight += CalcPointLight(lights[i], _normal);
}
}
// Diffuse Texture Light Intensity
if (materialState.hasTextureDiffuse)
{
gl_FragColor = texture(materialState.textureDiffuse, uv) * _totalLight;
}
else
{
gl_FragColor = _totalLight;
}
//float Ip = 1 / length(ld);
//vec3 H = normalize(ld + viewport_vector);
//// Ambient Light Intensity
//vec4 ambientColorIntensity = colorAmbient; // Ka * Ia
//// Diffuse Light Intensity
//vec4 diffuseColorIntensity = colorDiffuse * Ip * max(0, dot(normalize(normal), normalize(ld))); // Kd * Ip * (N.L)
//diffuseColorIntensity = clamp(diffuseColorIntensity, 0.0f, 1.0f);
//// Specular Light Intensity
//vec4 specularColorIntensity = colorSpecular * Ip * pow(max(0, dot(normalize(normal), H)), shininess); // Ks * Ip * (R.V)^n
//specularColorIntensity = clamp(specularColorIntensity, 0.0f, 1.0f);
//// Edge detection
////Black color if dot product is smaller than 0.3
////else keep the same colors
////float edgeDetection = (dot(normalize(viewport_vector), normalize(normal)) > 0.3f) ? 1 : 0;
////vec4 color = new vec4(edgeDetection * (ambientColorIntensity.rgb + diffuseColorIntensity.rgb + specularColorIntensity.rgb + diffuseTextureIntensity.rgb), opacity * (ambientColorIntensity.a + diffuseColorIntensity.a + specularColorIntensity.a + diffuseTextureIntensity.a));
////float intensity = dot(normalize(ld), normalize(normal));
////if (intensity > 0.95f)
//// color = new vec4(color.rgb * 1.00f, color.a);
////else if (intensity < 0.95f && intensity > 0.5f)
//// color = new vec4(color.rgb * 0.95f, color.a);
////else if (intensity < 0.5f && intensity > 0.25f)
//// color = new vec4(color.rgb * 0.5f, color.a);
////else if (intensity < 0.25f && intensity > 0.0f)
//// color = new vec4(color.rgb * 0.25f, color.a);
////else
//// color = new vec4(color.rgb * 0.1f, color.a);
//gl_FragColor = diffuseColorIntensity * new vec4(ambientColorIntensity.rgb + diffuseColorIntensity.rgb + specularColorIntensity.rgb, opacity * min(1.0f, ambientColorIntensity.a + diffuseColorIntensity.a + specularColorIntensity.a));
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using LeanBatchLauncher.Util;
namespace LeanBatchLauncher.Launcher
{
/// <summary>
/// Contains configuration we want to pass each batched instance of the backtest.
/// </summary>
[Serializable]
public class Configuration : MarshalByRefObject
{
/// <summary>
/// Initialises a new instance of the <see cref="Configuration"/> class.
/// </summary>
public Configuration()
{
ParameterRanges = new Dictionary<string, IEnumerable<double>>();
//Dates = new List<DateTime>();
}
/// <summary>
/// Generates and populates Ranges from all provided Parameters.
/// </summary>
/// <returns>A copy of itself to facilitate chaining.</returns>
public Configuration PopulateParameterRanges()
{
// Loop through all Parameters, adding either a normal stepped range or a product range
foreach ( KeyValuePair<string, Parameter> entry in Parameters ) {
if ( entry.Value.Step != null )
ParameterRanges.Add( entry.Key, EnumerableUtils.SteppedRange( entry.Value.Start, entry.Value.End, (double)entry.Value.Step ) );
else if ( entry.Value.Factor != null )
ParameterRanges.Add( entry.Key, EnumerableUtils.ProductRange( entry.Value.Start, entry.Value.End, (double)entry.Value.Factor ) );
}
return this;
}
/// <summary>
/// Generates all possible combinations of all parameter ranges provided, recursively.
/// <param name="args">The parameter ranges provided as input.</param>
/// <param name="feedDown">The dictionary of parameters (string+double) to feed down the recursion.</param>
/// <param name="nextKvp">The next key-value-pair to be added to the feed down dictioanry - defaults to an empty one.</param>
/// <returns>Yields one combination of the input parameters provided.</returns>
public IEnumerable<Dictionary<string, double>> GenerateParameterCombinations(
Dictionary<string, IEnumerable<double>> args,
Dictionary<string, double> feedDown,
KeyValuePair<string, double> nextKvp = new KeyValuePair<string, double>()
)
{
// Check for null inputs
if ( args == null || args.Count == 0 )
yield break;
// Add the given key-value pair to the feed down dictionary (if it's not the first run)
if ( nextKvp.Key != null ) {
// If we don't have the key already, we add it
if ( !feedDown.ContainsKey( nextKvp.Key ) )
feedDown.Add( nextKvp.Key, 0.0 );
// Update the value of this key
feedDown[nextKvp.Key] = nextKvp.Value;
}
// Check for last argument - if it is, yield return a complete feed
if ( args.Count == 1 ) {
// Get the name of the parameter we've got left
string lastKey = args.Keys.LastOrDefault();
// Loop over all the doubles in the last parameter range
foreach ( double lastValue in args.Values.LastOrDefault() ) {
var outDict = new Dictionary<string, double>();
// First we yield the existing values in the feed-down
foreach ( var entry in feedDown )
outDict.Add( entry.Key, entry.Value );
// Then we add the last new parameter
outDict.Add( lastKey, lastValue );
// Then we yield the last new parameter
yield return outDict;
}
} else {
// Get the (random) key we will iterate over next
string newKey = args.Keys.FirstOrDefault();
// Iterate over the enumerable in this key
foreach ( double newValue in args[newKey] ) {
// Create a new list of arguments with the key in question removed
var newArgs = new Dictionary<string, IEnumerable<double>>();
foreach ( var kvp in args )
newArgs.Add( kvp.Key, kvp.Value );
newArgs.Remove( newKey );
// Generate new kvp to send into the recursion
var newKvp = new KeyValuePair<string, double>( newKey, newValue );
// Recurse
foreach ( var item in GenerateParameterCombinations( newArgs, feedDown, newKvp ) )
yield return item;
}
}
}
/// <summary>
/// Generate Dates from the provided StartDate and Duration.
/// </summary>
/// <returns>A copy of itself to faciliate chaining.</returns>
/*public Configuration GenerateDates()
{
DateTime date = DateTime.Parse( StartDate );
// Loop through the range {StartDate, StartDate + Duration, StartDate + 2*Duration, ..., Today}
// Ensure we get at least the start date in there even if duration is huge
do {
Dates.Add( date );
date = date.AddMonths( Duration );
} while ( date.AddMonths( Duration ) <= DateTime.Now );
return this;
}*/
/// <summary>
/// Gets or sets the path to the folder containing the QuantConnect library.
/// </summary>
public string LibraryPath
{
get; set;
}
/// <summary>
/// Gets or sets Job User ID for the QC data API.
/// </summary>
public string ApiJobUserId
{
get; set;
}
/// <summary>
/// Gets or sets Access Token for the QC data API.
/// </summary>
public string ApiAccessToken
{
get; set;
}
/// <summary>
/// Gets or sets number of backtests to run in parallel.
/// </summary>
public int ParallelProcesses
{
get; set;
}
/// <summary>
/// Gets or sets the starting date of the backtest batch.
/// </summary>
public DateTime StartDate
{
get; set;
}
/// <summary>
/// Gets or sets the ending date of the backtest batch
/// </summary>
/// <remarks>The range {StartDate, Today} will be chopped up in x slices, each of length Duration.</remarks>
public DateTime EndDate
{
get; set;
}
/// <summary>
/// Gets or sets number of months to run each backtest for.
/// </summary>
/// <remarks>The range {StartDate, Today} will be chopped up in x slices, each of length Duration.</remarks>
/*public int Duration
{
get; set;
}*/
/// <summary>
/// Gets or sets the alpha models (as `Names`) to run the algorithm over.
/// </summary>
public string[] AlphaModelNames
{
get; set;
}
/// <summary>
/// Gets or sets minute resolutions to run the algorithm over.
/// </summary>
public int[] MinuteResolutions
{
get; set;
}
/// <summary>
/// Gets or sets list of symbols to run the backtests on.
/// </summary>
public string[] Symbols
{
get; set;
}
/// <summary>
/// Gets or sets any custom parameters intended to be looped over.
/// </summary>
public Dictionary<string, Parameter> Parameters
{
get; set;
}
/// <summary>
/// Represents a single Parameter intended to be looped over.
/// </summary>
[Serializable]
public class Parameter
{
public double Start;
public double End;
public double? Step;
public double? Factor;
private double _current = 0.0;
public double Current
{
get {
if ( _current > 0.0 )
return _current;
else
return Start;
}
set {
_current = value;
}
}
}
/// <summary>
/// Gets a dictionary of all ParameterRanges generated, indexed by name of parameter.
/// </summary>
public Dictionary<string, IEnumerable<double>> ParameterRanges
{
get;
}
/// <summary>
/// Gets a list of all starting dates to be used for backtests.
/// </summary>
/*public List<DateTime> Dates
{
get;
}*/
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TicketShopProject.Data.Interfaces;
using TicketShopProject.Data.Models;
namespace TicketShopProject.Data.Mocks
{
public class MockTicketRepository : ITicketRepository
{
//maybe the tickets problem
private readonly ICategoryRepository _categoryRepository = new MockCategoryRepository();
public IEnumerable<Ticket> Tickets
{
get
{
return new List<Ticket>
{
new Ticket {
Name = "Michael Jackson Concert",
Price = 200.95M, ShortDescription = "Michael Joseph Jackson (August 29, 1958 – June 25, 2009)",
LongDescription = " The eighth child of the Jackson family, Michael made his professional debut in 1964 with his elder brothers Jackie, Tito, Jermaine, and Marlon as a member of the Jackson 5. He began his solo career in 1971 while at Motown Records. In the early 1980s, Jackson became a dominant figure in popular music. His music videos, including those of from his 1982 album Thriller, are credited with breaking racial barriers and transforming the medium into an art form and promotional tool. The popularity of these videos helped bring the television channel MTV to fame. Jackson's 1987 album Bad spawned the U.S. Billboard Hot 100 number-one singles I Just Can't Stop Loving You, Ba dThe Way You Make Me Feel Man in the Mirror , and Dirty Diana, becoming the first album to have five number-one singles in the nation. He continued to innovate with videos such as and throughout the 1990s, and forged a reputation as a touring solo artist.",
Category = _categoryRepository.Categories.First(),
ImageUrl = "http://imgh.us/beerL_2.jpg",
InStock = true,
IsPreferredTicket= true,
ImageThumbnailUrl = "http://imgh.us/beerS_1.jpeg"
},
new Ticket {
Name = "Madona Concert",
Price = 12.95M, ShortDescription = " Madona is an american singer.",
LongDescription = " The eighth child of the Jackson family, Michael made his professional debut in 1964 with his elder brothers Jackie, Tito, Jermaine, and Marlon as a member of the Jackson 5. He began his solo career in 1971 while at Motown Records. In the early 1980s, Jackson became a dominant figure in popular music. His music videos, including those of from his 1982 album Thriller, are credited with breaking racial barriers and transforming the medium into an art form and promotional tool. The popularity of these videos helped bring the television channel MTV to fame. Jackson's 1987 album Bad spawned the U.S. Billboard Hot 100 number-one singles I Just Can't Stop Loving You, Ba dThe Way You Make Me Feel Man in the Mirror , and Dirty Diana, becoming the first album to have five number-one singles in the nation. He continued to innovate with videos such as and throughout the 1990s, and forged a reputation as a touring solo artist.",
Category = _categoryRepository.Categories.First(),
ImageUrl = "http://imgh.us/rumCokeL.jpg",
InStock = true,
IsPreferredTicket = false,
ImageThumbnailUrl = "http://imgh.us/rumAndCokeS.jpg"
},
new Ticket {
Name = "2 Pac Concert ",
Price = 12.95M, ShortDescription = " 2 pac is an american rapper ",
LongDescription = " The eighth child of the Jackson family, Michael made his professional debut in 1964 with his elder brothers Jackie, Tito, Jermaine, and Marlon as a member of the Jackson 5. He began his solo career in 1971 while at Motown Records. In the early 1980s, Jackson became a dominant figure in popular music. His music videos, including those of from his 1982 album Thriller, are credited with breaking racial barriers and transforming the medium into an art form and promotional tool. The popularity of these videos helped bring the television channel MTV to fame. Jackson's 1987 album Bad spawned the U.S. Billboard Hot 100 number-one singles I Just Can't Stop Loving You, Ba dThe Way You Make Me Feel Man in the Mirror , and Dirty Diana, becoming the first album to have five number-one singles in the nation. He continued to innovate with videos such as and throughout the 1990s, and forged a reputation as a touring solo artist.",
Category = _categoryRepository.Categories.First(),
ImageUrl = "http://imgh.us/tequilaL.jpg",
InStock = true,
IsPreferredTicket = false,
ImageThumbnailUrl = "http://imgh.us/tequilaS.jpg"
},
new Ticket
{
Name = "50 Cent Concert",
Price = 12.95M,
ShortDescription = " 50 Cent is an american rapper",
LongDescription = " The eighth child of the Jackson family, Michael made his professional debut in 1964 with his elder brothers Jackie, Tito, Jermaine, and Marlon as a member of the Jackson 5. He began his solo career in 1971 while at Motown Records. In the early 1980s, Jackson became a dominant figure in popular music. His music videos, including those of from his 1982 album Thriller, are credited with breaking racial barriers and transforming the medium into an art form and promotional tool. The popularity of these videos helped bring the television channel MTV to fame. Jackson's 1987 album Bad spawned the U.S. Billboard Hot 100 number-one singles I Just Can't Stop Loving You, Ba dThe Way You Make Me Feel Man in the Mirror , and Dirty Diana, becoming the first album to have five number-one singles in the nation. He continued to innovate with videos such as and throughout the 1990s, and forged a reputation as a touring solo artist.",
Category = _categoryRepository.Categories.Last(),
ImageUrl = "http://imgh.us/juiceL.jpg",
InStock = true,
IsPreferredTicket = false,
ImageThumbnailUrl = "http://imgh.us/juiceS.jpg"
}
};
}
}
public IEnumerable<Ticket> PreferredTickets { get; }
public Ticket GetTicketkById(int ticketId)
{
throw new NotImplementedException();
}
}
}
|
using UnityEngine;
using System.Collections;
public class Timer
{
private float timePassed;
private delegate void eventCallback();
public Timer(float timePassed)
{
this.timePassed = timePassed;
}
}
|
using UnityEngine;
using System.Collections;
[System.Serializable]
public class EnemyTickets {
public string m_name;
public int m_ticketCosts;
public GameObject m_spawnEnemy;
}
|
using UnityEngine;
using System.Collections;
using System;
public class Card : MonoBehaviour
{
public const float WIDTH = 3.28f;
public const float HEIGHT = 5.01f;
public SpriteRenderer[] signSprites;
public TextMesh[] textMesh;
private Sprite sign;
public Sprite slotsign;
private string textSign;
public Color textColor;
private int colorValue;
public int faceValue;
public int suitValue;
private Vector3 targetPosition;
public Sprite displaySprite;
public void SetPosition(Vector3 targetPosition) {
this.targetPosition = targetPosition;
}
public Vector3 GetPosition() {
return this.transform.position;
}
void Start ()
{
assigningPropertiesToCard ();
}
void Update ()
{
if (targetPosition != this.transform.position) {
// Do animation here
this.transform.position = targetPosition;
}
}
public void AssignSignName(Sprite sign)
{
UpdateSuit (sign);
}
public void AssignSign(Sprite signSprite,string textSign, Color textColor)
{
UpdateSuit (signSprite);
this.textSign = textSign;
this.textColor = textColor;
for (int i = 0; i < signSprites.Length; i++)
{
signSprites [i].sprite = sign;
}
for (int i = 0; i < textMesh.Length; i++)
{
textMesh [i].text = textSign;
textMesh [i].color = textColor;
}
}
public int getFaceValue()
{
return this.faceValue;
}
public int getColorValue()
{
return this.colorValue;
}
public int getSuitValue()
{
return this.suitValue;
}
void assigningPropertiesToCard()
{
Color redColor = Color.red;
Color blackColor = Color.black;
if (textColor == redColor) {
colorValue = 1;
} else if (textColor == blackColor) {
colorValue = 2;
}
if (textSign == "A") {
faceValue = 1;
}
if (textSign == "2") {
faceValue = 2;
}
if (textSign == "3") {
faceValue = 3;
}
if (textSign == "4") {
faceValue = 4;
}
if (textSign == "5") {
faceValue = 5;
}
if (textSign == "6") {
faceValue = 6;
}
if (textSign == "7") {
faceValue = 7;
}
if (textSign == "8") {
faceValue = 8;
}
if (textSign == "9") {
faceValue = 9;
}
if (textSign == "10") {
faceValue = 10;
}
if (textSign == "J") {
faceValue = 11;
}
if (textSign == "Q") {
faceValue = 12;
}
if (textSign == "K") {
faceValue = 13;
}
// fix suit values
}
public void Flip () {
this.transform.Rotate (Vector3.right * 180);
}
private void UpdateSuit(Sprite sign) {
this.sign = sign;
switch (sign.name) {
case "Club_Card":
suitValue = 1;
break;
case "Diamond_Card":
suitValue = 2;
break;
case "Spade_Card":
suitValue = 3;
break;
case "Heart_Card":
suitValue = 4;
break;
}
}
}
|
namespace RealEstate.Infrastructure
{
using System;
using System.Linq;
using System.Text;
using System.Threading;
using System.Text.RegularExpressions;
public static class StringExtension
{
#region Converter
private static string ConvertInternationalCharToASCII(char character)
{
string s = character.ToString().ToLowerInvariant();
if ("àåáâäãåąā".Contains(s))
return "a";
else if ("èéêëę".Contains(s))
return "e";
else if ("ìíîïı".Contains(s))
return "i";
else if ("òóôõöøőð".Contains(s))
return "o";
else if ("ùúûüŭů".Contains(s))
return "u";
else if ("çćčĉ".Contains(s))
return "c";
else if ("żźž".Contains(s))
return "z";
else if ("śşšŝ".Contains(s))
return "s";
else if ("ñń".Contains(s))
return "n";
else if ("ýÿ".Contains(s))
return "y";
else if ("ğĝ".Contains(s))
return "g";
else if (s == "ř")
return "r";
else if (s == "ł")
return "l";
else if (s == "đ")
return "d";
else if (s == "ß")
return "ss";
else if (s == "Þ")
return "th";
else if (s == "ĥ")
return "h";
else if (s == "ĵ")
return "j";
else
return string.Empty;
}
#endregion
public static bool IsNullOrEmpty(this string content)
=> string.IsNullOrEmpty(content);
public static string SubBetween(this string content, string leftContent, string rightContent)
=> content.SubBefore(rightContent).SubAfter(leftContent);
public static string SubBefore(this string conntent, string pattern)
{
int index = conntent.IndexOf(pattern);
return (index == -1) ? string.Empty : conntent.Substring(0, index);
}
public static string SubAfter(this string content, string pattern)
{
int start = content.LastIndexOf(pattern) + pattern.Length;
return start >= content.Length ? string.Empty : content.Substring(start).Trim();
}
public static string MaxLength(this string content, int length = 40)
=> string.IsNullOrEmpty(content) ? string.Empty :
content.Length > length ? $"{content.Substring(0, length - 3)}..." : content;
public static bool IsUri(this string uriName)
{
Uri uriResult;
return Uri.TryCreate(uriName, UriKind.Absolute, out uriResult)
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
}
public static string UTF8toASCII(this string utf8)
=> new Regex("\\p{IsCombiningDiacriticalMarks}+")
.Replace(utf8.Normalize(NormalizationForm.FormD), string.Empty)
.Replace('\u0111', 'd').Replace('\u0110', 'D');
public static string TitleCase(this string title)
=> Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(title);
public static string SingleSpace(this string input)
=> Regex.Replace(input, "\\s+", " ");
public static string RewriteUrl(this string url, int maxLength = 80, bool isConvertToASCII = true, bool isLower = true, params char[] except)
{
if (url == null)
return string.Empty;
url = url.Normalize(NormalizationForm.FormKD);
int length = url.Length;
int lengthBuilder = 0;
bool isHyphen = false;
StringBuilder builder = new StringBuilder(Math.Min(length, maxLength + 1));
char characters;
for (int i = 0; i < length; ++i)
{
characters = url[i];
if ((characters >= 'a' && characters <= 'z') || (characters >= '0' && characters <= '9'))
{
builder.Append(characters);
isHyphen = false;
}
else if (characters >= 'A' && characters <= 'Z')
{
builder.Append(isLower ? (char)(characters | 32) : characters);
isHyphen = false;
}
else if (!except.Contains(characters) && ((characters == ' ') || (characters == ',') || (characters == '.') || (characters == '/') ||
(characters == '\\') || (characters == '_') || (characters == '=')))
{
lengthBuilder = builder.Length;
if (lengthBuilder > 0)
if (!isHyphen)
{
builder.Append('-');
isHyphen = true;
}
}
else if (characters >= 128)
{
if (isConvertToASCII && !except.Contains(characters))
builder.Append(ConvertInternationalCharToASCII(characters));
else
builder.Append(characters);
isHyphen = false;
}
else if (except.Contains(characters))
builder.Append(characters);
if (i == maxLength)
break;
}
return isHyphen ? builder.ToString().Substring(0, builder.Length - 1) : builder.ToString();
}
}
} |
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Guitar.cs" company="">
//
// </copyright>
// <summary>
// The guitar.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace MusicShop.Models
{
using System;
using MusicShopManager.Interfaces;
/// <summary>
/// The guitar.
/// </summary>
internal abstract class Guitar : Instrument, IGuitar
{
/// <summary>
/// Initializes a new instance of the <see cref="Guitar"/> class.
/// </summary>
/// <param name="make">
/// The make.
/// </param>
/// <param name="model">
/// The model.
/// </param>
/// <param name="price">
/// The price.
/// </param>
/// <param name="color">
/// The color.
/// </param>
/// <param name="isElectronic">
/// The is electronic.
/// </param>
/// <param name="bodyWood">
/// The body wood.
/// </param>
/// <param name="fingerboardWood">
/// The fingerboard wood.
/// </param>
/// <param name="stringsNum">
/// The strings num.
/// </param>
/// <exception cref="ArgumentException">
/// </exception>
/// <exception cref="InvalidOperationException">
/// </exception>
public Guitar(
string make,
string model,
decimal price,
string color,
bool isElectronic,
string bodyWood,
string fingerboardWood,
int stringsNum)
: base(make, model, price, color, isElectronic)
{
if (string.IsNullOrEmpty(bodyWood))
{
throw new ArgumentException("The bodyWood is required.");
}
if (string.IsNullOrEmpty(fingerboardWood))
{
throw new ArgumentException("The fingerboardWood is required.");
}
if (stringsNum < 0 || stringsNum > 6)
{
throw new InvalidOperationException("The strings number must be positive and not more than six.");
}
this.BodyWood = bodyWood;
this.FingerboardWood = fingerboardWood;
this.NumberOfStrings = stringsNum;
}
/// <summary>
/// Gets the body wood.
/// </summary>
public string BodyWood { get; private set; }
/// <summary>
/// Gets the fingerboard wood.
/// </summary>
public string FingerboardWood { get; private set; }
/// <summary>
/// Gets the number of strings.
/// </summary>
public int NumberOfStrings { get; private set; }
}
} |
namespace ns9
{
using System;
internal class Exception0 : ApplicationException
{
public Exception0() : base("Data Error")
{
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class State<T>
{
public T owner;
public abstract void Enter();
public abstract void Execute();
public abstract void Exit();
}
|
using MessagePasser;
using Microsoft.Extensions.DependencyInjection;
using System.Collections;
using static MessagePasser.Delegates.Delegates;
namespace MessagePasser
{
public class EventAggregator
{
private static IServiceProvider _serviceProvider;
private ISubscriberManager _subscriberManager;
private IMessageManager _messageManager;
public EventAggregator()
{
SetUpServiceCollection();
_subscriberManager = _serviceProvider.GetService<ISubscriberManager>();
_messageManager = _serviceProvider.GetService<IMessageManager>();
}
public void SetUpServiceCollection()
{
_serviceProvider = ServiceBootstrapper.GetServiceProvider();
}
public bool SubscribeOnMainThread<T>(T subscriber)
{
return _subscriberManager.SubscribeOnMainThread(subscriber);
}
public bool SubscribeOnBackgroundThread<T>(T subscriber)
{
return _subscriberManager.SubscribeOnBackgroundThread(subscriber);
}
/// <summary>
/// Send a message using a specific type. This will call handle message on all classes that have subscribed with this type.
/// </summary>
/// <typeparam name="T">The type of message you want to subscribe to</typeparam>
/// <param name="message">The contents of your message that you want to publish</param>
/// <param name="callback">Callback if you want insight into the message being sent. Null by default.</param>
public void SendMessageOnBackgroundThread<T>(T message, CancellationToken token, OnMessageSent callback = null)
{
_messageManager.SendMessageOnBackgroundThread(message, token, callback);
}
public void SendMessageOnMainThread<T>(T message, CancellationToken token, OnMessageSent callback = null)
{
_messageManager.SendMessageOnMainThread(message, token, callback);
}
}
} |
using System;
using System.Collections.Generic;
namespace AorFramework.NodeGraph
{
public interface INodeController
{
NodeGUI nodeGUI { get; }
void setup(NodeGUI node);
bool isInit { get; }
string nodeDataToString();
void update(bool updateParentLoop = true);
}
}
|
// Accord Statistics Library
// The Accord.NET Framework
// http://accord-framework.net
//
// Copyright © César Souza, 2009-2015
// cesarsouza at gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
namespace Accord.Statistics.Analysis
{
using Accord.Collections;
using Accord.Math;
using Accord.Statistics.Distributions.Univariate;
using AForge;
using System;
using System.ComponentModel;
/// <summary>
/// Descriptive statistics analysis for circular data.
/// </summary>
///
///
/// <seealso cref="Statistics.Tools"/>
/// <seealso cref="DescriptiveAnalysis"/>
/// <seealso cref="DescriptiveMeasures"/>
///
[Serializable]
public class CircularDescriptiveAnalysis : IMultivariateAnalysis
{
private int samples;
private int variables;
private double[][] angles;
private double[] lengths;
private double[] sums;
private double[] sin;
private double[] cos;
private double[] means;
private double[] standardDeviations;
private double[] standardErrors;
private double[] variances;
private double[] medians;
private double[] modes;
private double[] kurtosis;
private double[] skewness;
private int[] distinct;
private double[] angularMeans;
private double[] angularMedians;
private string[] columnNames;
private DoubleRange[] ranges;
private DoubleRange[] quartiles;
private DoubleRange[] innerFences;
private DoubleRange[] outerFences;
DoubleRange[] confidences;
DoubleRange[] deviances;
private double[] concentration;
private double[,] sourceMatrix;
private double[][] sourceArray;
private double[] sourceRow;
private CircularDescriptiveMeasureCollection measuresCollection;
private bool useStrictRanges = true;
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
/// <param name="columnName">The names for the analyzed variable.</param>
/// <param name="inPlace">
/// Whether the analysis should conserve memory by doing
/// operations over the original <paramref name="data"/> array.
/// </param>
///
public CircularDescriptiveAnalysis(double[] data, double length, String columnName, bool inPlace = false)
{
if (data == null)
throw new ArgumentNullException("data");
init(data, null, null, new[] { length }, new[] { columnName }, inPlace);
}
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
/// <param name="inPlace">
/// Whether the analysis should conserve memory by doing
/// operations over the original <paramref name="data"/> array.
/// </param>
///
public CircularDescriptiveAnalysis(double[] data, double length, bool inPlace = false)
{
if (data == null)
throw new ArgumentNullException("data");
init(data, null, null, new[] { length }, null, inPlace);
}
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
///
public CircularDescriptiveAnalysis(double[,] data, double[] length)
{
if (data == null)
throw new ArgumentNullException("data");
if (length == null)
throw new ArgumentNullException("length");
init(null, data, null, length, null);
}
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
/// <param name="columnNames">Names for the analyzed variables.</param>
///
public CircularDescriptiveAnalysis(double[,] data, double[] length, string[] columnNames)
{
if (data == null)
throw new ArgumentNullException("data");
if (length == null)
throw new ArgumentNullException("length");
if (columnNames == null)
throw new ArgumentNullException("columnNames");
init(null, data, null, length, columnNames);
}
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
///
public CircularDescriptiveAnalysis(double[][] data, double[] length)
{
// Initial argument checking
if (data == null)
throw new ArgumentNullException("data");
if (length == null)
throw new ArgumentNullException("length");
init(null, null, data, length, null);
}
/// <summary>
/// Constructs the Circular Descriptive Analysis.
/// </summary>
///
/// <param name="data">The source data to perform analysis.</param>
/// <param name="length">The length of each circular variable (i.e. 24 for hours).</param>
/// <param name="columnNames">Names for the analyzed variables.</param>
///
public CircularDescriptiveAnalysis(double[][] data, double[] length, string[] columnNames)
{
// Initial argument checking
if (data == null)
throw new ArgumentNullException("data");
if (length == null)
throw new ArgumentNullException("length");
if (columnNames == null)
throw new ArgumentNullException("columnNames");
init(null, null, data, length, columnNames);
}
private void init(double[] row, double[,] matrix, double[][] array,
double[] length, string[] columnNames, bool inPlace = false)
{
this.columnNames = columnNames;
this.sourceArray = array;
this.sourceMatrix = matrix;
this.sourceRow = row;
this.lengths = length;
if (matrix != null)
{
this.samples = matrix.GetLength(0);
this.variables = matrix.GetLength(1);
if (lengths.Length != variables)
throw new DimensionMismatchException("length");
this.angles = new double[variables][];
for (int i = 0; i < angles.Length; i++)
{
angles[i] = new double[samples];
for (int j = 0; j < angles[i].Length; j++)
angles[i][j] = Circular.ToRadians(matrix[j, i], length[i]);
}
}
else if (array != null)
{
this.samples = array.Length;
this.variables = array[0].Length;
this.angles = new double[variables][];
if (lengths.Length != variables)
throw new DimensionMismatchException("length");
for (int i = 0; i < angles.Length; i++)
{
angles[i] = new double[samples];
for (int j = 0; j < angles[i].Length; j++)
angles[i][j] = Circular.ToRadians(array[j][i], length[i]);
}
}
else
{
this.samples = sourceRow.Length;
this.variables = 1;
this.angles = new double[variables][];
if (lengths.Length != variables)
throw new DimensionMismatchException("length");
angles[0] = inPlace ? sourceRow : new double[samples];
for (int j = 0; j < angles[0].Length; j++)
angles[0][j] = Circular.ToRadians(sourceRow[j], length[0]);
}
// Create object-oriented structure to access data
var measures = new CircularDescriptiveMeasures[variables];
for (int i = 0; i < measures.Length; i++)
measures[i] = new CircularDescriptiveMeasures(this, i);
this.measuresCollection = new CircularDescriptiveMeasureCollection(measures);
}
/// <summary>
/// Computes the analysis using given source data and parameters.
/// </summary>
///
public void Compute()
{
// Clear analysis
reset();
this.sums = Sums;
this.means = Means;
this.standardDeviations = StandardDeviations;
this.ranges = Ranges;
this.medians = Medians;
this.variances = Variances;
this.distinct = Distinct;
this.quartiles = Quartiles;
this.innerFences = InnerFences;
this.outerFences = OuterFences;
this.modes = Modes;
this.cos = CosineSum;
this.sin = SineSum;
this.skewness = Skewness;
this.kurtosis = Kurtosis;
this.concentration = Concentration;
this.deviances = Deviance;
this.confidences = Confidence;
}
private void reset()
{
this.sums = null;
this.means = null;
this.standardDeviations = null;
this.ranges = null;
this.medians = null;
this.variances = null;
this.standardErrors = null;
this.distinct = null;
this.modes = null;
this.deviances = null;
this.confidences = null;
this.quartiles = null;
this.innerFences = null;
this.outerFences = null;
this.sin = null;
this.cos = null;
this.skewness = null;
this.kurtosis = null;
this.concentration = null;
this.standardErrors = null;
}
/// <summary>
/// Gets or sets whether all reported statistics should respect the circular
/// interval. For example, setting this property to <c>false</c> would allow
/// the <see cref="Confidence"/>, <see cref="Deviance"/>, <see cref="InnerFences"/>
/// and <see cref="OuterFences"/> properties report minimum and maximum values
/// outside the variable's allowed circular range. Default is <c>true</c>.
/// </summary>
///
public bool UseStrictRanges
{
get { return useStrictRanges; }
set
{
if (useStrictRanges != value)
{
useStrictRanges = value;
innerFences = null;
outerFences = null;
deviances = null;
confidences = null;
}
}
}
/// <summary>
/// Gets the source matrix from which the analysis was run.
/// </summary>
///
public double[,] Source
{
get
{
if (this.sourceMatrix == null)
{
if (this.sourceArray == null)
{
sourceMatrix = sourceRow.ToMatrix(asColumnVector: true);
}
else
{
sourceMatrix = sourceArray.ToMatrix();
}
}
return sourceMatrix;
}
}
/// <summary>
/// Gets the source matrix from which the analysis was run.
/// </summary>
///
public double[][] Array
{
get
{
if (this.sourceArray == null)
{
if (this.sourceRow == null)
{
sourceArray = sourceMatrix.ToArray();
}
else
{
sourceArray = sourceRow.ToArray(asColumnVector: true);
}
}
return sourceArray;
}
}
/// <summary>
/// Gets the source matrix from which the analysis was run.
/// </summary>
///
public double[][] Angles
{
get { return this.angles; }
}
/// <summary>
/// Gets the column names from the variables in the data.
/// </summary>
///
public String[] ColumnNames
{
get
{
if (columnNames == null)
{
columnNames = new string[variables];
for (int i = 0; i < columnNames.Length; i++)
columnNames[i] = "Column " + i;
}
return this.columnNames;
}
}
/// <summary>
/// Gets a vector containing the length of
/// the circular domain for each data column.
/// </summary>
///
public double[] Lengths
{
get { return lengths; }
}
/// <summary>
/// Gets a vector containing the Mean of each data column.
/// </summary>
///
public double[] Means
{
get
{
if (means == null)
{
double[] c = CosineSum, s = SineSum;
means = new double[variables];
angularMeans = new double[variables];
for (int i = 0; i < means.Length; i++)
{
angularMeans[i] = Circular.Mean(samples, c[i], s[i]);
means[i] = Circular.ToCircular(angularMeans[i], lengths[i]);
}
}
return means;
}
}
/// <summary>
/// Gets a vector containing the Mode of each data column.
/// </summary>
///
public double[] Modes
{
get
{
if (modes == null)
{
if (sourceMatrix != null)
modes = sourceMatrix.Mode();
else if (sourceArray != null)
modes = sourceArray.Mode();
else modes = new[] { sourceRow.Mode() };
}
return modes;
}
}
/// <summary>
/// Gets a vector containing the Standard Deviation of each data column.
/// </summary>
///
public double[] StandardDeviations
{
get
{
if (standardDeviations == null)
{
double[] c = CosineSum, s = SineSum;
standardDeviations = new double[variables];
for (int i = 0; i < standardDeviations.Length; i++)
{
standardDeviations[i] = Circular.StandardDeviation(samples, c[i], s[i])
* lengths[i] / (2 * Math.PI);
}
}
return standardDeviations;
}
}
/// <summary>
/// Gets a vector containing the Standard Error of the Mean of each data column.
/// </summary>
///
public double[] StandardErrors
{
get
{
if (standardErrors == null)
{
double[] c = CosineSum, s = SineSum;
standardErrors = new double[variables];
for (int i = 0; i < standardErrors.Length; i++)
{
standardErrors[i] = Circular.StandardError(samples, c[i], s[i], 0.05)
* lengths[i] / (2 * Math.PI);
}
}
return standardErrors;
}
}
/// <summary>
/// Gets the 95% confidence intervals for the <see cref="Means"/>.
/// </summary>
///
public DoubleRange[] Confidence
{
get
{
if (confidences == null)
{
confidences = new DoubleRange[variables];
for (int i = 0; i < confidences.Length; i++)
confidences[i] = GetConfidenceInterval(i);
}
return confidences;
}
}
/// <summary>
/// Gets the 95% deviance intervals for the <see cref="Means"/>.
/// </summary>
///
/// <remarks>
/// A deviance interval uses the standard deviation rather
/// than the standard error to compute the range interval
/// for a variable.
/// </remarks>
///
public DoubleRange[] Deviance
{
get
{
if (deviances == null)
{
deviances = new DoubleRange[variables];
for (int i = 0; i < deviances.Length; i++)
deviances[i] = GetDevianceInterval(i);
}
return deviances;
}
}
/// <summary>
/// Gets a vector containing the Median of each data column.
/// </summary>
///
public double[] Medians
{
get
{
if (medians == null)
computeMedians();
return medians;
}
}
/// <summary>
/// Gets a vector containing the Variance of each data column.
/// </summary>
///
public double[] Variances
{
get
{
if (variances == null)
{
double[] c = CosineSum, s = SineSum;
variances = new double[variables];
for (int i = 0; i < variances.Length; i++)
{
double scale = lengths[i] / (2 * Math.PI);
variances[i] = Circular.Variance(samples, c[i], s[i]) * scale * scale;
}
}
return variances;
}
}
/// <summary>
/// Gets a vector containing the number of distinct elements for each data column.
/// </summary>
///
public int[] Distinct
{
get
{
if (distinct == null)
{
if (sourceMatrix != null)
distinct = sourceMatrix.DistinctCount();
else if (sourceArray != null)
distinct = sourceArray.DistinctCount();
else
distinct = new[] { sourceRow.DistinctCount() };
}
return distinct;
}
}
/// <summary>
/// Gets an array containing the Ranges of each data column.
/// </summary>
///
public DoubleRange[] Ranges
{
get
{
if (ranges == null)
{
this.ranges = new DoubleRange[variables];
for (int i = 0; i < ranges.Length; i++)
ranges[i] = new DoubleRange(0, lengths[i]);
}
return ranges;
}
}
/// <summary>
/// Gets an array containing the interquartile range of each data column.
/// </summary>
///
public DoubleRange[] Quartiles
{
get
{
if (quartiles == null)
{
if (medians == null)
computeMedians();
quartiles = new DoubleRange[variables];
for (int i = 0; i < variances.Length; i++)
{
Circular.Quartiles(angles[i], out quartiles[i], angularMedians[i], wrap: useStrictRanges);
quartiles[i].Min = Circular.ToCircular(quartiles[i].Min, lengths[i], useStrictRanges);
quartiles[i].Max = Circular.ToCircular(quartiles[i].Max, lengths[i], useStrictRanges);
}
}
return quartiles;
}
}
/// <summary>
/// Gets an array containing the inner fences of each data column.
/// </summary>
///
public DoubleRange[] InnerFences
{
get
{
if (innerFences == null)
{
DoubleRange[] Q = Quartiles;
innerFences = new DoubleRange[variables];
for (int i = 0; i < innerFences.Length; i++)
{
innerFences[i] = Statistics.Tools.InnerFence(Q[i]);
if (useStrictRanges)
{
innerFences[i].Min = Tools.Mod(innerFences[i].Min, lengths[i]);
innerFences[i].Max = Tools.Mod(innerFences[i].Max, lengths[i]);
}
}
}
return innerFences;
}
}
/// <summary>
/// Gets an array containing the outer fences of each data column.
/// </summary>
///
public DoubleRange[] OuterFences
{
get
{
if (outerFences == null)
{
DoubleRange[] Q = Quartiles;
outerFences = new DoubleRange[variables];
for (int i = 0; i < outerFences.Length; i++)
{
outerFences[i] = Statistics.Tools.OuterFence(Q[i]);
if (useStrictRanges)
{
outerFences[i].Min = Tools.Mod(outerFences[i].Min, lengths[i]);
outerFences[i].Max = Tools.Mod(outerFences[i].Max, lengths[i]);
}
}
}
return outerFences;
}
}
/// <summary>
/// Gets an array containing the sum of each data column. If
/// the analysis has been computed in place, this will contain
/// the sum of the transformed angle values instead.
/// </summary>
///
public double[] Sums
{
get
{
if (sums == null)
{
if (sourceMatrix != null)
this.sums = Accord.Math.Matrix.Sum(sourceMatrix);
else if (sourceArray != null)
this.sums = Accord.Math.Matrix.Sum(sourceArray);
else this.sums = new[] { Accord.Math.Matrix.Sum(sourceRow) };
}
return sums;
}
}
/// <summary>
/// Gets an array containing the sum of cosines for each data column.
/// </summary>
///
public double[] CosineSum
{
get
{
if (cos == null)
computeSums();
return cos;
}
}
/// <summary>
/// Gets an array containing the sum of sines for each data column.
/// </summary>
///
public double[] SineSum
{
get
{
if (sin == null)
computeSums();
return sin;
}
}
/// <summary>
/// Gets an array containing the circular concentration for each data column.
/// </summary>
///
public double[] Concentration
{
get
{
if (concentration == null)
{
var m = Means;
concentration = new double[variables];
for (int i = 0; i < variances.Length; i++)
concentration[i] = Circular.Concentration(angles[i], m[i]);
}
return variances;
}
}
/// <summary>
/// Gets an array containing the skewness for of each data column.
/// </summary>
///
public double[] Skewness
{
get
{
if (skewness == null)
{
skewness = new double[variables];
for (int i = 0; i < skewness.Length; i++)
{
skewness[i] = Circular.Skewness(angles[i])
* lengths[i] / (2 * Math.PI);
}
}
return skewness;
}
}
/// <summary>
/// Gets an array containing the kurtosis for of each data column.
/// </summary>
///
public double[] Kurtosis
{
get
{
if (kurtosis == null)
{
kurtosis = new double[variables];
for (int i = 0; i < kurtosis.Length; i++)
{
kurtosis[i] = Circular.Kurtosis(angles[i])
* lengths[i] / (2 * Math.PI);
}
}
return kurtosis;
}
}
/// <summary>
/// Gets the number of samples (or observations) in the data.
/// </summary>
///
public int Samples
{
get { return samples; }
}
/// <summary>
/// Gets the number of variables (or features) in the data.
/// </summary>
///
public int Variables
{
get { return variables; }
}
/// <summary>
/// Gets a collection of DescriptiveMeasures objects that can be bound to a DataGridView.
/// </summary>
///
public CircularDescriptiveMeasureCollection Measures
{
get { return measuresCollection; }
}
/// <summary>
/// Gets a confidence interval for the <see cref="Means"/>
/// within the given confidence level percentage.
/// </summary>
///
/// <param name="percent">The confidence level. Default is 0.95.</param>
/// <param name="index">The index of the data column whose confidence
/// interval should be calculated.</param>
///
/// <returns>A confidence interval for the estimated value.</returns>
///
public DoubleRange GetConfidenceInterval(int index, double percent = 0.95)
{
double[] c = CosineSum, s = SineSum;
double t = Circular.StandardError(samples, c[index], s[index], 1 - percent);
t *= lengths[index] / (2 * Math.PI);
double min = Means[index] - t;
double max = Means[index] + t;
if (useStrictRanges)
{
min = Tools.Mod(min, lengths[index]);
max = Tools.Mod(max, lengths[index]);
}
return new DoubleRange(min, max);
}
/// <summary>
/// Gets a deviance interval for the <see cref="Means"/>
/// within the given confidence level percentage (i.e. uses
/// the standard deviation rather than the standard error to
/// compute the range interval for the variable).
/// </summary>
///
/// <param name="percent">The confidence level. Default is 0.95.</param>
/// <param name="index">The index of the data column whose confidence
/// interval should be calculated.</param>
///
/// <returns>A confidence interval for the estimated value.</returns>
///
public DoubleRange GetDevianceInterval(int index, double percent = 0.95)
{
double z = NormalDistribution.Standard
.InverseDistributionFunction(0.5 + percent / 2.0);
double min = Means[index] - z * StandardDeviations[index];
double max = Means[index] + z * StandardDeviations[index];
if (useStrictRanges)
{
min = Tools.Mod(min, lengths[index]);
max = Tools.Mod(max, lengths[index]);
}
return new DoubleRange(min, max);
}
private void computeSums()
{
cos = new double[variables];
sin = new double[variables];
for (int i = 0; i < angles.Length; i++)
Circular.Sum(angles[i], out cos[i], out sin[i]);
}
private void computeMedians()
{
medians = new double[variables];
angularMedians = new double[variables];
for (int i = 0; i < medians.Length; i++)
{
angularMedians[i] = Circular.Median(angles[i]);
medians[i] = Circular.ToCircular(angularMedians[i], lengths[i]);
}
}
}
/// <summary>
/// Circular descriptive measures for a variable.
/// </summary>
///
/// <seealso cref="CircularDescriptiveAnalysis"/>
///
[Serializable]
public class CircularDescriptiveMeasures : IDescriptiveMeasures
{
private CircularDescriptiveAnalysis analysis;
private int index;
internal CircularDescriptiveMeasures(CircularDescriptiveAnalysis analysis, int index)
{
this.analysis = analysis;
this.index = index;
}
/// <summary>
/// Gets the circular analysis
/// that originated this measure.
/// </summary>
///
[Browsable(false)]
public CircularDescriptiveAnalysis Analysis
{
get { return analysis; }
}
/// <summary>
/// Gets the variable's index.
/// </summary>
///
public int Index
{
get { return index; }
}
/// <summary>
/// Gets the variable's name
/// </summary>
///
public string Name
{
get { return analysis.ColumnNames[index]; }
}
/// <summary>
/// Gets the variable's total sum.
/// </summary>
///
public double Sum
{
get { return analysis.Sums[index]; }
}
/// <summary>
/// Gets the variable's mean.
/// </summary>
///
public double Mean
{
get { return analysis.Means[index]; }
}
/// <summary>
/// Gets the variable's standard deviation.
/// </summary>
///
public double StandardDeviation
{
get { return analysis.StandardDeviations[index]; }
}
/// <summary>
/// Gets the variable's median.
/// </summary>
///
public double Median
{
get { return analysis.Medians[index]; }
}
/// <summary>
/// Gets the variable's mode.
/// </summary>
///
public double Mode
{
get { return analysis.Modes[index]; }
}
/// <summary>
/// Gets the variable's outer fences range.
/// </summary>
///
public DoubleRange OuterFence
{
get { return analysis.OuterFences[index]; }
}
/// <summary>
/// Gets the variable's inner fence range.
/// </summary>
///
public DoubleRange InnerFence
{
get { return analysis.InnerFences[index]; }
}
/// <summary>
/// Gets the variable's interquartile range.
/// </summary>
///
public DoubleRange Quartiles
{
get { return analysis.Quartiles[index]; }
}
/// <summary>
/// Gets the variable's variance.
/// </summary>
///
public double Variance
{
get { return analysis.Variances[index]; }
}
/// <summary>
/// Gets the variable's maximum value.
/// </summary>
///
public double Max
{
get { return analysis.Ranges[index].Max; }
}
/// <summary>
/// Gets the variable's minimum value.
/// </summary>
///
public double Min
{
get { return analysis.Ranges[index].Min; }
}
/// <summary>
/// Gets the variable's length.
/// </summary>
///
public double Length
{
get { return analysis.Ranges[index].Length; }
}
/// <summary>
/// Gets the number of distinct values for the variable.
/// </summary>
///
public int Distinct
{
get { return analysis.Distinct[index]; }
}
/// <summary>
/// Gets the number of samples for the variable.
/// </summary>
///
public int Count
{
get { return analysis.Samples; }
}
/// <summary>
/// Gets the sum of cosines for the variable.
/// </summary>
///
public double CosineSum
{
get { return analysis.CosineSum[index]; }
}
/// <summary>
/// Gets the sum of sines for the variable.
/// </summary>
///
public double SineSum
{
get { return analysis.SineSum[index]; }
}
/// <summary>
/// Gets the transformed variable's observations.
/// </summary>
///
public double[] Angles
{
get { return analysis.Angles[index]; }
}
/// <summary>
/// Gets the variable's standard error of the mean.
/// </summary>
///
public double StandardError
{
get { return analysis.StandardErrors[index]; ; }
}
/// <summary>
/// Gets the 95% confidence interval around the <see cref="Mean"/>.
/// </summary>
///
public DoubleRange Confidence
{
get { return analysis.Confidence[index]; }
}
/// <summary>
/// Gets the 95% deviance interval around the <see cref="Mean"/>.
/// </summary>
///
public DoubleRange Deviance
{
get { return analysis.Deviance[index]; }
}
/// <summary>
/// Gets the variable's observations.
/// </summary>
///
public double[] Samples
{
get { return analysis.Source.GetColumn(index); }
}
/// <summary>
/// Gets the variable <see cref="Circular.Skewness">skewness</see>.
/// </summary>
///
public double Skewness
{
get { return analysis.Skewness[index]; }
}
/// <summary>
/// Gets the variable <see cref="Circular.Skewness">kurtosis</see>.
/// </summary>
///
public double Kurtosis
{
get { return analysis.Kurtosis[index]; }
}
/// <summary>
/// Gets a confidence interval for the <see cref="Mean"/>
/// within the given confidence level percentage.
/// </summary>
///
/// <param name="percent">The confidence level. Default is 0.95.</param>
///
/// <returns>A confidence interval for the estimated value.</returns>
///
public DoubleRange GetConfidenceInterval(double percent = 0.95)
{
return analysis.GetConfidenceInterval(index, percent);
}
/// <summary>
/// Gets a deviance interval for the <see cref="Mean"/>
/// within the given confidence level percentage (i.e. uses
/// the standard deviation rather than the standard error to
/// compute the range interval for the variable).
/// </summary>
///
/// <param name="percent">The confidence level. Default is 0.95.</param>
///
/// <returns>A confidence interval for the estimated value.</returns>
///
public DoubleRange GetDevianceInterval(double percent = 0.95)
{
return analysis.GetDevianceInterval(index, percent);
}
}
/// <summary>
/// Collection of descriptive measures.
/// </summary>
///
/// <seealso cref="CircularDescriptiveMeasures"/>
/// <seealso cref="CircularDescriptiveAnalysis"/>
///
[Serializable]
public class CircularDescriptiveMeasureCollection : ReadOnlyKeyedCollection<string, CircularDescriptiveMeasures>
{
internal CircularDescriptiveMeasureCollection(CircularDescriptiveMeasures[] components)
: base(components)
{
}
/// <summary>
/// Gets the key for item.
/// </summary>
///
protected override string GetKeyForItem(CircularDescriptiveMeasures item)
{
return item.Name;
}
}
}
|
namespace Enrollment.Utils
{
public static class ObjectHelper
{
public static object Null = null;
public static bool IsNull(object anyObject) => anyObject == null;
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ShipAreaBehaviour : MonoBehaviour {
public float width = 5;
public float height = 5;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void OnDrawGizmos()
{
Gizmos.DrawWireCube(transform.position, new Vector3(width, height, 0));//->Hace un Gizmo en forma de cubo al cual se le dan variables en este caso publicas
//para poder editarlas en el Inspector, este tendra la funcion de mover las naves enemigas
//que se encuentren dentro de este mismo
}
}
|
namespace Game.ConsoleUI.Game
{
using global::Game.ConsoleUI.Game.Services;
using global::Game.ConsoleUI.Interfaces;
using global::Game.ConsoleUI.Interfaces.Services;
using Interfaces.Views;
using Models;
using Serilog;
public class GameManager : BaseServiceWithLogger<GameManager>, IGameManager
{
private readonly IPlayersService playersService;
private readonly IValidWordVerifier challengeVerifier;
private readonly IGameManagerView gameView;
private readonly GameState gameState;
public GameManager(ILogger logger,
IPlayersService playersService,
IGameStateService gameStateService,
IValidWordVerifier challengeVerifier,
IGameManagerView gameView) : base(logger)
{
this.playersService = playersService;
this.challengeVerifier = challengeVerifier;
this.gameState = gameStateService.GetOrCreateGameState();
this.gameView = gameView;
}
public void NextTurn()
{
this.StartNewTurn();
if (this.gameState.IsChallengeResolved)
{
this.gameState.NextChallenge();
}
this.PlayerResolveChallenge();
this.gameState.ResolveChallenge();
}
private void StartNewTurn()
{
this.Logger.Debug("Next turn started");
this.gameView.Refresh(this.gameState);
}
private void PlayerResolveChallenge()
{
do
{
this.playersService.ResolveChallenge(this.gameState.CurrentChallenge);
} while (!this.IsResolutionValid() || !this.ApprovedByPlayers());
}
private bool IsResolutionValid()
{
var isValid = this.challengeVerifier.IsValid(this.gameState.ChallengeHistory,
this.gameState.CurrentChallenge.CurrentSuggestedResolution);
return isValid;
}
private bool ApprovedByPlayers()
{
var approved = this.playersService.ApproveResolution(this.gameState.CurrentChallenge);
return approved;
}
}
} |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using NuGet.Configuration;
using NuGet.Packaging.Core;
using NuGet.Protocol.Core.Types;
namespace NuGet.Resolver
{
public class PackageResolverContext
{
/// <summary>
/// Resolver context
/// </summary>
/// <param name="dependencyBehavior">behavior for non-target packages</param>
/// <param name="targetIds">packages to install or update</param>
/// <param name="requiredPackageIds">packages required in the solution</param>
/// <param name="packagesConfig">existing packages</param>
/// <param name="preferredVersions">preferred package versions or the installed version of a package</param>
/// <param name="availablePackages">all packages from the gather stage</param>
public PackageResolverContext(DependencyBehavior dependencyBehavior,
IEnumerable<string> targetIds,
IEnumerable<string> requiredPackageIds,
IEnumerable<Packaging.PackageReference> packagesConfig,
IEnumerable<PackageIdentity> preferredVersions,
IEnumerable<SourcePackageDependencyInfo> availablePackages,
IEnumerable<PackageSource> packageSources)
{
if (targetIds == null)
{
throw new ArgumentNullException(nameof(targetIds));
}
if (requiredPackageIds == null)
{
throw new ArgumentNullException(nameof(requiredPackageIds));
}
if (packagesConfig == null)
{
throw new ArgumentNullException(nameof(packagesConfig));
}
if (preferredVersions == null)
{
throw new ArgumentNullException(nameof(preferredVersions));
}
if (availablePackages == null)
{
throw new ArgumentNullException(nameof(availablePackages));
}
if(packageSources == null)
{
throw new ArgumentNullException(nameof(packageSources));
}
DependencyBehavior = dependencyBehavior;
TargetIds = new HashSet<string>(targetIds, StringComparer.OrdinalIgnoreCase);
RequiredPackageIds = new HashSet<string>(requiredPackageIds, StringComparer.OrdinalIgnoreCase);
RequiredPackageIds.UnionWith(targetIds);
PackagesConfig = packagesConfig;
PreferredVersions = new HashSet<PackageIdentity>(preferredVersions, PackageIdentity.Comparer);
AvailablePackages = availablePackages;
PackageSources = packageSources;
Debug.Assert(PreferredVersions.GroupBy(p => p.Id, StringComparer.OrdinalIgnoreCase)
.All(group => group.Count() == 1), "duplicate preferred ids");
}
/// <summary>
/// New packages to install or update. These will prefer the highest version.
/// </summary>
public HashSet<string> TargetIds { get; }
/// <summary>
/// Existing packages that are required, and the target ids that are required.
/// These packages are required for the solution.
/// </summary>
public HashSet<string> RequiredPackageIds { get; }
/// <summary>
/// The existing state of the project from packages.config
/// </summary>
public IEnumerable<Packaging.PackageReference> PackagesConfig { get; }
/// <summary>
/// Preferred versions of each package. If the package does not exist here
/// it will use the dependency behavior, or if it is a target the highest
/// version will be used.
/// </summary>
public HashSet<PackageIdentity> PreferredVersions { get; }
/// <summary>
/// All packages available to use in the solution.
/// </summary>
public IEnumerable<SourcePackageDependencyInfo> AvailablePackages { get; }
/// <summary>
/// Dependency behavior
/// </summary>
public DependencyBehavior DependencyBehavior { get; }
/// <summary>
/// Package Sources
/// </summary>
public IEnumerable<PackageSource> PackageSources { get; }
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using Week_2___Webshop.Models;
namespace Week_2___Webshop.BusinessLayer.Repositories
{
public class DeviceRepository : GenericRepository<Device>, IDeviceRepository
{
public override IEnumerable<Device> All()
{
var query = (from d in context.Devices.Include(f => f.Frameworks).Include(os => os.OperatingSystems) select d);
return query.ToList<Device>();
}
public override Device GetByID(object id)
{
int ID = Convert.ToInt32(id);
var query = (from d in context.Devices.Include(f => f.Frameworks).Include(os => os.OperatingSystems) where d.ID == ID select d);
return query.SingleOrDefault<Device>();
}
public Device AddDevice(Device d)
{
foreach(OS os in d.OperatingSystems)
{
context.OperatingSystems.Add(os);
context.Entry<OS>(os).State = EntityState.Unchanged;
}
foreach(Framework fw in d.Frameworks)
{
context.Frameworks.Add(fw);
context.Entry<Framework>(fw).State = EntityState.Unchanged;
}
Device nd = context.Devices.Add(d);
context.SaveChanges();
return nd;
}
public void UpdatePicture(Device d)
{
Device od = context.Devices.Find(d.ID);
od.PictureURL = d.PictureURL;
context.SaveChanges();
}
}
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Task 10
namespace Sum_Numbers_From_Console
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter number of nums: ");
int n = int.Parse(Console.ReadLine());
double sumNumbers = 0;
for (int i = 1; i <= n; i++)
{
Console.Write("Enter num {0}: ", i);
double num = double.Parse(Console.ReadLine());
sumNumbers += num;
}
Console.WriteLine("The sum is: {0}", sumNumbers);
}
}
}
|
namespace Dispatch.Api.Client.Tests
{
using Apexnet.Messaging.Mail;
// ReSharper disable UnusedMember.Global
public static class AddressBook
{
public static readonly MailAddress Ali = new MailAddress("a.donmez@wedoit.io", "Ali Servet Donmez");
public static readonly MailAddress Stefano = new MailAddress("s.teodorani@wedoit.io", "Stefano Teodorani");
public static readonly MailAddress Andrea = new MailAddress("a.calisesi@wedoit.io", "Andrea Calisesi");
public static readonly MailAddress Fabio = new MailAddress("f.vassura@wedoit.io", "Fabio Vassura");
public static readonly MailAddress AgendaSviluppo = new MailAddress("agesvil@wedoit.io", "AgendaBocconi (Sviluppo)");
}
// ReSharper restore UnusedMember.Global
} |
using System;
using System.Linq.Expressions;
using Bindable.Linq.Aggregators.Numerics;
using Bindable.Linq.Helpers;
using Bindable.Linq.Interfaces;
namespace Bindable.Linq
{
public static partial class BindableEnumerable
{
private static IBindable<TAverageResult> AverageInternal<TResult, TAverageResult>(IBindableCollection<TResult> source, INumeric<TResult, TAverageResult> numeric)
{
source.ShouldNotBeNull("source");
return Aggregate(source, sources => numeric.Average(sources));
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Decimal" /> values.
/// </summary>
/// <param name="source">A sequence of <see cref="T:System.Decimal" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<decimal> Average(this IBindableCollection<decimal> source)
{
return AverageInternal(source, new DecimalNumeric());
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Decimal" /> values.
/// </summary>
/// <param name="source">A sequence of nullable <see cref="T:System.Decimal" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<decimal?> Average(this IBindableCollection<decimal?> source)
{
return AverageInternal(source, new DecimalNullNumeric());
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Double" /> values.
/// </summary>
/// <param name="source">A sequence of nullable <see cref="T:System.Double" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average(this IBindableCollection<double?> source)
{
return AverageInternal(source, new DoubleNullNumeric());
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Int32" /> values.
/// </summary>
/// <param name="source">A sequence of nullable <see cref="T:System.Int32" />values to calculate the average of.</param>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average(this IBindableCollection<int?> source)
{
return AverageInternal(source, new Int32NullNumeric());
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Int64" /> values.
/// </summary>
/// <param name="source">A sequence of nullable <see cref="T:System.Int64" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average(this IBindableCollection<long?> source)
{
return AverageInternal(source, new Int64NullNumeric());
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Single" /> values.
/// </summary>
/// <param name="source">A sequence of nullable <see cref="T:System.Single" /> values to calculate the average of.</param>
/// <returns>
/// The average of the sequence of values, or null if the source sequence is empty or contains
/// only values that are null.
/// </returns>
public static IBindable<float?> Average(this IBindableCollection<float?> source)
{
return AverageInternal(source, new FloatNullNumeric());
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Double" /> values.
/// </summary>
/// <param name="source">A sequence of <see cref="T:System.Double" /> values to calculate the average of.</param>
/// <returns>
/// The average of the sequence of values.
/// </returns>
public static IBindable<double> Average(this IBindableCollection<double> source)
{
return AverageInternal(source, new DoubleNumeric());
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Int32" /> values.
/// </summary>
/// <param name="source">A sequence of <see cref="T:System.Int32" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<double> Average(this IBindableCollection<int> source)
{
return AverageInternal(source, new Int32Numeric());
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Int64" /> values.
/// </summary>
/// <param name="source">A sequence of <see cref="T:System.Int64" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<double> Average(this IBindableCollection<long> source)
{
return AverageInternal(source, new Int64Numeric());
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Single" /> values.
/// </summary>
/// <param name="source">A sequence of <see cref="T:System.Single" /> values to calculate the average of.</param>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<float> Average(this IBindableCollection<float> source)
{
return AverageInternal(source, new FloatNumeric());
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Decimal" /> values that are
/// obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values that are used to calculate an average.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<decimal> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, decimal>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Double" /> values that are obtained
/// by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<double> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, double>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Int32" /> values that are
/// obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<double> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, int>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of <see cref="T:System.Int64" /> values that are obtained
/// by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of source.</typeparam>
/// <returns>The average of the sequence of values.</returns>
public static IBindable<double> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, long>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<decimal?> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, decimal?>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Double" /> values that are obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, double?>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Int32" /> values that are obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, int?>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>
/// Computes the average of a sequence of nullable <see cref="T:System.Int64" /> values that are
/// obtained by invoking a transform function on each element of the input sequence.
/// </summary>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
public static IBindable<double?> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, long?>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>Computes the average of a sequence of nullable <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.</summary>
/// <returns>The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
public static IBindable<float?> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, float?>> selector) where TSource : class
{
return source.Select(selector).Average();
}
/// <summary>Computes the average of a sequence of <see cref="T:System.Single" /> values that are obtained by invoking a transform function on each element of the input sequence.</summary>
/// <returns>The average of the sequence of values.</returns>
/// <param name="source">A sequence of values to calculate the average of.</param>
/// <param name="selector">A transform function to apply to each element.</param>
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="source" /> or <paramref name="selector" /> is null.</exception>
/// <exception cref="T:System.InvalidOperationException">
/// <paramref name="source" /> contains no elements.</exception>
public static IBindable<float> Average<TSource>(this IBindableCollection<TSource> source, Expression<Func<TSource, float>> selector) where TSource : class
{
return source.Select(selector).Average();
}
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.