public override int GetHashCode() { int hash = 1; if (RetType != 0) { hash ^= RetType.GetHashCode(); } if (RetMsg.Length != 0) { hash ^= RetMsg.GetHashCode(); } if (ErrCode != 0) { hash ^= ErrCode.GetHashCode(); } if (s2C_ != null) { hash ^= S2C.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
// Debugging support public override void DebugCheck(ISemanticResolver s) { //Debug.Assert(AST.Node.m_DbgAllowNoCLRType || m_typeCLR != null); if (Node != null) { Debug.Assert(Node.Symbol == this); // Non-null means that we're a user method. So we'd better // have a scope Debug.Assert(m_scope != null); m_scope.DebugCheck(s); } else { // If Node is null, then we're imported. // Can't have a scope & body for an imported function... Debug.Assert(m_scope == null); } if (!IsCtor) { // Must have a return type (even Void is still non-null) Debug.Assert(RetType != null); RetType.DebugCheck(s); } // Must be defined in some class Debug.Assert(m_classDefined != null); }
static void handleFile(FileInfo fi) { //fn should begin at Assets\,and has ext string fp = fi.FullName.Substring(beginIndex); run = !EditorUtility.DisplayCancelableProgressBar("lowTexture", fp, 0); RetType ret = RetType.Ok; switch (fi.Extension.ToLower()) { case ".png": case ".jpg": case ".tga": ret = handleTexture(fp); break; case ".prefab": ret = handlePrefab(fp); break; } ; if (ret == RetType.Error) { Debug.LogError("low quality failed:" + fp); } }
static RetType handlePrefab(string assetPath) { UIAtlas atlas = AssetDatabase.LoadAssetAtPath(assetPath, typeof(UIAtlas)) as UIAtlas; if (null == atlas) { return(RetType.Ignore); } if (null == atlas.spriteMaterial || null == atlas.spriteMaterial.mainTexture) { return(RetType.Error); } string path = AssetDatabase.GetAssetPath(atlas.spriteMaterial.mainTexture); //缩放关联的texture/ RetType ret = handleTexture(path); if (atlas.scale != 1f) { return(RetType.Ignore); } atlas.scale = 0.5f; //缩放图集坐标/ BetterList <string> sl = atlas.GetListOfSprites(); if (sl == null) { return(RetType.Error); } foreach (string sn in sl) { UISpriteData sd = atlas.GetSprite(sn); sd.x /= 2; sd.y /= 2; sd.width /= 2; sd.height /= 2; sd.borderBottom /= 2; sd.borderLeft /= 2; sd.borderRight /= 2; sd.borderTop /= 2; sd.paddingTop /= 2; sd.paddingBottom /= 2; sd.paddingLeft /= 2; sd.paddingRight /= 2; } atlas.pixelSize *= 2; atlas.MarkAsDirty(); return(ret); }
/// <summary> /// Start point. Simplified request similar to web-schedule /// </summary> /// <param name="name">Group or lecturer name</param> /// <param name="week">number of week [1-52]</param> /// <param name="year">year [YYYY]</param> /// <param name="isLecturer">Timetable is for lecturer</param> /// <param name="retType">what to return: weeks or days</param> public ScheduleKitchen(string name, int week, int year, bool isLecturer, RetType retType) { ReturnType = retType; R = null; if (isLecturer) { lecturer = name; } else { sname = name; } SetWeek(week, year); TimetableForLecturer = isLecturer; dateTimeInfo = cultureInfo.DateTimeFormat; }
/// <summary> /// </summary> /// <param name="storedProcedure">存储过程的名字</param> /// <param name="paramKeys">参数列表,,隔开</param> /// <param name="paramVals">参数值数组</param> /// <param name="dbConName"></param> /// <param name="retType">Table返回DataTable;String时返回string;Int时返回int</param> /// <returns></returns> public object ExecStoredProc(string storedProcedure, string[] paramKeys, string[] paramVals, string dbConName, RetType retType) { var conStrs = ConfigurationManager.ConnectionStrings[dbConName]; if (conStrs == null) { throw new Exception(string.Format("调用数据库 {0} 错误.", dbConName)); } var dbConString = MyEncrypt.DecryptDES(conStrs.ConnectionString, DeEncryptKey); var dbComObj = new SimpDataDBHelper(dbConString); if (string.IsNullOrWhiteSpace(storedProcedure)) { throw new Exception("调用名称为空."); } using (var cmd = dbComObj.GetStoredProcCommond(storedProcedure)) { if (paramKeys != null && paramVals != null && paramKeys.Length != 0 && paramVals.Length != 0) { for (int i = 0, iCnt = paramKeys.Length; i < iCnt; i++) { dbComObj.AddInParameter(cmd, "@" + paramKeys[i], DbType.String, paramVals[i]); } } switch (retType) { case RetType.String: return(dbComObj.ExecuteScalar(cmd)); case RetType.Table: return(dbComObj.ExecuteDataTable(cmd)); case RetType.DataSet: return(dbComObj.ExecuteDataSet(cmd)); case RetType.SimpDEs: return(dbComObj.ExecuteSimpData(cmd)); case RetType.Json: return(dbComObj.ExecuteJsonScalar(cmd)); } return(null); } }
/// <summary> /// Start point. First type of requests and it defines straight value settings /// </summary> /// <param name="name">Group or lecturer name</param> /// <param name="sdate">Start date [dd.MM.yyyy]</param> /// <param name="edate">End date [dd.MM.yyyy]</param> /// <param name="isLecturer">Timetable is for lecturer</param> /// <param name="retType">what to return: weeks or days</param> public ScheduleKitchen(string name, string sdate, string edate, bool isLecturer, RetType retType) { ReturnType = retType; R = null; if (isLecturer) { lecturer = name; } else { sname = name; } StartDate = sdate; EndDate = edate; TimetableForLecturer = isLecturer; dateTimeInfo = cultureInfo.DateTimeFormat; }
/// <summary> /// 作成した型からの値の取り出し /// </summary> /// <param name="obj">取得対象</param> /// <returns>取得結果</returns> public Dictionary <string, object> GetDictionary(object obj) { Type objectType = obj.GetType(); if (RetType != objectType) { throw new Exception("対象外の型のインスタンスが指定されています"); } Dictionary <string, object> retVal = new Dictionary <string, object>(); foreach (PropertyInfo pInfo in RetType.GetProperties()) { string propertyName = pInfo.Name; object value = RetType.InvokeMember(propertyName, BindingFlags.GetProperty, null, obj, new object[] { }); retVal.Add(propertyName, value); } return(retVal); }
public ChannelServices(AppConfig appConfig) { var serviceCollection = new ServiceCollection(); var builder = serviceCollection .AddLogging() .AddClient() .UseSharedFileRouteManager("d:\\WorldServer.txt"); IServiceProvider serviceProvider = null; builder.UseDotNettyTransport(); serviceProvider = serviceCollection.BuildServiceProvider(); var serviceProxyGenerater = serviceProvider.GetRequiredService <IServiceProxyGenerater>(); var serviceProxyFactory = serviceProvider.GetRequiredService <IServiceProxyFactory>(); var services = serviceProxyGenerater.GenerateProxys(new[] { typeof(Common.ServicesInterface.ChannelInterface) }).ToArray(); //创建IUserService的代理。 sChannelService = serviceProxyFactory.CreateProxy <Common.ServicesInterface.ChannelInterface>(services.Single(typeof(Common.ServicesInterface.ChannelInterface).IsAssignableFrom)); Task.Run(async() => { channel = new ChannelInfo(); channel.Name = "测试区"; channel.Players = 500; channel.Address = "127.0.0.1"; RetType state = (await sChannelService.RegisterChannel(channel)); if (state.Error == 0) { appConfig.Port = (short)state.Port; appConfig.Index = (int)state.UID; ChannelId = state.UID; Console.WriteLine("开启成功!!!"); } else { Console.WriteLine("注册失败!!!"); } }).Wait(); }
public void ParseMessage(INetworkProtocol protocol) { if (!(protocol is ByteProtocol)) { return; } RetType type = (RetType)protocol.GetByte(); byte[] bytes = ((ByteProtocol)protocol).GetInputBytes(); string json = Encoding.UTF8.GetString(bytes); switch (type) { case RetType.Login: case RetType.Register: sender.Send(JsonUtility.FromJson <LoginRet>(json)); break; case RetType.Match: sender.Send(JsonUtility.FromJson <MatchRet>(json)); break; case RetType.Ready: sender.Send(JsonUtility.FromJson <ReadyRet>(json)); break; case RetType.Matched: sender.Send(JsonUtility.FromJson <MatchedRet>(json)); break; case RetType.Start: sender.Send(JsonUtility.FromJson <StartRet>(json)); break; } Debug.Log(json); }
/// <summary> /// 作成した型への値の格納 /// </summary> /// <param name="obj">格納対象</param> /// <param name="data">格納するデータ</param> public void SetDictionary(object obj, Dictionary <string, object> data) { Type objectType = obj.GetType(); if (RetType != objectType) { throw new Exception("対象外の型のインスタンスが指定されています"); } foreach (PropertyInfo pInfo in RetType.GetProperties()) { string propertyName = pInfo.Name; if (data.ContainsKey(propertyName)) { if (data[propertyName].GetType() != pInfo.PropertyType) { throw new Exception("次のプロパティの型が異なります:" + propertyName); } RetType.InvokeMember(propertyName, BindingFlags.SetProperty, null, obj, new object[] { data[propertyName] }); } } }
public override int GetHashCode() { return(ArgumentsHashCode() ^ MethodName.GetHashCode() ^ RetType.GetHashCode() ^ Access.GetHashCode()); }
public RetType updatebilldetailsoperation(string TransactionId, string TransactionDate, string Amount, string Mode, string RequestId, string SchoolName, string EnrollmentNo) { SoapContext db = new SoapContext(); TBLFEECOLLECTIONNKVSFEDERAL objFEE = new TBLFEECOLLECTIONNKVSFEDERAL(); TBLRECEIPTTABLENEWFEDEREAL objREC = new TBLRECEIPTTABLENEWFEDEREAL(); TBLFEDERALREQUESTDETAIL objFED = db.TBLFEDERALREQUESTDETAILS.Where(r => r.REQUESTID == RequestId).FirstOrDefault(); RetType obj = new RetType(); string Status = "F"; try { string PaymentType = ""; if (Mode == "C") { PaymentType = "CASH"; } if (Mode == "T") { PaymentType = "TRANSFER"; } double AmountReceived = 0; if (Amount != "") { AmountReceived = Convert.ToDouble(Amount); } bool flag = false; var FeeSetting = db.View_GetFeeSettings.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper()).ToList(); var StudentData = db.View_GetSudentStandard.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper()).FirstOrDefault(); var ReceiptNo = db.View_GetReceiptNo.OrderByDescending(r => r.RECEIPTID).FirstOrDefault(); string StudReceiptNo = "", value = ""; if (ReceiptNo != null) { if (ReceiptNo.RECEIPTNO != "") { int NO = int.Parse(ReceiptNo.RECEIPTNO) + 1; value = String.Format("{0:D5}", NO); } } StudReceiptNo = "A-" + FeeSetting[0].ACADEMICYEAR + "/" + value; if (FeeSetting != null) { if (AmountReceived != 0) { for (int i = 0; i < FeeSetting.Count; i++) { double PaidAmount = 0, PendingAmount = 0; double InstAmount = 0, Due = 0; InstAmount = Convert.ToDouble(FeeSetting[i].AMOUNT); string Installment = FeeSetting[i].FEETYPE; DateTime DueDate = Convert.ToDateTime(FeeSetting[i].DUEDATE).Date; var FeesPaid = db.View_GetPaidFees.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper() && r.FEETYPE == Installment).ToList(); if (FeesPaid.Count > 0) { for (int j = 0; j < FeesPaid.Count; j++) { PaidAmount = PaidAmount + Convert.ToDouble(FeesPaid[j].AMOUNT); } //PaidAmount = Convert.ToDouble(Amount); } else { PendingAmount = InstAmount; } if (PaidAmount != InstAmount && PaidAmount < InstAmount && AmountReceived > 0) { flag = false; PendingAmount = InstAmount - PaidAmount; if (AmountReceived >= PendingAmount) { AmountReceived = AmountReceived - PendingAmount; DateTime paymentdate = Convert.ToDateTime(TransactionDate).Date; if (paymentdate > DueDate) { int LATEBYDAYS = (paymentdate - DueDate).Days; Due = LATEBYDAYS * Convert.ToDouble(FeeSetting[i].INSTALLMENTFINE); } AmountReceived = AmountReceived - Due; objFEE.ENROLLMENTNO = StudentData.ENROLLMENTNO; objFEE.STUDENTID = StudentData.STUDENTID; objFEE.STANDARDID = Convert.ToInt32(StudentData.STANDARDID); objFEE.FEETYPEID = FeeSetting[i].FEETYPEID; objFEE.AMOUNT = Convert.ToDecimal(PendingAmount); objFEE.FINE = Convert.ToDecimal(Due); objFEE.PAYMENTTYPE = PaymentType; objFEE.RECEIPTNO = StudReceiptNo; objFEE.CREATEDTIME = DateTime.Now.ToShortTimeString(); objFEE.CREATEDON = paymentdate; objFEE.REQUESTID = RequestId; objFEE.TRANSACTIONSTATUS = "Successful"; db.TBLFEECOLLECTIONNKVSFEDERALs.Add(objFEE); int status = db.SaveChanges(); if (status > 0) { flag = true; Status = "S"; } else { Status = "F"; } } } } if (flag == true) { objREC.STUDENTID = StudentData.STUDENTID.ToString(); objREC.RECEIPTNO = Convert.ToInt32(value); objREC.ACADEMICYEAR = FeeSetting[0].ACADEMICYEAR; db.TBLRECEIPTTABLENEWFEDEREALs.Add(objREC); db.SaveChanges(); objFED.TRANSACTIONSTATUS = Status; objFED.UPDATEDDATE = DateTime.Now; db.SaveChanges(); } } } } catch (Exception ex) { } RetType objRET = new RetType(); objRET.out1 = Status; objRET.out2 = TransactionId; objRET.out3 = TransactionDate; return(objRET); }
/// <summary> /// /// </summary> /// <param name="storedProcedure">存储过程的名字</param> /// <param name="paramKeys">参数列表,,隔开</param> /// <param name="paramVals">参数值数组</param> /// <param name="strRetType">Table返回DataTable;String时返回string;Int时返回int</param> /// <returns></returns> public object ExecStoredProc(string storedProcedure, string[] paramKeys, object[] paramVals, string dbConName, RetType retType) { ConnectionStringSettings _conStrs = ConfigurationManager.ConnectionStrings[dbConName]; if (_conStrs == null) { throw (new System.Exception(string.Format("调用数据库 {0} 错误.", dbConName))); } string _dbConString = _conStrs.ConnectionString; SimpDataDBHelper dbComObj = new SimpDataDBHelper(_dbConString); if (string.IsNullOrWhiteSpace(storedProcedure)) { throw (new System.Exception("调用名称为空.")); } using (DbCommand cmd = dbComObj.GetStoredProcCommond(storedProcedure)) { if (paramKeys != null && paramVals != null && paramKeys.Length != 0 && paramVals.Length != 0) { for (int _i = 0, _iCnt = paramKeys.Length; _i < _iCnt; _i++) { dbComObj.AddInParameter(cmd, "@" + paramKeys[_i], DbType.String, paramVals[_i].ToString()); } } switch (retType) { case RetType.String: return dbComObj.ExecuteScalar(cmd); case RetType.Table: return dbComObj.ExecuteDataTable(cmd); case RetType.DataSet: return dbComObj.ExecuteDataSet(cmd); case RetType.SimpDEs: return dbComObj.ExecuteSimpData(cmd); case RetType.Json: return dbComObj.ExecuteJsonScalar(cmd); } return null; } }
public RetType getbilldetailsoperation(string SchoolName, string StudentName, string EnrollmentNo) { string Paymentdate = DateTime.Now.ToString("dd/MM/yyyy"); SoapContext objSC = new SoapContext(); TBLFEDERALREQUESTDETAIL objFB = new TBLFEDERALREQUESTDETAIL(); RetType obj = new RetType(); string Install1 = "", Install2 = "", Install3 = "", Install4 = ""; try { var Concession = objSC.View_GetConcessionDetails.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper()).FirstOrDefault(); var FeeSetting = objSC.View_GetFeeSettings.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper()).ToList(); string Studentname = Concession.STUDENTNAME; double PendingAmount = 0, Due = 0, ConcessionAmount = 0; if (Concession != null) { if (Concession.CONCESSION == "YES") { ConcessionAmount = Convert.ToDouble(Concession.CONCESSIONPERCENTAGE); } } if (FeeSetting != null) { for (int i = 0; i < FeeSetting.Count; i++) { double Amount = 0, InstPendingAmount = 0, InstFine = 0; string Installment = FeeSetting[i].FEETYPE; var FeesPaid = objSC.View_GetPaidFees.Where(r => r.ENROLLMENTNO == EnrollmentNo.Trim().ToUpper() && r.FEETYPE == Installment).ToList(); if (FeesPaid.Count > 0) { for (int j = 0; j < FeesPaid.Count; j++) { Amount = Amount + Convert.ToDouble(FeesPaid[j].AMOUNT); } PendingAmount += Convert.ToDouble(FeeSetting[i].AMOUNT) - Amount; InstPendingAmount = Convert.ToDouble(FeeSetting[i].AMOUNT) - Amount; } else { Amount = Amount + Convert.ToDouble(FeeSetting[i].AMOUNT); PendingAmount += Amount; InstPendingAmount = Convert.ToDouble(FeeSetting[i].AMOUNT); } DateTime duedate = Convert.ToDateTime(FeeSetting[i].DUEDATE).Date; DateTime dt1 = Convert.ToDateTime(DateTime.Now.ToShortDateString()).Date; //string[] DATESPLIT = Paymentdate.Split('/'); //if (DATESPLIT.Length!=3) //{ // string[] DASHDATESPLIT = Paymentdate.Split('-'); // try // { // string actualdate = DASHDATESPLIT[1] + "/" + DASHDATESPLIT[0] + "/" + DASHDATESPLIT[2]; // dt1 = Convert.ToDateTime(actualdate).Date; // } // catch (Exception ex) // { // string actualdate = DASHDATESPLIT[1] + "-" + DASHDATESPLIT[0] + "-" + DASHDATESPLIT[2]; // dt1 = Convert.ToDateTime(actualdate).Date; // } //} //else //{ // string actualdate = DATESPLIT[1] + "/" + DATESPLIT[0] + "/" + DATESPLIT[2]; // dt1 = Convert.ToDateTime(actualdate).Date; //} if (PendingAmount != 0) { if (dt1 > duedate) { int LATEBYDAYS = (dt1 - duedate).Days; Due += LATEBYDAYS * Convert.ToDouble(FeeSetting[i].INSTALLMENTFINE); InstFine = LATEBYDAYS * Convert.ToDouble(FeeSetting[i].INSTALLMENTFINE); } } if (InstPendingAmount == 0) { if (Installment == "INSTALLMENT 1") { Install1 = "INSTALLMENT 1-PAID"; } if (Installment == "INSTALLMENT 2") { Install2 = "INSTALLMENT 2-PAID"; } if (Installment == "INSTALLMENT 3") { Install3 = "INSTALLMENT 3-PAID"; } if (Installment == "INSTALLMENT 4") { Install4 = "INSTALLMENT 4-PAID"; } } else { if (Installment == "INSTALLMENT 1") { Install1 = "INSTALLMENT 1 : " + InstPendingAmount + " - FINE : " + InstFine + ""; } if (Installment == "INSTALLMENT 2") { Install2 = "INSTALLMENT 2 : " + InstPendingAmount + " - FINE : " + InstFine + ""; } if (Installment == "INSTALLMENT 3") { Install3 = "INSTALLMENT 3 : " + InstPendingAmount + " - FINE : " + InstFine + ""; } if (Installment == "INSTALLMENT 4") { Install4 = "INSTALLMENT 4 : " + InstPendingAmount + " - FINE : " + InstFine + ""; } } } string REQID = "", REQUESTID = ""; var CurrentRequestId = objSC.View_GETFEDERALREQUESTID.OrderByDescending(r => r.BANKREQUESTID).FirstOrDefault(); if (CurrentRequestId != null) { REQID = CurrentRequestId.REQUESTID; } if (REQID == "" || REQID == null) { REQUESTID = "FB00000001"; } else { int NO = int.Parse(REQID) + 1; REQUESTID = "FB" + String.Format("{0:D8}", NO); } if (REQUESTID != null) { objFB.REQUESTID = REQUESTID; objFB.ENROLLMENTNO = EnrollmentNo.ToString().ToUpper(); objFB.REQUESTDATE = DateTime.Now; objSC.TBLFEDERALREQUESTDETAILS.Add(objFB); objSC.SaveChanges(); } double GrandPending = 0; if (PendingAmount != 0) { GrandPending = PendingAmount - ConcessionAmount; if (GrandPending != 0) { GrandPending = GrandPending + Due; } } obj.out1 = REQUESTID; obj.out2 = (GrandPending).ToString(); obj.out3 = Studentname.ToString(); obj.out4 = EnrollmentNo.Trim().ToUpper(); obj.out5 = Install1; obj.out6 = Install2; obj.out7 = Install3; obj.out8 = Install4; } } catch (Exception e) { obj.out1 = Paymentdate + "----" + e.StackTrace; } return(obj); }
/// <summary>通用存储过程执行 /// /// </summary> /// <param name="storedProcedure">存储过程的名字</param> /// <param name="paramKeys">参数列表,,隔开</param> /// <param name="paramVals">参数值数组</param> /// <param name="dbConName"></param> /// <param name="strRetType">Table返回DataTable;String时返回string;Int时返回int</param> /// <returns></returns> public object ExecStoredProc(string storedProcedure, string[] paramKeys, object[] paramVals, string dbConName, RetType strRetType) { SimpDataDBHelper dbComObj = new SimpDataDBHelper(dbConName); using (DbCommand cmd = dbComObj.GetStoredProcCommond(storedProcedure)) { if (paramKeys != null && paramVals != null && paramKeys.Length != 0 && paramVals.Length != 0) { for (int i = 0, iCnt = paramKeys.Length; i < iCnt; i++) { dbComObj.AddInParameter(cmd, "@" + paramKeys[i], DbType.String, paramVals[i].ToString()); } } switch (strRetType) { case RetType.String: return(dbComObj.ExecuteScalar(cmd)); case RetType.Table: return(dbComObj.ExecuteDataTable(cmd)); case RetType.DataSet: return(dbComObj.ExecuteDataSet(cmd)); case RetType.SimpDEs: return(dbComObj.ExecuteSimpData(cmd)); } return(null); } }