Exemplo n.º 1
0
 public void BuildPacket(ref UpdateClass uc)
 {
     foreach (var itm in Backpack.Items.Values)
     {
         uc.UpdateValue <ulong>(PlayerFields.PLAYER_FIELD_INV_SLOT_1, itm.Guid, (int)(itm.CurrentSlot * 2));
     }
 }
Exemplo n.º 2
0
        public IHttpActionResult Update(UpdateClass model)
        {
            IHttpActionResult httpActionResult;
            ErrorsModel       errors = new ErrorsModel();

            Classes l = this._db.Classes.FirstOrDefault(x => x.Id == model.Id);

            if (l == null)
            {
                errors.Add("Id lớp không tồn tại");

                httpActionResult = new ErrorActionResult(Request, System.Net.HttpStatusCode.NotFound, errors);
            }
            else
            {
                l.Code            = model.Code ?? model.Code;
                l.Name            = model.Name ?? model.Name;
                l.HomeroomTeacher = _db.Teachers.FirstOrDefault(x => x.Id == model.HomeroomTeacher_Id) ?? _db.Teachers.FirstOrDefault(x => x.Id == model.HomeroomTeacher_Id);
                l.Teacher         = _db.Teachers.FirstOrDefault(x => x.Id == model.Teacher_Id) ?? _db.Teachers.FirstOrDefault(x => x.Id == model.Teacher_Id);

                this._db.Entry(l).State = System.Data.Entity.EntityState.Modified;

                this._db.SaveChanges();

                httpActionResult = Ok(new ClassModel(l));
            }

            return(httpActionResult);
        }
Exemplo n.º 3
0
 public virtual void Setup()
 {
     _existingClass = new Class
     {
         Name      = "old",
         StartTime = DateTime.MaxValue,
         EndTime   = DateTime.MaxValue,
         Teachers  = new List <Teacher>
         {
             new Teacher {
                 Id = 1
             }
         }
     };
     _action = new UpdateClass(new Class
     {
         Name      = "new",
         StartTime = DateTime.MinValue.AddYears(1).Date,
         EndTime   = DateTime.MinValue.AddYears(1).Date,
         Teachers  = new List <Teacher>
         {
             new Teacher {
                 Id = 1
             }
         }
     });
     _repositoryBuilder = new MockRepositoryBuilder <Class>()
                          .WithGet(_existingClass)
                          .WithUpdate();
     _teacherRepositoryBuilder = new MockRepositoryBuilder <Teacher>()
                                 .WithSuccessfulGet();
 }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="baseType"></param>
        /// <param name="newType">si no se especifica se pasarán los valores de las propiedades (con el mismo nombre y tipo) de la vieja a la nueva</param>
        /// <param name="methodUpdate">se necesita que el anterior parametro no sea null ni este para que sea valido, en caso de no serlo se usará el metodo por reflexión por defecto</param>
        public OldVersion(Type baseType, Type newType = null, string methodUpdate = null)
        {
            UpdateClass updateClass = new UpdateClass(newType, methodUpdate);

            Base = baseType;
            if (updateClass.Valid)
            {
                UpdateMethod = updateClass.UpdateMethod;
            }
            else
            {
                UpdateMethod = (oldObj, newObj) => {
                    SortedList <string, System.Reflection.PropertyInfo> dicOld = new SortedList <string, System.Reflection.PropertyInfo>();
                    System.Reflection.PropertyInfo[] properties = oldObj.GetType().GetProperties();
                    for (int i = 0; i < properties.Length; i++)
                    {
                        dicOld.Add(properties[i].Name, properties[i]);
                    }
                    properties = newObj.GetType().GetProperties();
                    for (int i = 0; i < properties.Length; i++)
                    {
                        if (dicOld.ContainsKey(properties[i].Name) && dicOld[properties[i].Name].PropertyType.Name == properties[i].PropertyType.Name)
                        {
                            properties[i].SetValue(newObj, dicOld[properties[i].Name].GetValue(oldObj));
                        }
                    }
                    return(newObj);
                };
            }
        }
 private AudioSession(Utilities.NativeMethods.IAudioSessionControl2 ctl, Utilities.NativeMethods.ISimpleAudioVolume sav)
 {
     _ctl          = ctl;
     _sav          = sav;
     classInstance = new UpdateClass(this);
     Marshal.ThrowExceptionForHR(_ctl.RegisterAudioSessionNotification(classInstance));
 }
Exemplo n.º 6
0
    /// <summary>
    /// 收货地址
    /// </summary>
    private void vipAddr()
    {
        string number = Q("m");
        string recName = R("recName"), ddlCity = R("ddlCity"), adrDetail = R("adr-detail"), postcode = R("postcode"), mobile = R("mobile"), phone = R("phone");
        string check = DBHelp.fr_string("select [receN] from [e_address] where [upid]='" + number + "'");

        string[] Text  = { "Number", "upid", "receN", "receA", "receAD", "Code", "Mobile", "Phone" };
        string[] Value = { IdNumber.NumberSec("e_address", "ar"), number, recName, ddlCity, adrDetail, postcode, mobile, phone };
        if (!string.IsNullOrEmpty(check))
        {
            if (UpdateClass.fromUpdate("e_address", Text, Value, "[upid]='" + number + "'"))
            {
                Write("Xerror|1|保存成功");
            }
            else
            {
                Write("Xerror|0|保存失败");
            }
        }
        else
        {
            if (AddClass.fromAdd("e_address", Text, Value))
            {
                Write("Xerror|1|保存成功");
            }
            else
            {
                Write("Xerror|0|保存失败");
            }
        }
    }
Exemplo n.º 7
0
 /// <summary>
 /// 增加和修改
 /// </summary>
 protected void Bu_Click()
 {
     if (!string.IsNullOrEmpty(this.lblID.Text))
     {
         if (UpdateClass.fromUpdate("e_navigation", "title|sitetitle|Keywords|Description|url", this.form1, " [Number]='" + this.lblID.Text + "'"))
         {
             jsFontcion.Cleload();
         }
         else
         {
             jsFontcion.ResponseW("修改操作出错");
         }
     }
     else
     {
         int      stat   = config.Sort_max("select max(Stat) from [e_navigation]");
         string   Number = IdNumber.NumberSman("e_navigation", "N");
         string   upid   = this.title.Text == "首页" ? "1" : "0";
         string[] Text   = { "Number", "upid", "Stat" };
         string[] Value  = { Number, upid, stat.ToString() };
         if (AddClass.fromAdd("e_navigation", "title|sitetitle|Keywords|Description|url", Text, Value, this.form1))
         {
             jsFontcion.Cleload();
         }
         else
         {
             jsFontcion.ResponseW("添加操作出错");
         }
     }
 }
Exemplo n.º 8
0
    /// <summary>
    /// 显示购物车数据
    /// </summary>
    protected void cart()
    {
        string number = Request.Cookies["userSett"]["number"];
        string emid = Q("emid"), count = Q("count");

        string[] gdInfo = DBHelp.frS_string("select [emid],[title],[price],[ImgS] from [e_goods] where [emid]='" + emid + "'");

        string[] Text  = { "Number", "upid", "emid", "title", "price", "ImgS", "count" };
        string[] value = { IdNumber.NumberSec("e_cart", "ca"), number, emid, gdInfo[1], gdInfo[2], gdInfo[3], count };
        string   ck    = DBHelp.fr_string("select [Number] from [e_cart] where [emid]='" + emid + "'");

        if (!string.IsNullOrEmpty(ck))
        {
            if (UpdateClass.fromUpdate("e_cart", Text, value, "[emid]='" + emid + "'"))
            {
                Write("Xerror|2|已加入购物车");
            }
            else
            {
                Write("Xerror|0|加入购物车出错");
            }
        }
        else
        {
            if (AddClass.fromAdd("e_cart", Text, value))
            {
                Write("Xerror|1|已加入购物车");
            }
            else
            {
                Write("Xerror|0|加入购物车出错");
            }
        }
    }
Exemplo n.º 9
0
 public CoinQueue(Instruments instrument)
 {
     this.Instrument     = instrument;
     Updater             = new UpdateClass();
     this.MinuteInterval = 60 * 24 * 2;
     Start();
 }
Exemplo n.º 10
0
        public override PacketWriter BuildUpdate(UpdateTypes type = UpdateTypes.UPDATE_PARTIAL, bool self = false)
        {
            PacketWriter packet = CreateObject(false);
            UpdateClass  uc     = new UpdateClass();

            uc.UpdateValue <ulong>(ObjectFields.OBJECT_FIELD_GUID, this.Guid);
            uc.UpdateValue <uint>(ObjectFields.OBJECT_FIELD_TYPE, (uint)this.ObjectType);
            uc.UpdateValue <uint>(ObjectFields.OBJECT_FIELD_ENTRY, this.Entry);
            uc.UpdateValue <float>(ObjectFields.OBJECT_FIELD_SCALE_X, this.Scale);
            uc.UpdateValue <uint>(ObjectFields.OBJECT_FIELD_PADDING, 0);
            uc.UpdateValue <uint>(GameObjectFields.GAMEOBJECT_DISPLAYID, Template.DisplayId);
            uc.UpdateValue <uint>(GameObjectFields.GAMEOBJECT_FLAGS, Template.Flags);
            uc.UpdateValue <uint>(GameObjectFields.GAMEOBJECT_FACTION, Template.Faction);
            uc.UpdateValue <uint>(GameObjectFields.GAMEOBJECT_STATE, (uint)State);

            for (int i = 0; i < 4; i++)
            {
                uc.UpdateValue <float>(GameObjectFields.GAMEOBJECT_ROTATION, Rotation[i], i);
            }

            uc.UpdateValue <float>(GameObjectFields.GAMEOBJECT_POS_X, this.Location.X);
            uc.UpdateValue <float>(GameObjectFields.GAMEOBJECT_POS_Y, this.Location.Y);
            uc.UpdateValue <float>(GameObjectFields.GAMEOBJECT_POS_Z, this.Location.Z);
            uc.UpdateValue <float>(GameObjectFields.GAMEOBJECT_FACING, this.Orientation);
            uc.BuildPacket(ref packet, true);
            return(packet);
        }
Exemplo n.º 11
0
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;

        if (string.IsNullOrEmpty(Number))
        {
            Number = IdNumber.NumberSec("e_member", "m");
        }
        string Pass = this.Password.Text;

        if (string.IsNullOrEmpty(Pass))
        {
            Pass = Vr[2];
        }
        else
        {
            Pass = ask.Web.EncryptHelper.Encrypt(Pass);
        }
        string Imgad = string.Empty;

        if (!string.IsNullOrEmpty(this.FImgS.FileName))
        {
            Imgad = shopfile.FileGet(this.FImgS, "bxite-" + Number, "~/upload/vip", 50000000);
        }
        else
        {
            Imgad = ImgS.Text;
        }
        string T = "NickName|Birth|Mobile|RealName|Email|Address|Content|Lotimes";

        string[] Text  = { "Number", "Name", "Password", "Sex", "UserPic" };
        string[] Value = { Number, R("Name"), Pass, R("Sex"), Imgad };
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_member", T, "CloseS", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            if (AddClass.fromAdd("e_member", T, "CloseS", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Exemplo n.º 12
0
        public static void BuildSkillUpdate(this Player p, ref UpdateClass uc)
        {
            int inc = 0;

            foreach (MirrorSkillInfo skill in p.Skills.Values)
            {
                uc.UpdateValue <uint>(PlayerFields.PLAYER_SKILL_INFO_1_1, ByteConverter.ConvertToUInt32(skill.m_skillLineID, skill.m_skillRank), inc * 3);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_SKILL_INFO_1_1, ByteConverter.ConvertToUInt32(new object[] { GetMaxRank(p, skill), skill.m_skillModifier }), (inc * 3) + 1);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_SKILL_INFO_1_1, ByteConverter.ConvertToUInt32(skill.m_skillStep, skill.m_padding), (inc * 3) + 2);
                inc++;
            }
        }
Exemplo n.º 13
0
        public PacketWriter UpdateObject(ref UpdateClass uc)
        {
            PacketWriter packet = new PacketWriter(Opcodes.SMSG_UPDATE_OBJECT);

            packet.WriteUInt32(1); //Number of transactions
            packet.WriteUInt8(0);
            packet.WriteUInt64(Guid);
            packet.WriteUInt8(GetUpdateMask());
            packet.WriteBytes(uc.GetMask());   //Mask of updated fields
            uc.BuildPacket(ref packet, false); //Only appends updated values
            return(packet);
        }
Exemplo n.º 14
0
        public IActionResult Edit(UpdateClass model)
        {
            if (ModelState.IsValid)
            {
                if (classRepository.UpdateClass(model) > 0)
                {
                    return(RedirectToAction("Index", "Class"));
                }
                ModelState.AddModelError("", "System error, please try again later!");
            }
            var classEdit = new UpdateClass();

            return(View(classEdit));
        }
        public async Task <object> Put(UpdateClass request)
        {
            var response = new BaseResponse();
            Expression <Func <Class, bool> > keySelector = x => x.Id == request.Id;
            var entity = await _classService.GetById(keySelector : keySelector);

            request.ToEntity(entity);
            var result = await _classService.Update(entity);

            response.Success    = true;
            response.Message    = "Update class success";
            response.StatusCode = (int)HttpStatusCode.OK;
            response.Results    = result.ConvertTo <ClassDto>();
            return(response);
        }
Exemplo n.º 16
0
        public int UpdateClass(UpdateClass model)
        {
            var classes = GetClass(model.ClassId);

            if (classes == null)
            {
                return(-1);
            }
            classes.ClassName = model.ClassName;
            classes.MajorId   = model.MajorId;
            classes.CourseId  = model.CourseId;
            classes.SubjectId = model.SubjectId;

            context.Update(classes);
            return(context.SaveChanges());
        }
Exemplo n.º 17
0
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;

        if (string.IsNullOrEmpty(Number))
        {
            Number = IdNumber.NumberSman("e_ads_flash", "A");
        }
        string Imgad = string.Empty;

        if (!string.IsNullOrEmpty(this.FImgS.FileName))
        {
            Imgad = shopfile.FileGet(this.FImgS, "bxite-" + Number, "~/upload/ads_flash", 50000000);
        }
        else
        {
            Imgad = ImgS.Text;
        }
        string[] Text  = { "ImgS", "Description" };
        string[] Value = { Imgad, Description.Text };
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_ads_flash", "title|url", "CloseS|Reded", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                Cleload(this.lblID.Text);
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            int stat = config.Sort_max("select max(Stat) from [e_ads_flash] ");
            Text  = new string[] { "Number", "ImgS", "Description", "Stat" };
            Value = new string[] { Number, Imgad, Description.Text, stat + "" };
            if (AddClass.fromAdd("e_ads_flash", "title|url", "CloseS|Reded", Text, Value, this.form1))
            {
                Cleload(Number);
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
        private void materialRaisedButtonGüncelle_Click(object sender, EventArgs e)
        {
            Film        komedi = new Film();
            UpdateClass update = new UpdateClass();

            komedi.filmAdi   = txt_filmAd.Text;
            komedi.icerik    = txt_filmİcer.Text;
            komedi.tarih     = txt_cikiisYili.Text;
            komedi.imdbPuani = Convert.ToSingle(txt_imdbPuani.Text);

            int idK = (int)cmb_kategorisi.SelectedValue;
            int idD = (int)cmn_dili.SelectedValue;

            update.FilmGüncelle(komedi, idD, idK, Convert.ToInt32(film_id.Text));

            MessageBox.Show("Güncelleme işlemi başarıyla gerçekleştirildi");
        }
Exemplo n.º 19
0
    /// <summary>
    /// 增加和修改
    /// </summary>
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;
        string Grade  = "0";

        if (this.DropDupid.SelectedValue != "0")
        {
            int F = 0;
            int.TryParse(LGrade.Text, out F);
            F     = F + 1;
            Grade = F.ToString();
        }
        string[] Text  = { "upid", "Grade" };
        string[] Value = { this.DropDupid.SelectedValue, Grade };
        if (string.IsNullOrEmpty(Number))
        {
            Number = Useid.Number("e_helplist", 4, "H");
        }
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_helplist", "title", "CloseS", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            string upid = this.DropDupid.SelectedValue;
            int    stat = config.Sort_max("select max(Stat) from [e_helplist] where upid='" + upid + "'");
            Text  = new string[] { "upid", "Grade", "Number", "Stat" };
            Value = new string[] { upid, Grade, Number, stat.ToString() };
            if (AddClass.fromAdd("e_helplist", "title", "CloseS", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Exemplo n.º 20
0
    /// <summary>
    /// 增加和修改
    /// </summary>
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;

        if (string.IsNullOrEmpty(Number))
        {
            Number = Useid.Number("e_goods_cate", 8, "C");
        }
        string Grade = "0";

        if (this.DropDupid.SelectedValue != "0")
        {
            int F = 0;
            int.TryParse(LGrade.Text, out F);
            F     = F + 1;
            Grade = F.ToString();
        }
        string[] Text  = { "upid", "Grade" };
        string[] Value = { this.DropDupid.SelectedValue, Grade };
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_goods_cate", "title|sitetitle|Keywords|Description", "CloseS|Reded|top", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            int stat = config.Sort_max("select max(Stat) from [e_goods_cate] where [upid]='" + this.DropDupid.SelectedValue + "'");
            Text  = new string[] { "upid", "Number", "Stat", "Grade" };
            Value = new string[] { this.DropDupid.SelectedValue, Number, stat.ToString(), Grade };
            if (AddClass.fromAdd("e_goods_cate", "title|sitetitle|Keywords|Description", "CloseS|Reded|top", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Exemplo n.º 21
0
        public IActionResult Edit(int id)
        {
            var classes   = classRepository.GetClass(id);
            var editClass = new UpdateClass();

            if (classes != null)
            {
                editClass.ClassId   = classes.ClassId;
                editClass.ClassName = classes.ClassName;
                editClass.MajorId   = classes.MajorId;
                editClass.CourseId  = classes.CourseId;
                editClass.SubjectId = classes.SubjectId;
                editClass.Majors    = classRepository.GetMajors();
                editClass.Course    = classRepository.GetCourses();
                editClass.Subject   = classRepository.GetSubjects();
            }
            return(View(editClass));
        }
Exemplo n.º 22
0
 private void updateWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         UpdateClass update     = new UpdateClass();
         bool        newVersion = update.HasNewVersion;
         if (newVersion)
         {
             if (MessageDxUtil.ShowYesNoAndTips("有新的版本,是否需要更新") == DialogResult.Yes)
             {
                 Process.Start(Path.Combine(Application.StartupPath, "Updater.exe"), "121");
                 Application.Exit();
             }
         }
     }
     catch (Exception ex)
     {
         MessageDxUtil.ShowError(ex.Message);
     }
 }
Exemplo n.º 23
0
        public override PacketWriter BuildUpdate(UpdateTypes type = UpdateTypes.UPDATE_PARTIAL, bool self = false)
        {
            //Send update packet
            PacketWriter writer = CreateObject(false);
            UpdateClass  uc     = new UpdateClass();

            //Object Fields
            uc.UpdateValue <ulong>(ObjectFields.OBJECT_FIELD_GUID, this.Guid);
            uc.UpdateValue <uint>(ObjectFields.OBJECT_FIELD_TYPE, (uint)this.ObjectType); // UpdateType, 0x9 - (Unit + Object)
            uc.UpdateValue <uint>(ObjectFields.OBJECT_FIELD_ENTRY, this.Entry);
            uc.UpdateValue <float>(ObjectFields.OBJECT_FIELD_SCALE_X, this.Scale);

            //Unit Fields
            uc.UpdateValue <uint>(UnitFields.UNIT_CHANNEL_SPELL, this.ChannelSpell);
            uc.UpdateValue <ulong>(UnitFields.UNIT_FIELD_CHANNEL_OBJECT, this.ChannelSpell);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_HEALTH, this.Health.Current);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_MAXHEALTH, this.Health.Maximum);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_LEVEL, this.Template.Level.Maximum);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_FACTIONTEMPLATE, this.Template.FactionA);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_FLAGS, this.Template.UnitFlags);
            uc.UpdateValue <float>(UnitFields.UNIT_FIELD_BASEATTACKTIME, this.Template.AttackTime); //Main hand
            uc.UpdateValue <float>(UnitFields.UNIT_FIELD_BASEATTACKTIME, 0f, 1);                    //Offhand
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Armor.BaseAmount);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Holy.BaseAmount, 1);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Fire.BaseAmount, 2);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Nature.BaseAmount, 3);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Frost.BaseAmount, 4);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_RESISTANCES, this.Template.Shadow.BaseAmount, 5);
            uc.UpdateValue <float>(UnitFields.UNIT_FIELD_BOUNDINGRADIUS, this.Template.BoundingRadius);
            uc.UpdateValue <float>(UnitFields.UNIT_FIELD_COMBATREACH, this.Template.CombatReach);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_DISPLAYID, this.Template.ModelID);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_COINAGE, this.Money);
            uc.UpdateValue <float>(UnitFields.UNIT_MOD_CAST_SPEED, 1f);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_DAMAGE, ByteConverter.ConvertToUInt32((ushort)this.Template.Damage.Current, (ushort)this.Template.Damage.Maximum));
            uc.UpdateValue <uint>(UnitFields.UNIT_DYNAMIC_FLAGS, this.DynamicFlags);
            uc.UpdateValue <uint>(UnitFields.UNIT_FIELD_BYTES_1, ByteConverter.ConvertToUInt32(this.StandState, this.NPCFlags, 0, 0));
            uc.BuildPacket(ref writer, true);

            writer.Compress();
            return(writer);
        }
Exemplo n.º 24
0
    protected void btn_preview_Click(object sender, EventArgs e)
    {
        string Imgad  = string.Empty;
        string Number = Request.Cookies["userSett"]["number"];

        if (!string.IsNullOrEmpty(this.FImgS.FileName))
        {
            Imgad = shopfile.FileGet(this.FImgS, "bxite-" + Number, "~/upload/vip", 50000000);
            if (UpdateClass.fromUpdate("e_member", new string[] { "UserPic" }, new string[] { Imgad }, "[Number]='" + Number + "'"))
            {
                this.tips.Text = "修改成功";
            }
            else
            {
                this.tips.Text = "修改出错,请重试";
            }
        }
        else
        {
            this.tips.Text = "请先选择图片";
        }
    }
Exemplo n.º 25
0
    protected void vipPost()
    {
        string nickn = R("nickn"), sex = R("sex"), year = R("year"), month = R("month"), ddlCity = R("ddlCity"),
               mobile = R("mobile"), email = R("email"), Content = R("Content");
        string number = Q("m");

        string[] Text  = { "NickName", "Sex", "Birth", "Mobile", "Email", "Address", "Content" };
        string[] Value = { nickn, sex, year + "/" + month, mobile, email, ddlCity, Content };
        if (UpdateClass.fromUpdate("e_member", Text, Value, "[Number]='" + number + "'"))
        {
            //更新cookies
            HttpCookie myCook = Request.Cookies["userSett"];
            myCook.Values.Set("nickname", nickn);
            Response.AppendCookie(myCook);

            Write("Xerror|1|修改成功");
        }
        else
        {
            Write("Xerror|0|修改出错");
        }
    }
Exemplo n.º 26
0
        public static void BuildQuestUpdate(this Player p, ref UpdateClass uc)
        {
            int i = 0;

            foreach (Quest quest in p.Quests.Values)
            {
                if (quest.Status == QuestStatuses.QUEST_STATUS_COMPLETE && quest.Rewarded)
                {
                    continue;
                }

                QuestTemplate template = Database.QuestTemplates.TryGet(quest.QuestId);

                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, quest.QuestId, i * 6);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, 0, (i * 6) + 1);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, 0, (i * 6) + 2);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, quest.GetProgress(), (i * 6) + 3);
                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, 0, (i * 6) + 4); //m_questFailureTime
                uc.UpdateValue <uint>(PlayerFields.PLAYER_QUEST_LOG_1_1, 0, (i * 6) + 5); //m_qtyMonsterToKill
                i++;
            }
        }
Exemplo n.º 27
0
    /// <summary>
    /// 增加和修改
    /// </summary>
    protected void Bu_Click()
    {
        string Number = this.lblID.Text;

        if (string.IsNullOrEmpty(Number))
        {
            Number = IdNumber.NumberSman("e_keydata", "K");
        }


        string[] Text  = { "num" };
        string[] Value = { R("num") };
        if (!string.IsNullOrEmpty(this.lblID.Text))
        {
            if (UpdateClass.fromUpdate("e_keydata", "keywords", "CloseS|Reded|hot", Text, Value, this.form1, " [Number]='" + this.lblID.Text + "'"))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("修改操作出错");
            }
        }
        else
        {
            int stat = config.Sort_max("select max(Stat) from [e_keydata]");
            Text  = new string[] { "Number", "Stat", "num", "keydate", "UserHostAddress", "UserHostName" };
            Value = new string[] { Number, stat.ToString(), R("num"), DateTime.Now.ToShortDateString(), Request.UserHostAddress, Request.UserHostName };
            if (AddClass.fromAdd("e_keydata", "keywords", "CloseS|Reded|hot", Text, Value, this.form1))
            {
                jsFontcion.Cleload();
            }
            else
            {
                jsFontcion.ResponseW("添加操作出错");
            }
        }
    }
Exemplo n.º 28
0
    protected void vipPwd()
    {
        string number = Q("m");
        string pwd = R("pwd"), newpwd = R("newpwd"), newpwd2 = R("newpwd2");
        string Pass = DBHelp.fr_string("select [Password] from [e_member] where [Number]='" + number + "'");

        //密码加密
        pwd = ask.Web.EncryptHelper.Encrypt(pwd);
        if (pwd != Pass)
        {
            Write("Xerror|2|旧密码错误"); return;
        }
        if (newpwd != newpwd2)
        {
            Write("Xerror|2|新密码不一致"); return;
        }

        newpwd = ask.Web.EncryptHelper.Encrypt(newpwd);
        if (UpdateClass.fromUpdate("e_member", new string[] { "Password" }, new string[] { newpwd }, "[Number]='" + number + "'"))
        {
            //更新cookies
            if (Request.Cookies["uremember"] != null)
            {
                HttpCookie myReme = Request.Cookies["uremember"];
                myReme.Values.Set("password", newpwd);
                Response.AppendCookie(myReme);
            }
            HttpCookie myUser = Request.Cookies["userSett"];
            myUser.Values.Set("password", newpwd);
            Response.AppendCookie(myUser);

            Write("Xerror|1|修改成功");
        }
        else
        {
            Write("Xerror|0|修改出错");
        }
    }
Exemplo n.º 29
0
        private void updateWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            UpdateClass update = new UpdateClass();

            try
            {
                bool newVersion = update.HasNewVersion;
                if (newVersion)
                {
                    if (MessageDxUtil.ShowYesNoAndTips("有新的版本,是否需要更新") == DialogResult.Yes)
                    {
                        Process.Start(Path.Combine(Application.StartupPath, "Updater.exe"), "121");
                        Application.Exit();
                    }
                }
            }
            catch (Exception ex)
            {
                AlertInfo info = new AlertInfo("主动更新提示", ex.Message);
                alerter.ShowToolTips = true;
                alerter.Show(this, info);
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// 批量执行更新Sql
 /// </summary>
 /// <param name="str_msg"></param>
 /// <param name="arr2_values"></param>
 /// <param name="arr_orgid"></param>
 /// <param name="str_DbName"></param>
 /// <param name="str_conditionName"></param>
 /// <param name="str_orgconditionname"></param>
 /// <returns></returns>
 private bool UpdateBseDir(out string str_msg, List <string[]> arr2_values, string[] arr_orgid, string str_DbName, string[] arr_conditionName, string str_orgconditionname)
 {
     try
     {
         if (arr2_values[0].Length != arr_conditionName.Length && arr2_values.Count() != arr_orgid.Count())
         {
             str_msg = " Array Count Is Not equal";
             return(false);
         }
         List <string> arr_strSql = new List <string>();
         for (int i = 0; i < arr2_values.Count; i++)
         {
             UpdateClass _updateValues = new UpdateClass();
             _updateValues.DbName = str_DbName;
             string[] arr_orgcondition = { str_orgconditionname };
             string[] arr_orgvalues    = { arr_orgid[i] };
             _updateValues.arr_orgConditions = arr_orgcondition.ToList();
             _updateValues.arr_conditions    = arr_conditionName.ToList();
             _updateValues.arr_orgValues     = arr_orgvalues.ToList();
             _updateValues.arr_values        = arr2_values[i].ToList();
             if (_updateValues.UpdateOpr(out str_msg))
             {
                 arr_strSql.Add(str_msg);
             }
             else
             {
                 return(false);
             }
         }
         return(ExecOpr(out str_msg, arr_strSql));
     }
     catch (Exception ex)
     {
         str_msg = ex.Message;
         return(false);
     }
 }