Пример #1
0
    public static UpdateDistributionInfoResponse UpdateDistributionInfo(string Class, string DeterminationDate, string Office, string Regulation, string Reason, string pid)
    {
        APIWrapper api = null;

        if (Membership.GetUser() != null && Membership.GetUser().IsApproved)
        {
            api = new APIWrapper(Membership.GetUser().UserName, null);
        }
        else
        {
            api = new APIWrapper(vwarDAL.DefaultUsers.Anonymous[0], null);
        }


        vwar.service.host.Metadata md = api.GetMetadata(pid, "00-00-00");
        if (md == null)
        {
            return(new UpdateDistributionInfoResponse(false));
        }

        UpdateDistributionInfoResponse response = new UpdateDistributionInfoResponse(false);

        md.Distribution_Grade              = Class;
        md.Distribution_Reason             = Reason;
        md.Distribution_Regulation         = Regulation;
        md.Distribution_Determination_Date = DeterminationDate;
        md.Distribution_Contolling_Office  = Office;

        string result = api.UpdateMetadata(md, pid, "00-00-00");

        if (result == "Ok")
        {
            response                   = new UpdateDistributionInfoResponse(true);
            response.Class             = md.Distribution_Grade;;
            response.DeterminationDate = DeterminationDate;
            response.Office            = Office;
            response.Reason            = Reason;
            response.Regulation        = Regulation;
            response.FullText          = GetDistributionText(md);
        }

        return(response);
    }
Пример #2
0
    public static UpdateDistributionInfoResponse UpdateDistributionInfo( string Class,string DeterminationDate,string Office,string Regulation,string Reason, string pid)
    {
        APIWrapper api = null;
        if (Membership.GetUser() != null && Membership.GetUser().IsApproved)
            api = new APIWrapper(Membership.GetUser().UserName, null);
        else
            api = new APIWrapper(vwarDAL.DefaultUsers.Anonymous[0], null);

        vwar.service.host.Metadata md = api.GetMetadata(pid, "00-00-00");
        if (md == null)
            return new UpdateDistributionInfoResponse(false);

        UpdateDistributionInfoResponse response = new UpdateDistributionInfoResponse(false);

        md.Distribution_Grade = Class;
        md.Distribution_Reason = Reason;
        md.Distribution_Regulation = Regulation;
        md.Distribution_Determination_Date = DeterminationDate;
        md.Distribution_Contolling_Office = Office;

        string result = api.UpdateMetadata(md, pid, "00-00-00");
        if (result == "Ok")
        {
            response = new UpdateDistributionInfoResponse(true);
            response.Class = md.Distribution_Grade; ;
            response.DeterminationDate = DeterminationDate;
            response.Office = Office;
            response.Reason = Reason;
            response.Regulation = Regulation;
            response.FullText = GetDistributionText(md);
        }

        return response;
    }