Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szGroupID  = Request["GroupID"];
        string szMemberID = Request["MemberID"];
        string szKind     = Request["KindID"];

        Response.CacheControl = "no-cache";
        MyString szOut = new MyString();

        REQUESTCODE uResponse   = REQUESTCODE.EXECUTE_FAIL;
        GROUPMEMBER groupMember = new GROUPMEMBER();

        groupMember.dwGroupID  = Parse(szGroupID);
        groupMember.dwMemberID = Parse(szMemberID);
        groupMember.dwKind     = Parse(szKind);
        uResponse = m_Request.Group.DelGroupMember(groupMember);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            Response.Write("success");
        }
        else
        {
            Response.Write(m_Request.szErrMessage.ToString());
        }
    }
Ejemplo n.º 2
0
    protected uint newGroup()
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        object      obj       = Session["LOGIN_ACCINFO"];
        UNIACCOUNT  acc       = new UNIACCOUNT();

        if (obj != null)
        {
            acc = (UNIACCOUNT)obj;
        }
        UNIGROUP setValue = new UNIGROUP();

        setValue.dwKind           = ((uint)UNIGROUP.DWKIND.GROUPKIND_RERV);
        setValue.szName           = acc.szLogonName.ToString() + DateTime.Now.ToLongTimeString();
        setValue.dwEnrollDeadline = ToUInt(DateTime.Now.AddYears(10).ToString("yyyyMMdd"));
        uResponse = m_Request.Group.SetGroup(setValue, out setValue);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && setValue.dwGroupID != null)
        {
            groupIDHidden.Value = setValue.dwGroupID.ToString();

            GROUPMEMBER setValueMember = new GROUPMEMBER();
            setValueMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
            setValueMember.dwMemberID = acc.dwAccNo;
            setValueMember.szName     = acc.szTrueName.ToString();
            setValueMember.szMemo     = acc.szLogonName.ToString() + ":" + acc.szTrueName.ToString();
            SetGroup(setValueMember);

            return((uint)setValue.dwGroupID);
        }
        else
        {
            return(0);
        }
    }
Ejemplo n.º 3
0
    private void showGroupMember(string id)
    {
        Bind        ddlBind   = new Bind();
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        GROUPREQ    vrGroup   = new GROUPREQ();

        //vrGroup.dwGetType = (uint)GROUPREQ.DWGETTYPE.GROUPGET_BYID;
        //vrGroup.szGetKey = id;
        vrGroup.dwGroupID = ToUInt(id);
        UNIGROUP[] vtGroup;
        uResponse = m_Request.Group.GetGroup(vrGroup, out vtGroup);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && vtGroup != null && vtGroup.Length > 0)
        {
            GROUPMEMBER[] vtGroupMember = vtGroup[0].szMembers;
            if (vtGroupMember != null && vtGroupMember.Length > 0)
            {
                memList = "";
                UNIACCOUNT acc = (UNIACCOUNT)Session["LOGIN_ACCINFO"];
                for (int i = 0; i < vtGroupMember.Length; i++)
                {
                    GROUPMEMBER mb = vtGroupMember[i];//Memo字段为帐号
                    memList += "<tr mbId='" + mb.szMemo + "' gId='" + mb.dwGroupID + "' kind='" + mb.dwKind + "'>";
                    memList += "<td>" + mb.szMemo + "</td>";
                    memList += "<td>" + mb.szName + "</td>";
                    memList += "<td>" + (acc.szLogonName == mb.szMemo ? "" : "[<span class='click' onclick='delMb(this);'>删除</span>]") + "</td>";
                    memList += "</tr>";
                }
            }
        }
    }
Ejemplo n.º 4
0
    protected REQUESTCODE SetGroup(GROUPMEMBER setGroupMember)
    {
        Bind        ddlBind   = new Bind();
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        uint        res       = 0;
        UNIGROUP    setValue  = new UNIGROUP();
        string      groupID   = groupIDHidden.Value.ToString();

        if (groupID.ToString() == "")
        {
            groupID = newGroup().ToString();
            if (groupID != "")
            {
            }
            else
            {
                ddlBind.MessageBoxShow("添加人员失败,请重新预约", this.Page);
                return(REQUESTCODE.EXECUTE_FAIL);
            }
        }
        res = ToUInt(groupIDHidden.Value.ToString());
        GROUPMEMBER setGroupMemberRes = new GROUPMEMBER();

        setGroupMemberRes           = setGroupMember;
        setGroupMemberRes.dwStatus  = (uint)GROUPMEMBER.DWSTATUS.GROUPMEMBERSTAT_FORCE;
        setGroupMemberRes.dwGroupID = res;
        uResponse = m_Request.Group.SetGroupMember(setGroupMemberRes);
        if (uResponse != REQUESTCODE.EXECUTE_SUCCESS)
        {
            ddlBind.MessageBoxShow(m_Request.szErrMessage.ToString(), this.Page);
        }
        showGroupMember(res.ToString());
        return(uResponse);
    }
Ejemplo n.º 5
0
    private void SetActivityPlan(UNIACTIVITYPLAN vrParameter)
    {
        if (m_Request.Reserve.SetActivityPlan(vrParameter, out vrParameter) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
            object      obj       = Session["LOGIN_ACCINFO"];
            UNIACCOUNT  acc       = new UNIACCOUNT();
            if (obj != null)
            {
                acc = (UNIACCOUNT)(obj);
            }

            GROUPMEMBER setValueMember = new GROUPMEMBER();
            setValueMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
            setValueMember.dwMemberID = acc.dwAccNo;
            setValueMember.szName     = acc.szTrueName.ToString();
            setValueMember.szMemo     = acc.szLogonName.ToString() + ":" + acc.szTrueName.ToString();
            setValueMember.dwGroupID  = vrParameter.dwGroupID;
            uResponse = m_Request.Group.SetGroupMember(setValueMember);
            MsgBox("你的申请预约已提交审核,审核结果将由短信形式发送,请注意查收");
        }
        else
        {
            if (vrParameter.dwResvID != null && vrParameter.dwResvID != 0)
            {
                UNIRESERVE para = new UNIRESERVE();
                para.dwResvID = vrParameter.dwResvID;
                m_Request.Reserve.Del(para);
            }
            MsgBox("对不起,申请失败" + m_Request.szErrMessage);
        }
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szGroupID   = Request["GroupID"];
        string szMemberID  = Request["MemberID"];
        string szKind      = Request["KindID"];
        string szName      = Request["Name"];
        string szStartDate = Request["dwStartDate"];
        string szEndDate   = Request["dwEndDate"];
        string szType      = Request["type"];

        if (szType != null && szType.ToLower() == "logonname")
        {
            UNIACCOUNT GetAccount = new UNIACCOUNT();
            if (GetAccByLogonName(szMemberID, out GetAccount))
            {
                szMemberID = GetAccount.dwAccNo.ToString();
                szName     = GetAccount.szTrueName.ToString();
            }
        }
        Response.CacheControl = "no-cache";
        MyString szOut = new MyString();


        REQUESTCODE uResponse   = REQUESTCODE.EXECUTE_FAIL;
        GROUPMEMBER groupMember = new GROUPMEMBER();

        groupMember.dwGroupID  = Parse(szGroupID);
        groupMember.dwMemberID = Parse(szMemberID);
        groupMember.dwKind     = Parse(szKind);

        if (IsExistGroupMember(groupMember.dwGroupID, groupMember.dwMemberID, groupMember.dwKind))
        {
            Response.Write("添加成员已存在");
            Response.End();
        }
        if (szStartDate != null && szStartDate != "")
        {
            groupMember.dwBeginDate = GetDate(szStartDate);
        }
        if (szEndDate != null && szEndDate != "")
        {
            groupMember.dwEndDate = GetDate(szEndDate);
        }
        groupMember.szName = szName;
        uResponse          = m_Request.Group.SetGroupMember(groupMember);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            Response.Write("succ");
        }
        else
        {
            Response.Write(m_Request.szErrMessage);
        }
    }
Ejemplo n.º 7
0
    public REQUESTCODE DelGroupMember(uint?uGroupID, uint?uMemberID, uint uKind)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;

        if (uGroupID == null || uMemberID == null || uGroupID == 0 || uMemberID == 0)
        {
            return(uResponse);
        }
        GROUPMEMBER member = new GROUPMEMBER();

        member.dwGroupID  = uGroupID;
        member.dwMemberID = uMemberID;
        member.dwKind     = uKind;
        return(m_Request.Group.DelGroupMember(member));
    }
Ejemplo n.º 8
0
    protected int newGroup()
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
        object      obj       = Session["LOGIN_ACCINFO"];
        UNIACCOUNT  acc       = new UNIACCOUNT();

        if (obj != null)
        {
            acc = (UNIACCOUNT)(obj);
        }
        else
        {
            MsgBox("你还未登录!");
            return(0);
        }
        UNIGROUP setValue = new UNIGROUP();

        setValue.dwKind           = ((uint)UNIGROUP.DWKIND.GROUPKIND_RERV);
        setValue.szName           = acc.szLogonName.ToString() + DateTime.Now.ToLongTimeString();
        setValue.dwEnrollDeadline = uint.Parse(DateTime.Now.AddYears(10).ToString("yyyyMMdd"));
        if (Session["DEVKINDFORRESV"] != null)
        {
            DEVKINDFORRESV kindf = (DEVKINDFORRESV)Session["DEVKINDFORRESV"];
            setValue.dwMinUsers = kindf.dwMinUsers;
            setValue.dwMaxUsers = kindf.dwMaxUsers;
        }
        uResponse = m_Request.Group.SetGroup(setValue, out setValue);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS && setValue.dwGroupID != null)
        {
            groupIDHidden.Value = setValue.dwGroupID.ToString();

            GROUPMEMBER setValueMember = new GROUPMEMBER();
            setValueMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
            setValueMember.dwMemberID = acc.dwAccNo;
            setValueMember.szName     = acc.szTrueName.ToString();
            setValueMember.szMemo     = acc.szLogonName;
            setValueMember.dwStatus   = (uint)GROUPMEMBER.DWSTATUS.GROUPMEMBERSTAT_FORCE;
            setValueMember.dwGroupID  = setValue.dwGroupID;
            //SetGroup(setValueMember);
            uResponse = m_Request.Group.SetGroupMember(setValueMember);
            return((int)setValue.dwGroupID);
        }
        else
        {
            MsgBox(m_Request.szErrMsg);
            return(0);
        }
    }
Ejemplo n.º 9
0
    protected void GV_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index    = Convert.ToInt32(e.CommandArgument.ToString());
        string      memberid = GV.Rows[index].Cells[0].Text.ToString();
        string      kind     = GV.Rows[index].Cells[3].Text.ToString();
        string      groupID  = groupIDHidden.Value.ToString();
        GROUPMEMBER setValue = new GROUPMEMBER();

        setValue.dwGroupID  = ToUInt(groupID);
        setValue.dwKind     = ToUInt(kind);
        setValue.dwMemberID = ToUInt(memberid);
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;

        uResponse = m_Request.Group.DelGroupMember(setValue);
        showGroupMember(groupID);
    }
Ejemplo n.º 10
0
    public REQUESTCODE AddGroupMember(uint?uGroupID, uint?uMemberID, uint uKind, string szName)
    {
        REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;

        if (uGroupID == null || uMemberID == null || uGroupID == 0 || uMemberID == 0)
        {
            return(uResponse);
        }
        GROUPMEMBER member = new GROUPMEMBER();

        member.dwGroupID  = uGroupID;
        member.dwMemberID = uMemberID;
        member.dwKind     = uKind;
        member.szName     = szName;
        return(m_Request.Group.SetGroupMember(member));
    }
Ejemplo n.º 11
0
    uint NewGroupFromClient()
    {
        string szGroup = Request["GroupList"];

        if (string.IsNullOrEmpty(szGroup))
        {
            MessageBox("班级组不能为空", "创建预约失败", MSGBOX.ERROR);
            return(0);
        }
        UNIGROUP vrGroup = new UNIGROUP();

        vrGroup.szName = "" + DateTime.Now.Ticks;
        if (m_Request.Group.SetGroup(vrGroup, out vrGroup) != REQUESTCODE.EXECUTE_SUCCESS || vrGroup.dwGroupID == 0)
        {
            MessageBox("创建预约班级组失败", "创建预约失败", MSGBOX.ERROR);
            return(0);
        }


        string[] arrayGroupName = Request["GroupListName"].Split(new char[] { ',' });
        string[] arrayGroup     = szGroup.Split(new char[] { ',' });
        for (int i = 0; i < arrayGroup.Length; i++)
        {
            uint nClsID = 0;
            uint.TryParse(arrayGroup[i], out nClsID);
            if (nClsID != 0)
            {
                GROUPMEMBER vrGrpMember = new GROUPMEMBER();
                vrGrpMember.dwGroupID  = vrGroup.dwGroupID;
                vrGrpMember.dwMemberID = nClsID;
                vrGrpMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_CLASS;
                vrGrpMember.szName     = arrayGroupName[i];
                if (m_Request.Group.SetGroupMember(vrGrpMember) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    m_Request.Group.DelGroup(vrGroup);
                    MessageBox("设置预约班级组失败", "创建预约失败", MSGBOX.ERROR);
                    return(0);
                }
            }
        }
        return((uint)vrGroup.dwGroupID);
    }
Ejemplo n.º 12
0
    protected void Button2_ServerClick(object sender, EventArgs e)
    {
        ACCREQ vrGet = new ACCREQ();

        vrGet.szPID = txtPerson.Value.ToString();
        UNIACCOUNT[] vtRes;
        REQUESTCODE  uResponse = REQUESTCODE.EXECUTE_FAIL;

        uResponse = m_Request.Account.Get(vrGet, out vtRes);
        if (uResponse != REQUESTCODE.EXECUTE_SUCCESS || vtRes == null || vtRes.Length <= 0)
        {
            txtPerson.Value = "此人不存在";
            return;
        }
        GROUPMEMBER setValue = new GROUPMEMBER();

        setValue.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
        setValue.dwMemberID = vtRes[0].dwAccNo;
        setValue.szName     = vtRes[0].szTrueName.ToString();
        setValue.szMemo     = vtRes[0].szLogonName.ToString() + ":" + vtRes[0].szTrueName.ToString();
        SetGroup(setValue);
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            szResOut += "<table>";
            UNIGROUP   resvGroup;
            string[]   szOwnerList  = Request["szowner"].ToString().Split(';');
            string     szDevID      = Request["szDevID"];
            string     szStartDate  = Request["szStartDate"];
            string     szEndDate    = Request["szEndDate"];
            string     szSelectWeek = Request["weekSelect"];
            string     szStartTime  = Request["startTimeHour"] + ":" + Request["startTimeMin"];
            string     szEndTime    = Request["endTimeHour"] + ":" + Request["endTimeMin"];
            UNIRESERVE setValue     = new UNIRESERVE();
            ArrayList  list         = new ArrayList();
            if (NewGroup("管理员新建预约", (uint)UNIGROUP.DWKIND.GROUPKIND_RERV, out resvGroup))
            {
                for (int i = 0; i < szOwnerList.Length; i++)
                {
                    UNIACCOUNT acc = new UNIACCOUNT();
                    if (GetAccByAccno(szOwnerList[i], out acc))
                    {
                        GROUPMEMBER member = new GROUPMEMBER();
                        member.dwMemberID = acc.dwAccNo;
                        member.szName     = acc.szTrueName;
                        AddGroupMember(resvGroup.dwGroupID, acc.dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL, acc.szTrueName);
                        list.Add(member);
                    }
                }


                setValue.dwMemberID   = resvGroup.dwGroupID;
                setValue.dwMemberKind = (uint)UNIRESERVE.DWMEMBERKIND.MEMBERKIND_GROUP;

                UNIACCOUNT vrAccInfo = ((ADMINLOGINRES)Session["LoginResult"]).AccInfo;
                setValue.dwOwner     = vrAccInfo.dwAccNo;
                setValue.szOwnerName = vrAccInfo.szTrueName;
                setValue.szTestName  = Request["szMemo"];
                UNIDEVICE dev = new UNIDEVICE();
                if (getDevByID(szDevID, out dev))
                {
                    setValue.ResvDev               = new RESVDEV[1];
                    setValue.ResvDev[0].dwDevEnd   = dev.dwDevSN;
                    setValue.ResvDev[0].dwDevStart = dev.dwDevSN;
                    setValue.ResvDev[0].dwDevNum   = 1;
                    setValue.ResvDev[0].dwDevKind  = dev.dwKindID;
                    setValue.ResvDev[0].szRoomNo   = dev.szRoomNo;
                    setValue.ResvDev[0].szDevName  = dev.szDevName;
                    setValue.dwLabID               = dev.dwLabID;
                    setValue.szLabName             = dev.szLabName;
                }
                setValue.dwProperty = (uint)UNIRESERVE.DWPROPERTY.RESVPROP_SELFDO;
                //setValue.dwPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL;

                //管理员占用导致预约不能生效 所以去掉(uint)UNIRESERVE.DWPURPOSE.USEFOR_RESERVED
                //setValue.dwPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_RESERVED + (uint)UNIRESERVE.DWPURPOSE.USEFOR_STUDYROOM + (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL;

                setValue.dwPurpose = (uint)UNIRESERVE.DWPURPOSE.USEFOR_STUDYROOM + (uint)UNIRESERVE.DWPURPOSE.USEFOR_PERSONNAL;

                setValue.dwUseMode = (uint)UNIRESERVE.DWUSEMODE.RESVUSEEXT_PC + (uint)UNIRESERVE.DWUSEMODE.RESVUSE_USEDEV;
            }
            REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;

            DateTime startDate  = DateTime.Parse(szStartDate);
            DateTime endDate    = DateTime.Parse(szEndDate);
            TimeSpan span       = endDate - startDate;
            uint     uCount     = 0;
            uint     uCountFali = 0;
            while (span.Days > -1)
            {
                UNIGROUP groupresv = new UNIGROUP();
                groupresv           = resvGroup;
                groupresv.dwGroupID = null;
                m_Request.Group.SetGroup(groupresv, out groupresv);
                setValue.dwMemberID = groupresv.dwGroupID;
                if (list != null && list.Count > 0)
                {
                    for (int m = 0; m < list.Count; m++)
                    {
                        GROUPMEMBER member = (GROUPMEMBER)list[m];
                        AddGroupMember(groupresv.dwGroupID, member.dwMemberID, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL, member.szName);
                    }
                }
                int uweek = (int)startDate.DayOfWeek;
                if (uweek == 0)
                {
                    uweek = 7;
                }
                if (szSelectWeek == null || szSelectWeek == "" || szSelectWeek.IndexOf(uweek.ToString()) > -1)
                {
                    string szStartTimeTemp = startDate.ToString("yyyy-MM-dd") + " " + szStartTime;
                    string szEndTimeTemp   = startDate.ToString("yyyy-MM-dd") + " " + szEndTime;

                    setValue.dwBeginTime = Get1970Seconds(szStartTimeTemp);
                    setValue.dwEndTime   = Get1970Seconds(szEndTimeTemp);
                    UNIRESERVE resvTemp = setValue;
                    if (m_Request.Reserve.Set(setValue, out setValue) == REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        uCount = uCount + 1;
                    }
                    else
                    {
                        szResOut  += "<tr><td>" + szStartTimeTemp + "到" + szEndTimeTemp + "</td><td>" + m_Request.szErrMessage + "</td></tr>";
                        uCountFali = uCountFali + 1;
                    }
                    setValue          = resvTemp;
                    setValue.dwResvID = null;

                    UNIACCOUNT vrAccInfo = ((ADMINLOGINRES)Session["LoginResult"]).AccInfo;
                    setValue.dwOwner     = vrAccInfo.dwAccNo;
                    setValue.szOwnerName = vrAccInfo.szTrueName;
                }
                startDate = startDate.AddDays(1);
                span      = endDate - startDate;
            }

            MessageBox("预约成功【" + uCount + "】", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.NONE);
            szResOut += "</table>";
            return;
        }
        for (int i = 0; i < szWeekDayList.Length; i++)
        {
            szWeek += GetInputItemHtml(CONSTHTML.checkBox, "weekSelect", szWeekDayList[i], (i + 1).ToString());
        }
        for (int i = 7; i < 23; i++)
        {
            TimeHour += GetInputItemHtml(CONSTHTML.option, "", i.ToString("00"), (i).ToString());
        }

        for (int i = 0; i < 60; i = i + 5)
        {
            TimeMin += GetInputItemHtml(CONSTHTML.option, "", i.ToString("00"), (i).ToString());
        }
        m_Title = "管理员新建预约";
    }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Buffer          = true;
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires         = 0;
        Response.CacheControl    = "no-cache";

        base.LoadPage();

        if (Request["act"] == "res")
        {
            uint nGroupID = 0;
            uint.TryParse(Request["gid"], out nGroupID);
            string szPurpose = Request["purpose"];
            //TODO:加入组成员。

            //$out = SetGroupMember($_SESSION['SOAP']['AccNo'],$_SESSION['SOAP']['Name'],$_GET['gid']);
            //Response.Write("{\"MsgId\":1,\"Message\":\"未实现\"}");

            string groupID = nGroupID.ToString();

            REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
            GROUPREQ    vrGet     = new GROUPREQ();
            //vrGet.dwGetType = (uint)GROUPREQ.DWGETTYPE.GROUPGET_BYID;
            //vrGet.szGetKey = groupID;
            vrGet.dwGroupID = ToUInt(groupID);
            UNIGROUP[] vtGroup;
            uResponse = m_Request.Group.GetGroup(vrGet, out vtGroup);

            if (uResponse != REQUESTCODE.EXECUTE_SUCCESS || vtGroup == null || vtGroup.Length == 0)
            {
                Response.Write("{\"MsgId\":1,\"Message\":\"还没指定成员\"}");
                return;
            }
            object obj = Session["LOGIN_ACCINFO"];
            if (obj == null)
            {
                Response.Write("{\"MsgId\":1,\"Message\":\"未登录或已超时\"}");
                return;
            }
            UNIACCOUNT  vrAccInfo      = (UNIACCOUNT)obj;
            GROUPMEMBER setGroupMember = new GROUPMEMBER();
            setGroupMember.dwGroupID  = vtGroup[0].dwGroupID;
            setGroupMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
            setGroupMember.dwMemberID = vrAccInfo.dwAccNo;
            setGroupMember.szName     = vrAccInfo.szTrueName.ToString();
            setGroupMember.szMemo     = vrAccInfo.szLogonName.ToString() + ":" + vrAccInfo.szTrueName.ToString();
            if (szPurpose != null && szPurpose == "in")
            {
                uResponse = m_Request.Group.SetGroupMember(setGroupMember);
                if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    Response.Write("{\"MsgId\":1,\"Message\":\"报名成功\"}");
                }
                else
                {
                    Response.Write("{\"MsgId\":1,\"Message\":\"" + m_Request.szErrMessage.ToString() + "\"}");
                }
            }
            else if (szPurpose != null && szPurpose == "out")
            {
                uResponse = m_Request.Group.DelGroupMember(setGroupMember);
                if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    Response.Write("{\"MsgId\":1,\"Message\":\"退出成功\"}");
                }
            }
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.LoadPage();

        UNIACTIVITYPLAN vrParameter = new UNIACTIVITYPLAN();

        vrParameter.dwActivityPlanID   = ToUInt(Request["dwActivityPlanID"]);
        vrParameter.szActivityPlanName = Request["szActivityPlanName"];
        vrParameter.szHostUnit         = Request["szHostUnit"];
        vrParameter.szOrganizer        = Request["szOrganizer"];
        vrParameter.szPresenter        = Request["szPresenter"];
        vrParameter.szDesiredUser      = Request["szDesiredUser"];
        vrParameter.dwCheckRequirment  = ToUInt(Request["dwCheckRequirment"]);
        vrParameter.szContact          = Request["szContact"];
        vrParameter.szTel             = Request["szTel"];
        vrParameter.szHandPhone       = Request["szHandPhone"];
        vrParameter.dwCheckRequirment = (uint)UNIACTIVITYPLAN.DWCHECKREQUIRMENT.ACTIVITYPLAN_NOAPPLY;
        vrParameter.dwKind            = (uint)UNIACTIVITYPLAN.DWKIND.ACTIVITYPLANKIND_SALON;
        vrParameter.szEmail           = Request["szEmail"];
        vrParameter.dwResvID          = ToUInt(Request["dwResvID"]);
        vrParameter.dwGroupID         = ToUInt(Request["dwGroupID"]);
        vrParameter.dwMaxUsers        = ToUInt(Request["dwMaxUsers"]);
        vrParameter.dwMinUsers        = ToUInt(Request["dwMinUsers"]);
        vrParameter.dwEnrollUsers     = ToUInt(Request["dwEnrollUsers"]);
        vrParameter.dwEnrollDeadline  = ToUInt(Request["dwEnrollDeadline"]);
        vrParameter.dwPublishDate     = ToUInt(Request["dwPublishDate"]);
        vrParameter.dwActivityDate    = ToUInt(Request["dwActivityDate"]);
        vrParameter.dwBeginTime       = ToUInt(Request["dwBeginTime"]);
        vrParameter.dwEndTime         = ToUInt(Request["dwEndTime"]);
        vrParameter.szSite            = Request["szSite"];
        vrParameter.dwDevID           = 576;
        vrParameter.szRoomNo          = GetRoomNoFromDevID("576");
        vrParameter.dwKind            = ToUInt(Request["dwKind"]);
        vrParameter.dwStatus          = (uint)UNITESTPLAN.DWSTATUS.TESTPLANSTAT_UNOPEN;
        vrParameter.szIntroInfo       = Request["szIntroInfo"];
        vrParameter.szMemo            = Request["szMemo"];

        HttpPostedFile file = Request.Files["szActivityPlanURL"];

        if (file != null && file.ContentLength > 0)
        {
            string szFilename = Server.UrlDecode(file.FileName);
            int    n          = szFilename.LastIndexOf("\\");
            if (n >= 0)
            {
                szFilename = szFilename.Substring(n + 1);
            }
            else
            {
                n = szFilename.LastIndexOf("/");
                if (n >= 0)
                {
                    szFilename = szFilename.Substring(n + 1);
                }
            }
            szFilename = @"file_upload\" + DateTime.Now.Ticks + szFilename;
            string szFiles = Server.MapPath(".") + @"\" + szFilename;

            file.SaveAs(szFiles);
            szFilename = szFilename.Replace('\\', '/');
            szFiles    = Request.Url.AbsoluteUri;
            n          = szFiles.LastIndexOf("/");
            if (n >= 0)
            {
                szFiles = szFiles.Substring(0, n + 1);
            }
            vrParameter.szActivityPlanURL = szFiles + szFilename;
        }
        file = Request.Files["szApplicationURL"];
        if (file != null && file.ContentLength > 0)
        {
            string szFilename = Server.UrlDecode(file.FileName);
            int    n          = szFilename.LastIndexOf("\\");
            if (n >= 0)
            {
                szFilename = szFilename.Substring(n + 1);
            }
            else
            {
                n = szFilename.LastIndexOf("/");
                if (n >= 0)
                {
                    szFilename = szFilename.Substring(n + 1);
                }
            }
            szFilename = @"file_upload\" + DateTime.Now.Ticks + szFilename;
            string szFiles = Server.MapPath(".") + @"\" + szFilename;

            file.SaveAs(szFiles);
            szFilename = szFilename.Replace('\\', '/');
            szFiles    = Request.Url.AbsoluteUri;
            n          = szFiles.LastIndexOf("/");
            if (n >= 0)
            {
                szFiles = szFiles.Substring(0, n + 1);
            }

            vrParameter.szApplicationURL = szFiles + szFilename;
        }

        if (m_Request.Reserve.SetActivityPlan(vrParameter, out vrParameter) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            REQUESTCODE uResponse = REQUESTCODE.EXECUTE_FAIL;
            object      obj       = Session["LOGIN_ACCINFO"];
            UNIACCOUNT  acc       = new UNIACCOUNT();
            if (obj != null)
            {
                acc = (UNIACCOUNT)(obj);
            }

            GROUPMEMBER setValueMember = new GROUPMEMBER();
            setValueMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
            setValueMember.dwMemberID = acc.dwAccNo;
            setValueMember.szName     = acc.szTrueName.ToString();
            setValueMember.szMemo     = acc.szLogonName.ToString() + ":" + acc.szTrueName.ToString();
            setValueMember.dwGroupID  = vrParameter.dwGroupID;
            uResponse = m_Request.Group.SetGroupMember(setValueMember);
            szResult  = "<h2>你的申请预约已提交审核</h2><p>审核结果将由短信形式发送,请注意查收</p>";
        }
        else
        {
            if (m_Request.szErrMessage != "")
            {
                szResult = "<h2>对不起,申请失败</h2><p>" + m_Request.szErrMessage + "</p>";
            }
            else
            {
                szResult = "<h2>对不起,申请失败</h2><p>如有疑问,请致电:0571-xxxxxxxx</p>";
            }
        }
    }
Ejemplo n.º 16
0
    bool SetRoomGroupFromClient(uint?dwAccNo)
    {
        if (IsNullOrZero(dwAccNo))
        {
            return(false);
        }
        string szManRole = Request["dwManRole"];

        if (szManRole == null)
        {
            return(false);
        }
        else if (szManRole == "132097")//站点领导不需要添加
        {
            return(true);
        }
        else if (szManRole == "524801")//实验室管理员
        {
            string szLabList = Request["labCheckList"];
            if (string.IsNullOrEmpty(szLabList))
            {
                szLabList = "";
            }
            string[] arrayLab = szLabList.Split(new char[] { ',' });
            for (int i = 0; i < arrayLab.Length; i++)
            {
                if (arrayLab[i] != "")
                {
                    UNILAB lab;
                    if (GetLabByID((uint?)Parse(arrayLab[i]), out lab))
                    {
                        if (!IsInGroupMember(lab.dwManGroupID, dwAccNo, (uint)UNIGROUP.DWKIND.GROUPKIND_MAN))
                        {
                            AddGroupMember(lab.dwManGroupID, dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL);
                        }
                    }
                }
            }
            UNILAB[] allLab = GetAllLab();
            if (allLab != null)
            {
                for (int i = 0; i < allLab.Length; i++)
                {
                    bool bIsIn  = false;
                    uint uLabid = (uint)allLab[i].dwLabID;
                    for (int k = 0; k < arrayLab.Length; k++)
                    {
                        if (Parse(arrayLab[k]) == uLabid)
                        {
                            bIsIn = true;
                            break;
                        }
                    }
                    if (bIsIn == false)
                    {
                        DelGroupMember(allLab[i].dwManGroupID, dwAccNo, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL);
                    }
                }
            }
            return(true);
        }
        else if (szManRole == "1049105" || szManRole == "2049")//房间管理员
        {
            string szGroup = Request["roomID"];
            if (string.IsNullOrEmpty(szGroup))
            {
                szGroup = "";
            }
            if (szGroup == "" || szGroup == ",")
            {
                return(true);
            }
            uint[] arrayGroupID = null;
            string szRoomGroup  = Request["roomID"];
            if (szRoomGroup == null)
            {
                szRoomGroup = "";
            }
            string[] arrayGroupName = szRoomGroup.Split(new char[] { ',' });
            string[] arrayGroup     = szGroup.Split(new char[] { ',' });
            arrayGroupID = new uint[arrayGroup.Length];
            for (int i = 0; i < arrayGroup.Length; i++)
            {
                uint nClsID = 0;
                uint.TryParse(arrayGroup[i], out nClsID);
                arrayGroupID[i] = nClsID;
            }

            MANROOMREQ manRoomGet = new MANROOMREQ();
            manRoomGet.dwAccNo   = dwAccNo;
            manRoomGet.dwManFlag = 1;
            MANROOM[] vtResManRoom;
            m_Request.Admin.GetManRoom(manRoomGet, out vtResManRoom);

            bool bError = false;

            //删除房间管理组成员
            if (vtResManRoom != null && vtResManRoom.Length > 0)
            {
                for (int i = 0; i < vtResManRoom.Length; i++)
                {
                    int nFind = -1;
                    for (int j = 0; j < arrayGroupID.Length; j++)
                    {
                        if (vtResManRoom[i].dwRoomID == arrayGroupID[j])
                        {
                            nFind = j;
                            break;
                        }
                    }
                    if (nFind >= 0)
                    {
                        arrayGroupID[nFind] = 0;
                    }
                    else
                    {
                        GROUPMEMBER vrGrpMember = new GROUPMEMBER();
                        vrGrpMember.dwGroupID  = vtResManRoom[i].dwManGroupID;
                        vrGrpMember.dwMemberID = dwAccNo;
                        vrGrpMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
                        if (m_Request.Group.DelGroupMember(vrGrpMember) != REQUESTCODE.EXECUTE_SUCCESS)
                        {
                            bError = true;
                            break;
                        }
                    }
                }
            }


            //添加管理组成员
            for (int i = 0; i < arrayGroupID.Length; i++)
            {
                if (arrayGroupID[i] == 0)
                {
                    continue;
                }
                ROOMREQ   vrGetRoomGrpReq = new ROOMREQ();
                UNIROOM[] vrRoomGroupRet;
                vrGetRoomGrpReq.dwRoomID = arrayGroupID[i];
                if (m_Request.Device.RoomGet(vrGetRoomGrpReq, out vrRoomGroupRet) == REQUESTCODE.EXECUTE_SUCCESS && vrRoomGroupRet != null && vrRoomGroupRet.Length != 0)
                {
                    if (IsNullOrZero(vrRoomGroupRet[0].dwManGroupID))
                    {
                        //创建管理组
                        UNIGROUP vrNewGroup = new UNIGROUP();
                        vrNewGroup.szName = vrRoomGroupRet[0].szRoomName + "管理组";
                        m_Request.Group.SetGroup(vrNewGroup, out vrNewGroup);
                        if (IsNullOrZero(vrNewGroup.dwGroupID))
                        {
                            bError = true;
                            break;
                        }
                        vrRoomGroupRet[0].dwManGroupID = vrNewGroup.dwGroupID;
                        if (m_Request.Device.RoomSet(vrRoomGroupRet[0], out vrRoomGroupRet[0]) != REQUESTCODE.EXECUTE_SUCCESS)
                        {
                            bError = true;
                            break;
                        }
                    }

                    GROUPMEMBER vrGrpMember = new GROUPMEMBER();
                    vrGrpMember.dwGroupID  = vrRoomGroupRet[0].dwManGroupID;
                    vrGrpMember.dwMemberID = dwAccNo;
                    vrGrpMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL;
                    if (m_Request.Group.SetGroupMember(vrGrpMember) != REQUESTCODE.EXECUTE_SUCCESS)
                    {
                        bError = true;
                        break;
                    }
                }
            }
            return(!bError);
        }
        return(true);
    }
Ejemplo n.º 17
0
    bool SetGroupFromClient(ref uint?dwGroupID)
    {
        string szGroup = Request["GroupList"];

        if (string.IsNullOrEmpty(szGroup))
        {
            MessageBox("班级组不能为空", "创建预约失败", MSGBOX.ERROR);
            return(false);
        }

        if (!IsNullOrZero(dwGroupID))
        {
            GROUPREQ vrGetGroup = new GROUPREQ();
            // vrGetGroup.dwGetType = (uint)GROUPREQ.DWGETTYPE.GROUPGET_BYID;
            vrGetGroup.dwGroupID = dwGroupID;

            UNIGROUP[] vrGetGroupRet;
            if (m_Request.Group.GetGroup(vrGetGroup, out vrGetGroupRet) == REQUESTCODE.EXECUTE_SUCCESS && vrGetGroupRet.Length > 0)
            {
                for (int i = 0; i < vrGetGroupRet[0].szMembers.Length; i++)
                {
                    m_Request.Group.DelGroupMember(vrGetGroupRet[0].szMembers[i]);
                }
            }
            else
            {
                dwGroupID = 0;
            }
        }


        UNIGROUP vrGroup = new UNIGROUP();

        if (IsNullOrZero(dwGroupID))
        {
            vrGroup.dwKind = (uint)UNIGROUP.DWKIND.GROUPKIND_RERV;

            vrGroup.szName = "" + DateTime.Now.Ticks;
            if (m_Request.Group.SetGroup(vrGroup, out vrGroup) != REQUESTCODE.EXECUTE_SUCCESS || vrGroup.dwGroupID == 0)
            {
                MessageBox("创建预约班级组失败", "创建预约失败", MSGBOX.ERROR);
                return(false);
            }
            dwGroupID = vrGroup.dwGroupID;
        }
        else
        {
            vrGroup.dwGroupID = dwGroupID;
        }


        string[] arrayGroupName = Request["GroupListName"].Split(new char[] { ',' });
        string[] arrayGroup     = szGroup.Split(new char[] { ',' });
        for (int i = 0; i < arrayGroup.Length; i++)
        {
            uint nClsID = 0;
            uint.TryParse(arrayGroup[i], out nClsID);
            if (nClsID != 0)
            {
                GROUPMEMBER vrGrpMember = new GROUPMEMBER();
                vrGrpMember.dwGroupID  = vrGroup.dwGroupID;
                vrGrpMember.dwMemberID = nClsID;
                vrGrpMember.dwKind     = (uint)GROUPMEMBER.DWKIND.MEMBERKIND_CLASS;
                vrGrpMember.szName     = arrayGroupName[i];
                if (m_Request.Group.SetGroupMember(vrGrpMember) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    m_Request.Group.DelGroup(vrGroup);
                    dwGroupID = 0;
                    MessageBox("设置预约班级组失败", "创建预约失败", MSGBOX.ERROR);
                    return(false);
                }
            }
        }

        return(true);
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szGroupID   = Request["GroupID"];
        string szGroupName = Request["GroupName"];
        string szMemberID  = Request["MemberID"];
        string szKind      = Request["KindID"];
        string szName      = Request["Name"];
        string szStartDate = Request["dwStartDate"];
        string szEndDate   = Request["dwEndDate"];
        string szType      = Request["type"];

        if (szType != null && szType.ToLower() == "logonname")
        {
            UNIACCOUNT GetAccount = new UNIACCOUNT();
            if (GetAccByLogonName(szMemberID, out GetAccount))
            {
                szMemberID = GetAccount.dwAccNo.ToString();
                szName     = GetAccount.szTrueName.ToString();
            }
        }
        Response.CacheControl = "no-cache";
        MyString szOut = new MyString();

        if (Session["ClassGroupID"] == null && (szGroupID == null || szGroupID == "" || szGroupID == "0"))
        {
            UNIGROUP newGroup = new UNIGROUP();
            newGroup.szName = szGroupName;
            newGroup.dwKind = (uint)UNIGROUP.DWKIND.GROUPKIND_RERV;
            if (m_Request.Group.SetGroup(newGroup, out newGroup) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                szGroupID = newGroup.dwGroupID.ToString();
                Session["ClassGroupID"] = szGroupID;
            }
        }
        if (szGroupID == null && Session["ClassGroupID"] != null && Session["ClassGroupID"].ToString() != "")
        {
            szGroupID = Session["ClassGroupID"].ToString();
        }
        REQUESTCODE uResponse   = REQUESTCODE.EXECUTE_FAIL;
        GROUPMEMBER groupMember = new GROUPMEMBER();

        groupMember.dwGroupID  = Parse(szGroupID);
        groupMember.dwMemberID = Parse(szMemberID);
        groupMember.dwKind     = Parse(szKind);
        if (((uint)groupMember.dwKind) == (uint)GROUPMEMBER.DWKIND.MEMBERKIND_CLASS)
        {
            if (IsInClassGroupMember(groupMember.dwGroupID, groupMember.dwMemberID, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_CLASS))
            {
                Response.Write("已添加");
                return;
            }
        }
        else if (((uint)groupMember.dwKind) == (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL)
        {
            if (IsInClassGroupMember(groupMember.dwGroupID, groupMember.dwMemberID, (uint)GROUPMEMBER.DWKIND.MEMBERKIND_PERSONAL))
            {
                Response.Write("已添加");
                return;
            }
        }

        if (szStartDate != null && szStartDate != "")
        {
            groupMember.dwBeginDate = GetDate(szStartDate);
        }
        if (szEndDate != null && szEndDate != "")
        {
            groupMember.dwEndDate = GetDate(szEndDate);
        }
        groupMember.szName = szName;
        uResponse          = m_Request.Group.SetGroupMember(groupMember);
        if (uResponse == REQUESTCODE.EXECUTE_SUCCESS)
        {
            Response.Write("success");
        }
        else
        {
            Response.Write(m_Request.szErrMessage);
        }
    }