Exemplo n.º 1
0
 public Patron(PatronID id, string name, int rank, HouseID house, bool female, int portrait) : base(name, rank, house)
 {
     this.id = id;
     Directory.Add(id, this);
     NobleHouse.Definitions[house].members.Add(this);
     this.female = female;
     this.sprite = female ? LayoutManager.Main.FemalePortraits[portrait] : LayoutManager.Main.MalePortraits[portrait];
 }
Exemplo n.º 2
0
 public Reward AddReputation(HouseID house, int amount)
 {
     if (!Reputation.ContainsKey(house))
     {
         Reputation.Add(house, 0);
     }
     Reputation[house] += amount;
     return(this);
 }
Exemplo n.º 3
0
    public Citizen(string name, int rank, HouseID house)
    {
        this.name  = name;
        this.house = house;
        this.rank  = rank;

        female = Random.Range(0, 1f) < .5;
        sprite = Util.RandomElement(female ? LayoutManager.Main.FemalePortraits : LayoutManager.Main.MalePortraits);
    }
Exemplo n.º 4
0
    public NobleHouse(HouseID id, string name, Sprite sprite, HouseID opposedHouse)
    {
        this.id           = id;
        this.name         = name;
        this.sprite       = sprite;
        this.opposedHouse = opposedHouse;

        members = new List <Patron>();
        Definitions.Add(id, this);
    }
Exemplo n.º 5
0
    public void GainReputation(HouseID house, int amount)
    {
        Reputation[house] += amount;

        if (Reputation[house] <= 0)
        {
            Engine.LoseGame("YOU HAVE EARNED THE DISPLEASURE OF " + house);
        }

        if (Reputation[house] >= 100)
        {
            Engine.WinGame("YOU HAVE BEEN EXALTED BY " + house);
        }
    }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                myffrmwc.Items.Clear();
                myffrmwc.Items.Add(new ListItem("全部", "2"));
                myffrmwc.Items.Add(new ListItem("未完成", "0"));
                myffrmwc.Items.Add(new ListItem("已完成", "1"));

                string temp = GetMySearchControlValue("wc");
                if (!temp.IsNullOrWhiteSpace())
                {
                    myffrmwc.SelectedValue = temp;
                }
                else
                {
                    myffrmwc.SelectedIndex = 1;
                }

                myffrmlq.Items.Clear();
                myffrmlq.Items.Add(new ListItem("全部", ""));
                myffrmlq.Items.Add(new ListItem("未领取", "0"));
                myffrmlq.Items.Add(new ListItem("已领取", "1"));

                myffrmsh.Items.Clear();
                myffrmsh.Items.Add(new ListItem("全部", ""));
                myffrmsh.Items.Add(new ListItem("未审核", "0"));
                myffrmsh.Items.Add(new ListItem("已审核", "1"));

                FullDropListData(typeof(h_EntrustType), this.myffrmEntrustTypeID, "Name", "EntrustTypeID", "");
            }

            if (CheckRolePermission("修改"))
            {
                z_bottom  = "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=lq&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>领取</span></a></li>";
                z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=qxlq&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>取消领取</span></a></li>";
                z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=wc&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>完成</span></a></li>";
                z_bottom += "<li><a class=\"delete\" href=\"House/HousePicListYY.aspx?doType=del&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要删除吗?\"><span>删除照片</span></a></li>";
                z_bottom += "<li><a class=\"edit\" href=\"House/HouseRemarkAdd.aspx?NavTabId=" + NavTabId + "&doAjax=true&ID={ID}\" rel='Bargain1' width=\"360\" height=\"230\" target=\"dialog\" mask=\"true\"><span>增加备注</span></a></li>";
            }
            if (CheckRolePermission("删除"))
            {
                z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?doType=sh&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\"><span>审核</span></a></li>";
            }
            if (CheckRolePermission("驳回"))
            {
                z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?doType=bh&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要驳回吗?\"><span>驳回</span></a></li>";
            }

            #region 执行操作
            if (Request.QueryString["doType"] != null)
            {
                //领取
                if (Request.QueryString["doType"].ToString() == "lq")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            //摄影师以提示已经领取任务
                            if (hfa.Photographer != null)
                            {
                                Response.Write("<script>alertMsg.error(\"任务已被领取,不可在领!\")</script>");
                                Response.End();
                            }
                            else
                            {
                                hfa.Photographer = int.Parse(Current.EmployeeID.ToString());
                                hfa.PotoOrg      = int.Parse(Current.OrgID.ToString());
                                hfa.Update();
                            }
                        }
                    }
                }
                //取消领取
                else if (Request.QueryString["doType"].ToString() == "qxlq")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            hfa.Photographer = null;
                            hfa.PotoOrg      = null;
                            hfa.Update();
                        }
                    }
                }
                //完成
                else if (Request.QueryString["doType"].ToString() == "wc")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            //完成时间更新
                            hfa.Finishtime = DateTime.Now;
                            hfa.Update();
                        }
                    }
                }
                else if (Request.QueryString["doType"].ToString() == "del")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        h_PicList           hp;
                        string HouseID;

                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            HouseID = hfa.HouseID.ToString();
                            //删除全部照片
                            List <h_PicList> list_h_PicList = h_PicList.FindAllByHouseID(HouseID.ToDecimal().Value);

                            foreach (h_PicList item in list_h_PicList)
                            {
                                h_PicListDel list_h_PicListDel = new h_PicListDel();
                                list_h_PicListDel.ComID         = item.ComID;
                                list_h_PicListDel.EmployeeID    = item.EmployeeID;
                                list_h_PicListDel.Exe_date      = item.exe_date;
                                list_h_PicListDel.HouseID       = item.HouseID;
                                list_h_PicListDel.PicTypeID     = item.PicTypeID;
                                list_h_PicListDel.PicURL        = item.PicURL;
                                list_h_PicListDel.OrgID         = item.OrgID;
                                list_h_PicListDel.DelEmployeeID = Current.EmployeeID.ToInt32();
                                list_h_PicListDel.DelOrgID      = Current.OrgID.ToInt32();
                                list_h_PicListDel.DelDate       = DateTime.Now;
                                list_h_PicListDel.Insert();
                            }

                            DbHelperSQL.ExecuteSql("delete from h_PicList where PicTypeID!=9 and HouseID= " + HouseID);

                            H_houseinfor.Update("HasImage=0", "HouseID=" + HouseID);

                            Log log1 = new Log();
                            log1.Action    = "删除";
                            log1.Category  = "删除房源照片";
                            log1.IP        = HttpContext.Current.Request.UserHostAddress;
                            log1.OccurTime = DateTime.Now;
                            log1.UserID    = Convert.ToInt32(Employee.Current.EmployeeID);
                            log1.UserName  = Employee.Current.Em_name;
                            log1.Remark    = "房源ID=" + HouseID;
                            log1.Insert();
                        }

                        StringBuilder sb1 = new StringBuilder();
                        sb1.Append("<script>alertMsg.correct(\"操作成功!\")</script>");
                        Response.Write(sb1.ToString());
                        Response.End();
                    }
                }
                //驳回
                else if (Request.QueryString["doType"].ToString() == "bh")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            hfa.Delete();
                        }
                    }
                }
                //审核
                else if (Request.QueryString["doType"].ToString() == "sh")
                {
                    if (!string.IsNullOrEmpty(Request["ids"]))
                    {
                        string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]);
                        List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql);
                        foreach (h_PicList_YY hfa in list_h_PicList_YY)
                        {
                            if (hfa.IsCheck == 1)
                            {
                                hfa.IsCheck = 0;
                            }
                            else
                            {
                                hfa.IsCheck = 1;
                            }
                            hfa.Update();
                        }
                    }
                }

                #region 刷新当前页[抓取当页导航数字onclick事件]

                string JavaScript = " dwzPageBreak({ targetType: \"navTab\", rel: \"\", data: { pageNum: " + Request["selectPage"] + "} });";
                JSDo_UserCallBack_Success(JavaScript, "操作成功");

                #endregion 刷新当前页[抓取当页导航数字onclick事件]
            }
            #endregion
        }
Exemplo n.º 7
0
 public Wizard(string name, int skill, int rank, HouseID house) : base(name, rank, house)
 {
     SpellsKnown = new List <SpellID>();
     Scrolls     = new List <SpellID>();
     this.skill  = skill;
 }