Esempio n. 1
0
    protected void btnLogin_Click1(object sender, EventArgs e)
    {
        int id = CommonMethod.ConvertToInt(Request["id"], 0);

        if (id > 0)
        {
            XiHuan_UserGoodsChangeRequireEntity require = new XiHuan_UserGoodsChangeRequireEntity();
            require.Id = id;
            require.Retrieve();
            if (require.IsPersistent)
            {
                require.Flag = byte.Parse(rbtFlag.SelectedValue);
                require.Save();
                string ids = CommonMethod.FinalString(require.SelectToChangeGoodsId).Length > 0 ? require.SelectToChangeGoodsId + require.GoodsId.ToString() : require.GoodsId.ToString();
                Query.ProcessSqlNonQuery(string.Format("update XiHuan_UserGoods set GoodState=" + rbtFlag.SelectedValue.Trim() + " where Id in ({0}) ", ids), GlobalVar.DataBase_Name);
                XiHuan_UserGoodsEntity goods = new XiHuan_UserGoodsEntity();
                goods.Id = require.GoodsId;
                goods.Retrieve();
                if (goods.IsPersistent)
                {
                    CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + goods.Id, goods.DetailUrl);
                }
                Alert("恭喜:状态更改成功!");
                ExecScript("parent.location='userequst.aspx?type=" + Request["type"] + "'");
            }
        }
    }
Esempio n. 2
0
    protected void lnkDelMultiMessage_Click(object sender, EventArgs e)
    {
        string[] mid = hidId.Value.Trim().TrimEnd(',').Split(',');
        if (mid.Length > 0)
        {
            for (int i = 0; i < mid.Length; i++)
            {
                int id = CommonMethod.ConvertToInt(mid[i], 0);
                if (id > 0)
                {
                    XiHuan_UserGoodsChangeRequireEntity note = new XiHuan_UserGoodsChangeRequireEntity();
                    note.Id = id;
                    note.Retrieve();
                    if (note.IsPersistent && note.Flag == (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.新发起)
                    {
                        if (hidType.Value.Trim().Equals("Send"))
                        {
                            note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.已取消;
                        }
                        else
                        {
                            note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.考虑中;
                        }
                        note.Save();
                        XiHuan_UserGoodsEntity goods = new XiHuan_UserGoodsEntity();
                        goods.Id = note.GoodsId;
                        goods.Retrieve();
                        if (goods.IsPersistent)
                        {
                            CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + note.GoodsId, goods.DetailUrl);
                        }
                    }
                }
            }

            Alert("恭喜:操作成功!");
            if (CommonMethod.FinalString(Request["type"]) == "receive")
            {
                BindReceive();
            }
            else
            {
                BindSend();
            }
        }
    }
Esempio n. 3
0
    protected void lnkDelMessage_Click(object sender, EventArgs e)
    {
        int id = CommonMethod.ConvertToInt(hidId.Value, 0);

        if (id > 0)
        {
            XiHuan_UserGoodsChangeRequireEntity note = new XiHuan_UserGoodsChangeRequireEntity();
            note.Id = id;
            note.Retrieve();
            if (note.IsPersistent)
            {
                if (CommonMethod.FinalString(Request["type"]) == "receive")
                {
                    if (note.Flag != (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.已取消)
                    {
                        if (hidType.Value.Trim() != "Ref")
                        {
                            string ids = (CommonMethod.FinalString(note.SelectToChangeGoodsId).Length > 0 ? note.SelectToChangeGoodsId + note.GoodsId.ToString() : note.GoodsId.ToString());
                            Query.ProcessSqlNonQuery(string.Format("update XiHuan_UserGoods set GoodState=" + XiHuan_UserGoodsFacade.GoodsState.考虑中.ToString("d") + " where Id in ({0}) ",
                                                                   ids), GlobalVar.DataBase_Name);
                            note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.考虑中;
                        }
                        else
                        {
                            note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.换主拒绝;
                        }
                    }
                    note.Save();
                    XiHuan_UserGoodsEntity goods = new XiHuan_UserGoodsEntity();
                    goods.Id = note.GoodsId;
                    goods.Retrieve();
                    if (goods.IsPersistent)
                    {
                        CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + note.GoodsId, goods.DetailUrl);
                    }
                    Alert("恭喜:操作成功!");
                    BindReceive();
                }
                else
                {
                    if (note.Flag != (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.新发起)
                    {
                        if (CommonMethod.FinalString(note.SelectToChangeGoodsId).Length > 0)
                        {
                            Query.ProcessSqlNonQuery(string.Format("update XiHuan_UserGoods set GoodState=" + XiHuan_UserGoodsFacade.GoodsState.新登记.ToString("d") + " where Id in ({0}) ",
                                                                   note.SelectToChangeGoodsId.TrimEnd(',')), GlobalVar.DataBase_Name);
                        }
                    }
                    if (hidType.Value.Trim() != "Recover")
                    {
                        note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.已取消;
                    }
                    else
                    {
                        note.Flag = (byte)XiHuan_ChangeRequireFacade.ChangeRequireState.新发起;
                    }
                    note.Save();
                    XiHuan_UserGoodsEntity goods = new XiHuan_UserGoodsEntity();
                    goods.Id = note.GoodsId;
                    goods.Retrieve();
                    if (goods.IsPersistent)
                    {
                        CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + note.GoodsId, goods.DetailUrl);
                    }
                    Alert("恭喜:操作成功!");
                    BindSend();
                }
            }
        }
    }