private static string GetTextByAnnex(Annex annex, AnnexTextType textType)
 {
     if (annex != null)
     {
         if (textType == AnnexTextType.DisplayName)
         {
             return(annex.DisplayName);
         }
         else if (textType == AnnexTextType.Description)
         {
             return(annex.Description);
         }
         else if (textType == AnnexTextType.Body)
         {
             return(annex.Body);
         }
         else if (textType == AnnexTextType.Remark)
         {
             return(annex.Remark);
         }
         else if (textType == AnnexTextType.Remark1)
         {
             return(annex.Remark1);
         }
         else if (textType == AnnexTextType.Remark2)
         {
             return(annex.Remark2);
         }
         else if (textType == AnnexTextType.Other)
         {
             return(annex.Other);
         }
     }
     return(string.Empty);
 }
Example #2
0
 private PrizeSample getPrize(Annex annex)
 {
     if (annex.exp != null)
     {
         return(annex.exp);
     }
     else if (annex.money != null)
     {
         return(annex.money);
     }
     else if (annex.prop != null)
     {
         return(annex.prop);
     }
     else if (annex.pve != null)
     {
         return(annex.pve);
     }
     else if (annex.pvp != null)
     {
         return(annex.pvp);
     }
     else if (annex.rmb != null)
     {
         return(annex.rmb);
     }
     else
     {
         return(null);
     }
 }
Example #3
0
 public static void GraduateSim(SimDescription simDesc, AcademicDegree degree)
 {
     if ((simDesc != null) && (degree != null))
     {
         IHandleUniversityGraduation graduationRabbitHole = CollegeGraduation.GetGraduationRabbitHole() as IHandleUniversityGraduation;
         if (graduationRabbitHole != null)
         {
             Annex annex = graduationRabbitHole as Annex;
             if (annex != null)
             {
                 AnnexEx.AddSimToGraduationList(annex, simDesc, degree);
             }
             else
             {
                 graduationRabbitHole.AddSimToGraduationList(simDesc, degree);
             }
         }
         else if (simDesc.CreatedSim != null)
         {
             CollegeGraduation.GraduateInPlace entry = CollegeGraduation.GraduateInPlace.Singleton.CreateInstance(simDesc.CreatedSim, simDesc.CreatedSim, new InteractionPriority(InteractionPriorityLevel.High), false, false) as CollegeGraduation.GraduateInPlace;
             simDesc.CreatedSim.InteractionQueue.AddNext(entry);
             ActiveTopic.RemoveTopicFromSim(simDesc.CreatedSim, "University Graduation");
         }
     }
 }
Example #4
0
 private IEnumerator ColorGradient(Color targetColor, float gradientDuration)
 {
     while (spriteRenderer.color != targetColor)
     {
         spriteRenderer.color = Annex.toColor(Vector3.SmoothDamp(Annex.toVector3(spriteRenderer.color), Annex.toVector3(targetColor), ref colorSmoothing, gradientDuration));
         yield return(null);
     }
 }
        //#common
        //##get
        //##Get by masterId
        private static Annex Get(string className, long masterId, List <Annex> annexes, string langCode, GetAnnexMode getAnnexMode)
        {
            if (annexes == null)
            {
                return(null);
            }

            var annex = new Annex();

            if (getAnnexMode == GetAnnexMode.OnlyByCurLang)
            {
                annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId && x.LanguageCode == langCode)
                    : annexes.Find(x => x.ClassName == className && x.MasterId == masterId && x.LanguageCode == langCode);
            }

            else if (getAnnexMode == GetAnnexMode.FirstAnnex)
            {
                annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId && x.LanguageCode == langCode)
                    : annexes.Find(x => x.ClassName == className && x.MasterId == masterId && x.LanguageCode == langCode);

                if (annex == null)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId)
                        : annexes.Find(x => x.ClassName == className && x.MasterId == masterId);
                }
            }

            else if (getAnnexMode == GetAnnexMode.StepByStep)
            {
                annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId && x.LanguageCode == langCode)
                    : annexes.Find(x => x.ClassName == className && x.MasterId == masterId && x.LanguageCode == langCode);

                //if (annex == null)
                //{
                //    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId && x.LanguageCode == CultureHelper.CurrentLanguageCode)
                //        : annexes.Find(x => x.ClassName == className && x.MasterId == masterId && x.LanguageCode == CultureHelper.CurrentLanguageCode);
                //}

                if (annex == null)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId && x.LanguageCode == DefaultLanguageCode)
                        : annexes.Find(x => x.ClassName == className && x.MasterId == masterId && x.LanguageCode == DefaultLanguageCode);
                }

                if (annex == null)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterId == masterId)
                        : annexes.Find(x => x.ClassName == className && x.MasterId == masterId);
                }
            }
            return(annex ?? null);
        }
Example #6
0
 private PrizeSample getPrize(Annex annex)
 {
     if (annex.exp != null)
     {
         return(annex.exp);
     }
     else if (annex.money != null)
     {
         return(annex.money);
     }
     else if (annex.prop != null)
     {
         return(annex.prop);
     }
     else if (annex.pve != null)
     {
         return(annex.pve);
     }
     else if (annex.pvp != null)
     {
         return(annex.pvp);
     }
     else if (annex.rmb != null)
     {
         return(annex.rmb);
     }
     else if (annex.starsoulDebris != null)
     {
         return(annex.starsoulDebris);
     }
     else if (annex.ladder != null)
     {
         return(annex.ladder);
     }
     else if (annex.contribution != null)
     {
         return(annex.contribution);
     }
     else if (annex.mounts != null)
     {
         return(annex.mounts);
     }
     else if (annex.magicWeapon != null)
     {
         return(annex.magicWeapon);
     }
     else
     {
         return(null);
     }
 }
Example #7
0
    /*
     * Make the tile at (x, y) in the grid disappear (this method is called when the player step on this tile)
     */
    public IEnumerator effrite(int x, int y)                    // DEGUEULASSE
    {
        int[] w = { x, y };
        if (!tilesCurrentlyAltered.Contains(w))
        {
            print("Starting the coroutine");
            tilesCurrentlyAltered.Add(w);

            Vector3Int tilePosition = new Vector3Int(x, y, 0);

            // Making the tile disappear

            /*
             * while (grid.GetColor(tilePosition).a > 0f) {		// while the tile is not transparent
             *      Color tmpColor = grid.GetColor(tilePosition);
             *      tmpColor.a = Mathf.Clamp (tmpColor.a, 0, 1);
             *      tmpColor.a -= Time.deltaTime / timeDisappearing;
             *      grid.SetColor(tilePosition, tmpColor);		// XXX
             *      yield return null;
             * }
             */

            yield return(new WaitForSeconds(timeDisappearing));

            grid.SetTile(tilePosition, null);                           // Disabling the tile

            yield return(new WaitForSeconds(tileRespawnTime));

            // Waiting for the player not to be on the tile (this assumes the player is 1x2)
            GameObject player = GameObject.FindWithTag("Player");
            while (Annex.isInRange(player.transform.position.x, x - 0.5f, x + 1.5f) && Annex.isInRange(player.transform.position.y, y - 1f, y + 2f))                    // while the player is in the zone of the tile
            {
                yield return(null);
            }

            grid.SetTile(tilePosition, friableTile);                            // Reenabling the tile
            // Making the tile reappear

            /*
             * while (grid.GetColor(tilePosition).a < 1f) {		// while the tile is not fully opaque
             *      Color tmpColor = grid.GetColor (tilePosition);
             *      tmpColor.a += Time.deltaTime / timeReappearing;
             *      grid.SetColor(tilePosition, tmpColor);
             *      yield return null;
             * }
             */

            tilesCurrentlyAltered.Remove(w);
        }
    }
Example #8
0
        public static void OnWorldLoadFinished()
        {
            Annex annex = CollegeGraduation.GetGraduationRabbitHole() as Annex;

            if (annex != null)
            {
                if (annex.mGraduationCeremonyInitialized)
                {
                    if (annex.mStartGraduationCeremonyAlarm == AlarmHandle.kInvalidHandle)
                    {
                        new StartGraduationCeremonyTask(annex);
                    }
                }
            }
        }
Example #9
0
    private static float yTranslation = 7f;             // The vertical distance that the door goes down



    /* Open the door */
    public IEnumerator Open()
    {
        float initialY = transform.position.y;
        float x        = transform.position.x;
        float t        = 0f;

        while (t < timeToOpen)                          // Pas beau =(
        {
            t += Time.deltaTime;
            float newY = Mathf.Clamp(initialY - yTranslation * Annex.SmoothStep(t / timeToOpen), initialY - yTranslation, initialY);
            transform.position = new Vector3(x, newY, 0);
            yield return(null);
        }
        print("Door open");
    }
Example #10
0
        public static bool AddSimToGraduationList(Annex ths, SimDescription simDesc, AcademicDegree degree)
        {
            if ((simDesc == null) || (degree == null))
            {
                return(false);
            }

            if (IsAGraduationCeremonyInitializedAndIfNecessaryStartOne(ths))
            {
                ths.mGraduatingSims.Add(simDesc, degree);
                if (simDesc.CreatedSim != null)
                {
                    ActiveTopic.AddToSim(simDesc.CreatedSim, "University Graduation");
                }
            }

            return(ths.mGraduationCeremonyInitialized);
        }
Example #11
0
        public static bool AddSimToGraduationList(Annex ths, SimDescription simDesc, AcademicDegree degree)
        {
            if ((simDesc == null) || (degree == null))
            {
                return false;
            }

            if (IsAGraduationCeremonyInitializedAndIfNecessaryStartOne(ths))
            {
                ths.mGraduatingSims.Add(simDesc, degree);
                if (simDesc.CreatedSim != null)
                {
                    ActiveTopic.AddToSim(simDesc.CreatedSim, "University Graduation");
                }
            }

            return ths.mGraduationCeremonyInitialized;
        }
Example #12
0
 private Annex[] parse(Annex[] annex, ErlList list)
 {
     if (list == null)
     {
         return(null);
     }
     annex = new Annex[list.Value.Length];
     for (int i = 0; i < list.Value.Length; i++)
     {
         annex[i] = new Annex();
         string str = ((list.Value[i] as ErlArray).Value[0] as ErlAtom).getValueString();
         if (str == "exp")
         {
             string strs = PrizeType.PRIZE_EXP + "," + "0" + "," + ((list.Value[i] as ErlArray).Value[1] as ErlType).getValueString();
             annex[i].exp = new PrizeSample(strs, ',');
         }
         else if (str == "rmb")
         {
             string strs = PrizeType.PRIZE_RMB + "," + "0" + "," + ((list.Value[i] as ErlArray).Value[1] as ErlType).getValueString();
             annex[i].rmb = new PrizeSample(strs, ',');
         }
         else if (str == "money")
         {
             string strs = PrizeType.PRIZE_MONEY + "," + "0" + "," + ((list.Value[i] as ErlArray).Value[1] as ErlType).getValueString();
             annex[i].money = new PrizeSample(strs, ',');
         }
         else if (str == "pve")
         {
             string strs = PrizeType.PRIZE_PVE + "," + "0" + "," + ((list.Value[i] as ErlArray).Value[1] as ErlType).getValueString();
             annex[i].pve = new PrizeSample(strs, ',');
         }
         else if (str == "pvp")
         {
             string strs = PrizeType.PRIZE_PVP + "," + "0" + "," + ((list.Value[i] as ErlArray).Value[1] as ErlType).getValueString();
             annex[i].pvp = new PrizeSample(strs, ',');
         }
         else if (str == "prop")
         {
             string strs = (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[0]).getValueString() + "," + (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[1]).getValueString() + "," + (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[2]).getValueString();
             annex[i].prop = new PrizeSample(strs, ',');
         }
     }
     return(annex);
 }
Example #13
0
        //#Get by masterName
        private static Annex Get(string className, string masterName, List <Annex> annexes, string langCode, GetAnnexMode getAnnexMode)
        {
            if (annexes == null)
            {
                return(null);
            }
            try
            {
                var annex = new Annex();
                if (getAnnexMode == GetAnnexMode.FirstAnnex)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterName == masterName)
                        : annexes.Find(x => x.ClassName == className && x.MasterName == masterName);
                }
                else if (getAnnexMode == GetAnnexMode.OnlyByCurLang)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterName == masterName && x.LanguageCode == langCode)
                        : annexes.Find(x => x.ClassName == className && x.MasterName == masterName && x.LanguageCode == langCode);
                }
                else if (getAnnexMode == GetAnnexMode.StepByStep)
                {
                    annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterName == masterName && x.LanguageCode == langCode)
                        : annexes.Find(x => x.ClassName == className && x.MasterName == masterName && x.LanguageCode == langCode);

                    if (annex == null)
                    {
                        annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterName == masterName && x.LanguageCode == DefaultLanguageCode)
                            : annexes.Find(x => x.ClassName == className && x.MasterName == masterName && x.LanguageCode == DefaultLanguageCode);
                    }

                    if (annex == null)
                    {
                        annex = className.IsNullOrEmpty() ? annexes.Find(x => x.MasterName == masterName)
                            : annexes.Find(x => x.ClassName == className && x.MasterName == masterName);
                    }
                }
                return(annex ?? null);
            }
            catch (Exception ex)
            {
                throw new ArgumentException("\n>> " + TypeName + ".Get Error: " + ex.Message);
            }
        }
Example #14
0
 //##GetTextByAnnex
 private static string GetTextByAnnex(Annex annex, AnnexTextType textType)
 {
     try
     {
         if (annex != null)
         {
             if (textType == AnnexTextType.DisplayName)
             {
                 return(annex.DisplayName);
             }
             else if (textType == AnnexTextType.Description)
             {
                 return(annex.Description);
             }
             else if (textType == AnnexTextType.Body)
             {
                 return(annex.Body);
             }
             else if (textType == AnnexTextType.Remark)
             {
                 return(annex.Remark);
             }
             else if (textType == AnnexTextType.Remark1)
             {
                 return(annex.Remark1);
             }
             else if (textType == AnnexTextType.Remark2)
             {
                 return(annex.Remark2);
             }
             else if (textType == AnnexTextType.Other)
             {
                 return(annex.Other);
             }
         }
         return(string.Empty);
     }
     catch (Exception ex)
     {
         throw new ArgumentException("\n>> " + TypeName + ".GetTextByAnnex Error: " + ex.Message);
     }
 }
Example #15
0
        private static bool IsAGraduationCeremonyInitializedAndIfNecessaryStartOne(Annex ths)
        {
            if (!ths.mGraduationCeremonyInitialized)
            {
                ths.CleanUpGraduationCeremony();
                float time = SimClock.HoursUntil(Annex.kGraduationTuning.kHourToShowGraduationMessage);
                ths.mDidIGraduationMessageAlarm = ths.AddAlarm(time, TimeUnit.Hours, ths.ShowIGraduationMessagesCallback, "Annex: I Graduated Message Alarm", AlarmType.AlwaysPersisted);

                float num2 = SimClock.HoursUntil(Annex.kGraduationTuning.kHourToShowGraduationInvitationMessage);
                ths.mGraduationInvitationAlarm = ths.AddAlarm(num2, TimeUnit.Hours, ths.ShowGraduationInvitationMessagesCallback, "Annex: Graduation Invitation Message Alarm", AlarmType.AlwaysPersisted);

                //float num3 = SimClock.HoursUntil(Annex.kGraduationTuning.kGraduationCeremonyStartHour);
                //ths.mStartGraduationCeremonyAlarm = ths.AddAlarm(num3, TimeUnit.Hours, ths.StartGraduationCeremonyCallback, "Annex: Graduation Ceremony Start Alarm", AlarmType.AlwaysPersisted);
                new StartGraduationCeremonyTask(ths);

                ths.mGraduationCeremonyInitialized = true;
            }

            return(ths.mGraduationCeremonyInitialized);
        }
Example #16
0
        private static bool IsAGraduationCeremonyInitializedAndIfNecessaryStartOne(Annex ths)
        {
            if (!ths.mGraduationCeremonyInitialized)
            {
                ths.CleanUpGraduationCeremony();
                float time = SimClock.HoursUntil(Annex.kGraduationTuning.kHourToShowGraduationMessage);
                ths.mDidIGraduationMessageAlarm = ths.AddAlarm(time, TimeUnit.Hours, ths.ShowIGraduationMessagesCallback, "Annex: I Graduated Message Alarm", AlarmType.AlwaysPersisted);

                float num2 = SimClock.HoursUntil(Annex.kGraduationTuning.kHourToShowGraduationInvitationMessage);
                ths.mGraduationInvitationAlarm = ths.AddAlarm(num2, TimeUnit.Hours, ths.ShowGraduationInvitationMessagesCallback, "Annex: Graduation Invitation Message Alarm", AlarmType.AlwaysPersisted);

                //float num3 = SimClock.HoursUntil(Annex.kGraduationTuning.kGraduationCeremonyStartHour);
                //ths.mStartGraduationCeremonyAlarm = ths.AddAlarm(num3, TimeUnit.Hours, ths.StartGraduationCeremonyCallback, "Annex: Graduation Ceremony Start Alarm", AlarmType.AlwaysPersisted);
                new StartGraduationCeremonyTask(ths);

                ths.mGraduationCeremonyInitialized = true;
            }

            return ths.mGraduationCeremonyInitialized;
        }
Example #17
0
        /// <summary>
        /// 保存附件
        /// </summary>
        /// <param name="id"></param>
        private void SaveAttach(Guid id)
        {
            try
            {
                HttpFileCollection files = HttpContext.Current.Request.Files;
                if (files.Count == 0)
                {
                    NewsContent n = NewsContent.Load(id);
                    n.Annex = 2;//没有附件
                    n.Save();
                }
                else
                {
                    for (int i = 0; i < files.Count; i++)
                    {
                        HttpPostedFile postedFile = files[i];
                        if (postedFile.ContentLength > 20971520)
                        {
                            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('上传附件不能超过20M,附件:" + postedFile.FileName + "上传失败');</script>");
                            return;
                        }
                        else
                        {
                            string fileSHowName = postedFile.FileName;
                            int dotIndex = postedFile.FileName.IndexOf("\\");
                            string fileName = string.Empty;
                            if (dotIndex == -1)
                            {
                                fileName = CY.Utility.Common.FileUtility.GetFileName(postedFile.FileName);//文件名
                            }
                            else
                            {
                                string fileNameTemp = CY.Utility.Common.FileUtility.GetFileName(postedFile.FileName);
                                int indElx = fileNameTemp.LastIndexOf("\\") + 1;
                                fileName = fileNameTemp.Substring(indElx);
                            }
                            //string fileName = CY.Utility.Common.FileUtility.GetFileName(postedFile.FileName);//文件名
                            string fileExtension = CY.Utility.Common.FileUtility.GetFileExtension(postedFile.FileName);//后缀名
                            string appPath = CY.Utility.Common.RequestUtility.CurPhysicalApplicationPath;//绝对路径
                            string dirPath = string.Empty;
                            string httpPath = string.Empty;
                            string annexTypeComon = string.Empty;
                            if (fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == ".gif" || fileExtension == ".png" || fileExtension == ".bmp")
                            {
                                dirPath = appPath + CY.Utility.Common.AnnexUtility.NewsAnnexImgDir;
                                annexTypeComon = CY.Utility.Common.AnnexUtility.ImgAnnexType;
                                httpPath = "/Content/News/Img/";
                            }
                            else if (fileExtension == ".doc" || fileExtension == ".docx" || fileExtension == ".xls" || fileExtension == ".pdf" || fileExtension == ".txt")
                            {
                                dirPath = appPath + CY.Utility.Common.AnnexUtility.NewsAnnexOfficeDir;
                                annexTypeComon = CY.Utility.Common.AnnexUtility.DocAnnexType;
                                httpPath = "/Content/News/Office/";
                            }
                            else if (fileExtension == ".rar" || fileExtension == ".zip")
                            {
                                dirPath = appPath + CY.Utility.Common.AnnexUtility.NewsAnnexRARDir;
                                annexTypeComon = CY.Utility.Common.AnnexUtility.RaRAnneType;
                                httpPath = "/Content/News/RAR/";
                            }
                            else
                            {
                                dirPath = appPath + CY.Utility.Common.AnnexUtility.NewsAnnexOtherDir;
                                annexTypeComon = CY.Utility.Common.AnnexUtility.OtherAnneType;
                                httpPath = "/Content/News/Other/";
                            }
                            System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(dirPath);
                            if (!di.Exists)
                            {
                                di.Create();
                            }
                            string FileName = fileName + DateTime.Now.ToString("yyyyMMddHHmmss") + DateTime.Now.Millisecond.ToString();

                            postedFile.SaveAs(dirPath + "\\" + FileName + fileExtension);
                            AnnexType annexTYPE = AnnexType.SelectAnnexTypeByTypeName(annexTypeComon);
                            Guid typeID = new Guid();
                            if (annexTYPE == null)
                            {
                                AnnexType annexType = new AnnexType();
                                annexType.TypeName = annexTypeComon;
                                annexType.Save();
                                typeID = annexType.Id;
                            }
                            else
                            {
                                typeID = annexTYPE.Id;
                            }
                            Annex annex = new Annex();
                            annex.AnnexTypeID = typeID;
                            annex.ContentType = 1;
                            annex.ContentID = id;
                            annex.Name = fileName;
                            annex.AnnexURI = httpPath + FileName + fileExtension;
                            annex.Save();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                lbErr.Text = ex.Message;
            }
        }
Example #18
0
 public StartGraduationCeremonyTask(Annex ths)
     : base(SimClock.HoursUntil(Annex.kGraduationTuning.kGraduationCeremonyStartHour), TimeUnit.Hours)
 {
     mThs = ths;
 }
Example #19
0
        private void SaveFiles(Guid ContentID)
        {
            HttpFileCollection files = HttpContext.Current.Request.Files;
            for (int i = 0; i < files.Count; i++)
            {
                HttpPostedFile postedFile = files[i];
                if (postedFile.ContentLength > 20971520)
                {
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('上传附件不能超过20M,附件:" + postedFile.FileName + "上传失败');</script>");
                    return;
                }
                else
                {
                    string fileSHowName = postedFile.FileName;
                    int dotIndex = postedFile.FileName.IndexOf("\\");
                    string fileName = string.Empty;
                    if (dotIndex == -1)
                    {
                        fileName = CY.Utility.Common.FileUtility.GetFileName(postedFile.FileName);//文件名
                    }
                    else
                    {
                        string fileNameTemp = CY.Utility.Common.FileUtility.GetFileName(postedFile.FileName);
                        int indElx = fileNameTemp.LastIndexOf("\\") + 1;
                        fileName = fileNameTemp.Substring(indElx);
                    }

                    string fileExtension = CY.Utility.Common.FileUtility.GetFileExtension(postedFile.FileName);//后缀名
                    string appPath = CY.Utility.Common.RequestUtility.CurPhysicalApplicationPath;//绝对路径
                    string dirPath = string.Empty;
                    string httpPath = string.Empty;
                    string annexTypeComon = string.Empty;
                    if (fileExtension == ".jpg" || fileExtension == ".jpeg" || fileExtension == ".gif" || fileExtension == ".png" || fileExtension == ".bmp")
                    {
                        dirPath = appPath + CY.Utility.Common.AnnexUtility.EmailAnnexImgDir;
                        annexTypeComon = CY.Utility.Common.AnnexUtility.ImgAnnexType;
                        httpPath = "../../Content/Email/Img/";
                    }
                    else if (fileExtension == ".doc" || fileExtension == ".docx" || fileExtension == ".xls" || fileExtension == ".pdf" || fileExtension == ".txt")
                    {
                        dirPath = appPath + CY.Utility.Common.AnnexUtility.EmailAnnexDorDir;
                        annexTypeComon = CY.Utility.Common.AnnexUtility.DocAnnexType;
                        httpPath = "../../Content/Email/Doc/";
                    }
                    else if (fileExtension == ".rar" || fileExtension == ".zip")
                    {
                        dirPath = appPath + CY.Utility.Common.AnnexUtility.EmailAnnexRARDir;
                        annexTypeComon = CY.Utility.Common.AnnexUtility.RaRAnneType;
                        httpPath = "../../Content/Email/RAR/";
                    }
                    else
                    {
                        dirPath = appPath + CY.Utility.Common.AnnexUtility.EmailAnnexOtherDir;
                        annexTypeComon = CY.Utility.Common.AnnexUtility.OtherAnneType;
                        httpPath = "../../Content/Email/Other/";
                    }
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(dirPath);
                    if (!di.Exists)
                    {
                        di.Create();
                    }
                    string FileName = fileName + DateTime.Now.ToString("yyyyMMddHHmmss") + DateTime.Now.Millisecond.ToString();
                    postedFile.SaveAs(dirPath + "\\" + FileName + fileExtension);//保存文件
                    Guid typeID=new Guid();
                    AnnexType annexType = AnnexType.SelectAnnexTypeByTypeName(annexTypeComon);
                    if (annexType == null)
                    {
                        AnnexType annexTypeNew = new AnnexType();
                        annexTypeNew.TypeName = annexTypeComon;
                        annexTypeNew.Save();
                        typeID=annexTypeNew.Id;
                    }
                    else
                    {
                        typeID=annexType.Id;
                    }
                    Annex annexSave = new Annex();
                    annexSave.ContentID = ContentID;
                    annexSave.AnnexTypeID = typeID;
                    annexSave.ContentType = 8;//站内信
                    annexSave.Name = fileName;
                    annexSave.AnnexURI = httpPath + FileName + fileExtension;
                    annexSave.Save();
                }
            }
        }
Example #20
0
 public StartGraduationCeremonyTask(Annex ths)
     : base(SimClock.HoursUntil(Annex.kGraduationTuning.kGraduationCeremonyStartHour), TimeUnit.Hours)
 {
     mThs = ths;
 }
Example #21
0
 public Annex[] parseAnnex(ErlList list)
 {
     if (list == null)
     {
         return(null);
     }
     Annex[] annex = new Annex[list.Value.Length];
     for (int i = 0; i < list.Value.Length; i++)
     {
         annex [i] = new Annex();
         string str = ((list.Value [i] as ErlArray).Value [0] as ErlAtom).getValueString();
         if (str == "exp")
         {
             string strs = PrizeType.PRIZE_EXP + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].exp = new PrizeSample(strs, ',');
         }
         else if (str == "rmb")
         {
             string strs = PrizeType.PRIZE_RMB + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].rmb = new PrizeSample(strs, ',');
         }
         else if (str == "money")
         {
             string strs = PrizeType.PRIZE_MONEY + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].money = new PrizeSample(strs, ',');
         }
         else if (str == "pve")
         {
             string strs = PrizeType.PRIZE_PVE + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].pve = new PrizeSample(strs, ',');
         }
         else if (str == "pvp")
         {
             string strs = PrizeType.PRIZE_PVP + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].pvp = new PrizeSample(strs, ',');
         }
         else if (str == "prop")
         {
             string strs = (((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [0]).getValueString() + "," + (((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [1]).getValueString() + "," + (((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [2]).getValueString();
             annex [i].prop = new PrizeSample(strs, ',');
         }
         else if (str == "ladder_score")
         {
             //string strs = (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[0]).getValueString() + "," + (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[1]).getValueString() + "," + (((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[2]).getValueString();
             string strs1 = PrizeType.PRIZE_LEDDER_SCORE + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].ladder = new PrizeSample(strs1, ',');
         }
         else if (str == "contribution")
         {
             string strs1 = PrizeType.PRIZE_CONTRIBUTION + "," + "0" + "," + ((list.Value [i] as ErlArray).Value [1] as ErlType).getValueString();
             annex [i].contribution = new PrizeSample(strs1, ',');
         }
         else if (str == "mounts")
         {
             string strs = PrizeType.PRIZE_MOUNT + "," + ((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [0].getValueString() + "," + ((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [1].getValueString() + "," + ((list.Value [i] as ErlArray).Value [1] as ErlArray).Value [2].getValueString();
             annex [i].mounts = new PrizeSample(strs, ',');
         }
         else if (str == "artifact")
         {
             string strs = PrizeType.PRIZE_MAGIC_WEAPON + "," + ((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[0].getValueString() + "," + ((list.Value[i] as ErlArray).Value[1] as ErlArray).Value[1].getValueString();
         }
     }
     return(annex);
 }