/// <summary>
        /// 根据岗位责任书的当前状态设置按钮的可用性
        /// </summary>
        private void setEnabled()
        {
            DocStatus curStatus = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);

            if (curStatus == DocStatus.unmake || curStatus == DocStatus.saved || curStatus == DocStatus.passed)
            {
                Button_Pass.Enabled        = false;
                Button_Pass_Shadow.Enabled = false;
            }
            if (curStatus == DocStatus.unmake || curStatus == DocStatus.saved || curStatus == DocStatus.rejected)
            {
                Button_Reject.Enabled        = false;
                Button_Reject_Shadow.Enabled = false;
            }
            if (curStatus == DocStatus.submitted || curStatus == DocStatus.modified || curStatus == DocStatus.passed)
            {
                Button_Save.Enabled           = false;
                Button_Save_Shadow.Enabled    = false;
                Button_Submit.Enabled         = false;
                Button_Submit_Shadow.Enabled  = false;
                Button_Clear.Enabled          = false;
                Button_Clear_Shadow.Enabled   = false;
                DropDownList_Template.Enabled = false;
            }
            if (curStatus == DocStatus.passed)  //只有当文档状态为通过时,导出pdf按钮才可用
            {
                Button_ExportPDF.Enabled        = true;
                Button_ExportPDF_Shadow.Enabled = true;
            }
        }
Example #2
0
        protected void InsertAppData()
        {
            StringBuilder appDataSb = new StringBuilder();

            appDataSb.Append("window.appData = {");
            appDataSb.Append("dictionaries: {");
            appDataSb.Append("inputDocTypes: [" + FormatDictionaryList(InputDocType.GetAll(), "InputDocTypeID") + "], ");
            appDataSb.Append("inputMethods: [" + FormatDictionaryList(InputMethod.GetAll(), "InputMethodID") + "], ");
            appDataSb.Append("inputSigns: [" + FormatDictionaryList(InputSign.GetAll(), "InputSignID") + "], ");
            appDataSb.Append("inputSubjectTypes: [" + FormatDictionaryList(InputSubjectType.GetAll(), "InputSubjectTypeID") + "], ");
            appDataSb.Append("deliveryTypes: [" + FormatDictionaryList(DeliveryType.GetAll(), "DeliveryTypeID") + "] ,");
            appDataSb.Append("socialStatuses: [" + FormatDictionaryList(SocialStatus.GetAll(), "SocialStatusID") + "], ");
            appDataSb.Append("branchTypes: [" + FormatDictionaryList(BranchType.GetAll(), "BranchTypeID") + "], ");
            appDataSb.Append("socialCategories: [" + FormatDictionaryList(SocialCategory.GetAll(), "SocialCategoryID") + "], ");
            appDataSb.Append("cardStatuses: [" + FormatDictionaryList(CardStatus.GetAll(), "CardStatusID") + "], ");
            appDataSb.Append("labels: [" + FormatDictionaryList(Label.GetList(), "LabelID") + "], ");
            appDataSb.Append("docStatuses: [" + FormatDictionaryList(DocStatus.GetAll(), "DocStatusID") + "]");
            appDataSb.Append("}");
            appDataSb.Append("}");

            HtmlGenericControl scriptControl = new HtmlGenericControl("script");

            scriptControl.Attributes["type"] = "text/javascript";
            scriptControl.InnerHtml          = appDataSb.ToString();
            Page.Header.Controls.AddAt(0, scriptControl);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            checkSession();
            if (!IsPostBack)
            {
                if (!isEvaluateTablePassed())
                {
                    Alert.ShowInTop("被考评人考核表尚未通过考核,不能制定考评人名单!\n窗口即将关闭", MessageBoxIcon.Warning);
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
                }

                Button_Close.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();
                Panel1.Title = Request.QueryString["name"] + "的考评人名单";

                bindEvaluatorToGrid();  //绑定被考评信息到Grid
                SetSubmitted();         //将已提交的名单显示在页面上

                Label_Comment.Text = Request.QueryString["Comment"];
                DocStatus status = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);
                Panel1.Title = Request.QueryString["name"] + "的考评人名单";

                if (status == DocStatus.submitted || status == DocStatus.passed)
                {
                    Button_Submit.Enabled = false;
                    Button_Clear.Enabled  = false;
                }
            }
        }
        /// <summary>
        /// Gets the document status value
        /// </summary>
        /// <returns>The document status value</returns>
        public DocStatus?GetDocStatusValue()
        {
            if (Value == null)
            {
                return(null);
            }

            if (Value is string)
            {
                Type        typeDocStatus = typeof(DocStatus);
                FieldInfo[] fieldInfo     = typeDocStatus.GetFields();

                foreach (FieldInfo field in fieldInfo)
                {
                    if (field.Name.Equals("value__"))
                    {
                        continue;
                    }

                    DocStatus docStatus = (DocStatus)Enum.Parse(typeof(DocStatus), field.Name, false);
                    if (Value.ToString().Equals(docStatus.GetValue()))
                    {
                        return(docStatus);
                    }
                }

                return((DocStatus)Enum.Parse(typeof(DocStatus), Value.ToString(), false));
            }

            return((DocStatus)Value);
        }
Example #5
0
    static void Main(string[] args)
    {
        try {
            DocApi docraptor = new DocApi();
            docraptor.Configuration.Username = "******";

            Doc doc = new Doc(
                test: true,                                               // test documents are free but watermarked
                documentContent: "<html><body>Hello World</body></html>", // supply content directly
                // documentUrl: "http://docraptor.com/examples/invoice.html",  // or use a url
                name: "docraptor-csharp.pdf",                             // help you find a document later
                documentType: Doc.DocumentTypeEnum.Pdf                    // pdf or xls or xlsx
                // javascript: true,                                           // enable JavaScript processing
                // princeOptions: new PrinceOptions(
                //   media: "screen",                                          // use screen styles instead of print styles
                //   baseurl: "http://hello.com"                               // pretend URL when using document_content
                // )
                );

            DocStatus statusResponse = docraptor.CreateHostedDoc(doc);
            Console.WriteLine("Hosted Async Download URL: " + statusResponse.DownloadUrl);
        } catch (DocRaptor.Client.ApiException error) {
            Console.WriteLine(error);
        }
    }
Example #6
0
    static void Main(string[] args)
    {
        DocApi docraptor = new DocApi();

        docraptor.Configuration.Username = "******";
        // docraptor.Configuration.Debug = true; // Not supported in Csharp

        Doc doc = new Doc(
            name: "csharp-hosted-sync.pdf",
            test: true,
            documentContent: "<html><body>Hello from C#</body></html>",
            documentType: Doc.DocumentTypeEnum.Pdf
            );

        DocStatus statusResponse = docraptor.CreateHostedDoc(doc);
        WebClient webClient      = new WebClient();

        webClient.DownloadFile(statusResponse.DownloadUrl, @"/tmp/the-file-name.pdf");


        string line = File.ReadLines("/tmp/the-file-name.pdf").First();

        if (!line.Contains("%PDF-1.5"))
        {
            Console.WriteLine("unexpected file header: " + line);
            Environment.Exit(1);
        }
    }
        /// <summary>
        /// Gets the iDempiere Document Status Value
        /// </summary>
        /// <returns>The iDempiere Document Status Value</returns>
        /// <param name="docStatus">iDempiere Document Status Value</param>
        public static string GetValue(this DocStatus?docStatus)
        {
            if (docStatus == null)
            {
                return(null);
            }

            DocStatus doc = docStatus.Value;

            return(GetValue(doc));
        }
        protected void Button_Submit_Click(object sender, EventArgs e)
        {
            string exception = "";

            if (!checkNull())   //检查项是否有空
            {
                Alert.ShowInTop("有未填项,请检查!", MessageBoxIcon.Error);
                return;
            }

            PostBook pb = getPostBook();

            if (pb.WorkContentRequest.Count < 6)    //工作内容与要求至少需要6项
            {
                Alert.ShowInTop("请填写至少6项工作内容与要求!");
                return;
            }
            foreach (string[] item in pb.WorkContentRequest)        //检查是否存在工作内容与要求中填写了标题却没填其他项(考核要点不检查)
            {
                if (item[0] == "" || item[1] == "" || item[2] == "")
                {
                    Alert.ShowInTop("工作内容与要求中尚有未填写项!");
                    return;
                }
            }

            List <string> tempTitleList = new List <string>();        //检查工作内容与要求中的标题是否有重复项

            foreach (string[] item in pb.WorkContentRequest)
            {
                if (tempTitleList.Contains(item[0]))
                {
                    Alert.ShowInTop("工作内容与要求中有重复项,请重新填写", MessageBoxIcon.Error);
                    return;
                }
                tempTitleList.Add(item[0]);
            }

            DocStatus curStatus  = (DocStatus)Convert.ToInt32(Request.QueryString["status"]);
            DocStatus nextStatus = GetNextDocStatus(curStatus, DocOperation.submit);

            pb.Status = nextStatus;         //填写下一个状态域

            if (PostBookManagementCtrl.UpdatePostBook(pb, ref exception))
            {
                Alert.ShowInTop("提交成功!\n窗口即将关闭", MessageBoxIcon.Information);
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.ShowInTop("提交失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// 根据权限等级设置textarea是否为只读(人事处管理员只读)
        /// </summary>
        private void setReadonly()
        {
            AccessLevel accessLevel = (AccessLevel)Enum.Parse(typeof(AccessLevel), Session["AccessLevel"].ToString());

            if (accessLevel == AccessLevel.firstManager)    //人事处管理员不能修改
            {
                TextBox_LaborDepart.Readonly  = true;
                Label_PostName.Readonly       = true;
                TextArea_EduBg.Readonly       = true;
                TextArea_Certificate.Readonly = true;
                TextArea_Experience.Readonly  = true;
                TextArea_Skill.Readonly       = true;
                TextArea_Personality.Readonly = true;
                TextArea_PhyCond.Readonly     = true;
                TextArea_WorkOutline.Readonly = true;
                TextArea_Power.Readonly       = true;
                TextArea_Response.Readonly    = true;
                TextBox_DirectLeader.Readonly = true;
                TextBox_Subordinate.Readonly  = true;
                TextBox_Colleague.Readonly    = true;
                TextBox_Services.Readonly     = true;
                TextBox_Relations.Readonly    = true;
                TextArea_WorkEnter.Readonly   = true;
                TextArea_PostAssess.Readonly  = true;
                TextArea_Others.Readonly      = true;
            }
            else
            {
                DocStatus curStatus = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);
                if (curStatus == DocStatus.modified || curStatus == DocStatus.passed || curStatus == DocStatus.submitted) //对于系级管理员,如果当前状态为已修改、已提交、已通过则不能修改
                {
                    TextBox_LaborDepart.Readonly  = true;
                    Label_PostName.Readonly       = true;
                    TextArea_EduBg.Readonly       = true;
                    TextArea_Certificate.Readonly = true;
                    TextArea_Experience.Readonly  = true;
                    TextArea_Skill.Readonly       = true;
                    TextArea_Personality.Readonly = true;
                    TextArea_PhyCond.Readonly     = true;
                    TextArea_WorkOutline.Readonly = true;
                    TextArea_Power.Readonly       = true;
                    TextArea_Response.Readonly    = true;
                    TextBox_DirectLeader.Readonly = true;
                    TextBox_Subordinate.Readonly  = true;
                    TextBox_Colleague.Readonly    = true;
                    TextBox_Services.Readonly     = true;
                    TextBox_Relations.Readonly    = true;
                    TextArea_WorkEnter.Readonly   = true;
                    TextArea_PostAssess.Readonly  = true;
                    TextArea_Others.Readonly      = true;
                }
            }
        }
Example #10
0
        /// <summary>
        /// 设置表格中按钮的可用性和状态的颜色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_PreRowDataBound(object sender, FineUI.GridPreRowEventArgs e)
        {
            WindowField windowField_Check = Grid1.FindColumn("WindowField_Check") as WindowField;
            DataRowView row       = e.DataItem as DataRowView;
            string      strStatus = row["Status"].ToString();
            DocStatus   status    = (DocStatus)Enum.Parse(typeof(DocStatus), strStatus);

            //设置可用性
            if (status == DocStatus.unmake || status == DocStatus.saved)
            {
                windowField_Check.Enabled = false;
            }
            else
            {
                windowField_Check.Enabled = true;
            }
            //设置颜色
            System.Web.UI.WebControls.Label labelStatus = Grid1.Rows[e.RowIndex].FindControl("Status") as System.Web.UI.WebControls.Label;
            switch (status)
            {
            case DocStatus.unmake:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#8600FF");
                break;

            case DocStatus.saved:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#009100");
                break;

            case DocStatus.submitted:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#007979");
                break;

            case DocStatus.rejected:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#0000C6");
                break;

            case DocStatus.modified:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#73BF00");
                break;

            case DocStatus.passed:
                labelStatus.ForeColor = System.Drawing.Color.FromName("#408080");
                break;

            default:
                break;
            }
        }
        protected void Button_Save_Click(object sender, EventArgs e)
        {
            DocStatus     curStatus     = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);
            DocStatus     nextStatus    = GetNextDocStatus(curStatus, DocOperation.save);
            EvaluateTable evaluateTable = getNewEvaluateTable();
            string        evaluatedID   = Request.QueryString["id"];
            string        exception     = "";

            if (EvaluateTableManagementCtrl.UpdateEvaluateTable(evaluatedID, evaluateTable, nextStatus, ref exception))
            {
                Alert.ShowInTop("保存成功!", MessageBoxIcon.Information);
            }
            else
            {
                Alert.ShowInTop("保存失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        //public void assignCurrDocStatus()
        //{
        //    if (DocumentStatus.Count > 0)
        //        CurrDocStatus = DocumentStatus.OrderByDescending<PurchaseDeliveryDocStatus, DateTime?>(pp => pp.CreateDate).First<PurchaseDeliveryDocStatus>().DocStatus;

        //}
        public void AddDocStatus(DocStatus newstatus, string remarks)
        {
            PurchaseDeliveryDocStatus ds = new PurchaseDeliveryDocStatus(Session);

            ds.DocStatus        = newstatus;
            ds.DocStatusRemarks = remarks;
            if (!GeneralValues.IsNetCore)
            {
                ds.CreateUser = Session.GetObjectByKey <SystemUsers>(SecuritySystem.CurrentUserId);
            }
            else
            {
                ds.CreateUser = Session.FindObject <SystemUsers>(CriteriaOperator.Parse("UserName=?", GeneralValues.NetCoreUserName));
            }
            ds.CreateDate = DateTime.Now;
            this.DocumentStatus.Add(ds);
        }
Example #13
0
        protected virtual Icon GetStatusIcon(DocStatus status)
        {
            switch (status)
            {
            case DocStatus.PARTIAL:
                return(Icons.iconCYellow);

            case DocStatus.ALL:
                return(Icons.iconCGreen);

            case DocStatus.NONE:
                return(Icons.iconCWhite);

            case DocStatus.UNKNOWN:
            default:
                return(Icons.iconCRed);
            }
        }
Example #14
0
        /// <summary>
        /// Converts a status string into the corresponding DocStatus
        /// </summary>
        /// <param name="s">String doc status</param>
        /// <returns>DocStatus</returns>
        public static DocStatus DocStatusFromString(string s)
        {
            DocStatus status = DocStatus.Draft;

            if (s == DocStatus.Draft.ToString())
            {
                status = DocStatus.Draft;
            }
            else if (s == DocStatus.Submitted.ToString())
            {
                status = DocStatus.Submitted;
            }
            else
            {
                status = DocStatus.Cancelled;
            }
            return(status);
        }
        protected void Button_Save_Click(object sender, EventArgs e)
        {
            string   exception = "";
            PostBook pb        = getPostBook();

            DocStatus curStatus  = (DocStatus)Convert.ToInt32(Request.QueryString["status"]);
            DocStatus nextStatus = GetNextDocStatus(curStatus, DocOperation.save);

            pb.Status = nextStatus;     //填写下一个状态域

            if (PostBookManagementCtrl.UpdatePostBook(pb, ref exception))
            {
                Alert.ShowInTop("保存成功!", MessageBoxIcon.Information);
            }
            else
            {
                Alert.ShowInTop("保存失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        /// <summary>
        /// Gets the iDempiere Document Status Value
        /// </summary>
        /// <returns>The iDempiere Document Status Value</returns>
        /// <param name="docStatus">iDempiere Document Status Value</param>
        public static string GetValue(this DocStatus docStatus)
        {
            switch (docStatus)
            {
            case DocStatus.Drafted:
                return("DR");

            case DocStatus.Completed:
                return("CO");

            case DocStatus.Approved:
                return("AP");

            case DocStatus.NotApproved:
                return("NA");

            case DocStatus.Voided:
                return("VO");

            case DocStatus.Closed:
                return("CL");

            case DocStatus.Reversed:
                return("RE");

            case DocStatus.InProgress:
                return("IP");

            case DocStatus.WaitingPayment:
                return("WP");

            case DocStatus.Invalid:
                return("IN");

            case DocStatus.WaitingConfirmation:
                return("WC");

            case DocStatus.Unknown:
            default:
                return("??");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            checkSession();
            if (!IsPostBack)
            {
                if (!checkPostBook())
                {
                    Alert.ShowInTop("被考评人岗位责任书尚未通过审核!\n窗口即将关闭", MessageBoxIcon.Error);
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
                }

                Button_Close.OnClientClick        = ActiveWindow.GetConfirmHidePostBackReference();
                Button_Close_Shadow.OnClientClick = ActiveWindow.GetConfirmHidePostBackReference();

                DocStatus curStatus = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);
                if (curStatus == DocStatus.submitted || curStatus == DocStatus.passed)  //当文档状态为已提交或者已通过时,保存、提交、清空按钮不可用
                {
                    Button_Save.Enabled          = false;
                    Button_Submit.Enabled        = false;
                    Button_Clear.Enabled         = false;
                    Button_Save_Shadow.Enabled   = false;
                    Button_Submit_Shadow.Enabled = false;
                    Button_Clear_Shadow.Enabled  = false;

                    DropDownList_Template.Enabled = false;
                }

                if (curStatus == DocStatus.passed)      //只有当文档状态为已通过时,导出按钮才可用
                {
                    Button_Export.Enabled        = true;
                    Button_Export_Shadow.Enabled = true;
                }

                loadEvaluateTable("");
                bindEvaluateTableSubmittedNameIdDicToDropDownList();
            }
            if (Page.Request.Params["__EVENTTARGET"] != null && Page.Request.Params["__EVENTTARGET"].ToString().Replace('$', '_') == DropDownList_Template.ClientID)
            {
                loadEvaluateTable(DropDownList_Template.SelectedValue);
            }
        }
Example #18
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        ///  Default Constructor: For SourceViewPanel.
        /// </summary>
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public ViewerPanel()
        {
            InitializeComponent();

            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            _buffer   = new ReadBuffer();
            _scanner  = new Scanner(_buffer);
            _preview  = new TextDraw();
            Selection = new Selection(_scanner);


            _status           = new DocStatus();
            _scrollVertical   = new VScrollBar();
            _scrollHorizontal = _status.ScrollHorizontal;

            _scrollVertical.Dock = DockStyle.Right;
            _status.Dock         = DockStyle.Bottom;

            Dock = DockStyle.Fill;

            _scrollVertical.Scroll   += ScrollVerticalOnScroll;
            _scrollHorizontal.Scroll += ScrollHorizontalOnScroll;

            Controls.Add(_scrollVertical);
            Controls.Add(_status);

            // Stopwatch.StartNew();

            _scrollVertical.SmallChange   = 3;
            _scrollHorizontal.SmallChange = 3;

            _scrollVertical.BackColor = System.Drawing.SystemColors.GrayText;
            _status.BackColor         = System.Drawing.SystemColors.GrayText;

            InitializeContextMenu();
        }
        protected void Button_Submit_Click(object sender, EventArgs e)
        {
            DocStatus     curStatus     = (DocStatus)Enum.Parse(typeof(DocStatus), Request.QueryString["status"]);
            DocStatus     nextStatus    = GetNextDocStatus(curStatus, DocOperation.submit);
            EvaluateTable evaluateTable = getNewEvaluateTable();

            if (!checkEvaluateTableNull(evaluateTable))
            {
                Alert.ShowInTop("有未填写项!", MessageBoxIcon.Error);
                return;
            }

            if (!checkItemEnough(evaluateTable))
            {
                Alert.ShowInTop("考核表中每项指标至少填写两项!", MessageBoxIcon.Error);
                return;
            }

            if (!checkRepetition(evaluateTable))
            {
                Alert.ShowInTop("考核表中不允许有重复项!请检查", MessageBoxIcon.Error);
                return;
            }
            string evaluatedID = Request.QueryString["id"];
            string exception   = "";

            if (EvaluateTableManagementCtrl.UpdateEvaluateTable(evaluatedID, evaluateTable, nextStatus, ref exception))
            {
                Alert.ShowInTop("提交成功!\n窗口即将关闭", MessageBoxIcon.Information);
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.ShowInTop("提交失败!\n原因:" + exception, MessageBoxIcon.Error);
            }
        }
        public static string GetText(DocStatus statusValue)
        {
            switch (statusValue)
            {
            case DocStatus.Draft:
                return("草稿");

            case DocStatus.Published:
                return("已发布");

            case DocStatus.Overdue:
                return("已过期");

            case DocStatus.Abandon:
                return("废弃");

            case DocStatus.Review:
                return("会签");

            case DocStatus.ProofreadDraft:
                return("校稿前草稿");

            case DocStatus.Proofreading:
                return("校稿中");

            case DocStatus.Approving:
                return("审批中");

            case DocStatus.Rejected:
                return("被驳回");

            case DocStatus.Unkown:
            default:
                return("未知状态");
            }
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DocumentReference;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (MasterIdentifier != null)
                {
                    dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Class != null)
                {
                    dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (Custodian != null)
                {
                    dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy();
                }
                if (Authenticator != null)
                {
                    dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (IndexedElement != null)
                {
                    dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReferenceStatus>)StatusElement.DeepCopy();
                }
                if (DocStatus != null)
                {
                    dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy();
                }
                if (RelatesTo != null)
                {
                    dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.RelatesToComponent>(RelatesTo.DeepCopy());
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (SecurityLabel != null)
                {
                    dest.SecurityLabel = new List <Hl7.Fhir.Model.CodeableConcept>(SecurityLabel.DeepCopy());
                }
                if (Content != null)
                {
                    dest.Content = new List <Hl7.Fhir.Model.DocumentReference.ContentComponent>(Content.DeepCopy());
                }
                if (Context != null)
                {
                    dest.Context = (Hl7.Fhir.Model.DocumentReference.ContextComponent)Context.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as DocumentReference;

            if (dest != null)
            {
                base.CopyTo(dest);
                if (MasterIdentifier != null)
                {
                    dest.MasterIdentifier = (Hl7.Fhir.Model.Identifier)MasterIdentifier.DeepCopy();
                }
                if (Identifier != null)
                {
                    dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
                }
                if (Subject != null)
                {
                    dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy();
                }
                if (Type != null)
                {
                    dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy();
                }
                if (Class != null)
                {
                    dest.Class = (Hl7.Fhir.Model.CodeableConcept)Class.DeepCopy();
                }
                if (Author != null)
                {
                    dest.Author = new List <Hl7.Fhir.Model.ResourceReference>(Author.DeepCopy());
                }
                if (Custodian != null)
                {
                    dest.Custodian = (Hl7.Fhir.Model.ResourceReference)Custodian.DeepCopy();
                }
                if (PolicyManagerElement != null)
                {
                    dest.PolicyManagerElement = (Hl7.Fhir.Model.FhirUri)PolicyManagerElement.DeepCopy();
                }
                if (Authenticator != null)
                {
                    dest.Authenticator = (Hl7.Fhir.Model.ResourceReference)Authenticator.DeepCopy();
                }
                if (CreatedElement != null)
                {
                    dest.CreatedElement = (Hl7.Fhir.Model.FhirDateTime)CreatedElement.DeepCopy();
                }
                if (IndexedElement != null)
                {
                    dest.IndexedElement = (Hl7.Fhir.Model.Instant)IndexedElement.DeepCopy();
                }
                if (StatusElement != null)
                {
                    dest.StatusElement = (Code <Hl7.Fhir.Model.DocumentReference.DocumentReferenceStatus>)StatusElement.DeepCopy();
                }
                if (DocStatus != null)
                {
                    dest.DocStatus = (Hl7.Fhir.Model.CodeableConcept)DocStatus.DeepCopy();
                }
                if (RelatesTo != null)
                {
                    dest.RelatesTo = new List <Hl7.Fhir.Model.DocumentReference.DocumentReferenceRelatesToComponent>(RelatesTo.DeepCopy());
                }
                if (DescriptionElement != null)
                {
                    dest.DescriptionElement = (Hl7.Fhir.Model.FhirString)DescriptionElement.DeepCopy();
                }
                if (Confidentiality != null)
                {
                    dest.Confidentiality = new List <Hl7.Fhir.Model.CodeableConcept>(Confidentiality.DeepCopy());
                }
                if (PrimaryLanguageElement != null)
                {
                    dest.PrimaryLanguageElement = (Hl7.Fhir.Model.Code)PrimaryLanguageElement.DeepCopy();
                }
                if (MimeTypeElement != null)
                {
                    dest.MimeTypeElement = (Hl7.Fhir.Model.Code)MimeTypeElement.DeepCopy();
                }
                if (FormatElement != null)
                {
                    dest.FormatElement = new List <Hl7.Fhir.Model.FhirUri>(FormatElement.DeepCopy());
                }
                if (SizeElement != null)
                {
                    dest.SizeElement = (Hl7.Fhir.Model.Integer)SizeElement.DeepCopy();
                }
                if (HashElement != null)
                {
                    dest.HashElement = (Hl7.Fhir.Model.FhirString)HashElement.DeepCopy();
                }
                if (LocationElement != null)
                {
                    dest.LocationElement = (Hl7.Fhir.Model.FhirUri)LocationElement.DeepCopy();
                }
                if (Service != null)
                {
                    dest.Service = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceServiceComponent)Service.DeepCopy();
                }
                if (Context != null)
                {
                    dest.Context = (Hl7.Fhir.Model.DocumentReference.DocumentReferenceContextComponent)Context.DeepCopy();
                }
                return(dest);
            }
            else
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }
        }
Example #23
0
        public override ErrorList Validate()
        {
            var result = new ErrorList();

            result.AddRange(base.Validate());

            if (MasterIdentifier != null)
            {
                result.AddRange(MasterIdentifier.Validate());
            }
            if (Identifier != null)
            {
                Identifier.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Subject != null)
            {
                result.AddRange(Subject.Validate());
            }
            if (Type != null)
            {
                result.AddRange(Type.Validate());
            }
            if (Subtype != null)
            {
                result.AddRange(Subtype.Validate());
            }
            if (Author != null)
            {
                Author.ForEach(elem => result.AddRange(elem.Validate()));
            }
            if (Custodian != null)
            {
                result.AddRange(Custodian.Validate());
            }
            if (Authenticator != null)
            {
                result.AddRange(Authenticator.Validate());
            }
            if (CreatedElement != null)
            {
                result.AddRange(CreatedElement.Validate());
            }
            if (IndexedElement != null)
            {
                result.AddRange(IndexedElement.Validate());
            }
            if (StatusElement != null)
            {
                result.AddRange(StatusElement.Validate());
            }
            if (DocStatus != null)
            {
                result.AddRange(DocStatus.Validate());
            }
            if (Supercedes != null)
            {
                result.AddRange(Supercedes.Validate());
            }
            if (DescriptionElement != null)
            {
                result.AddRange(DescriptionElement.Validate());
            }
            if (Confidentiality != null)
            {
                result.AddRange(Confidentiality.Validate());
            }
            if (PrimaryLanguageElement != null)
            {
                result.AddRange(PrimaryLanguageElement.Validate());
            }
            if (MimeTypeElement != null)
            {
                result.AddRange(MimeTypeElement.Validate());
            }
            if (Format != null)
            {
                result.AddRange(Format.Validate());
            }
            if (SizeElement != null)
            {
                result.AddRange(SizeElement.Validate());
            }
            if (HashElement != null)
            {
                result.AddRange(HashElement.Validate());
            }
            if (LocationElement != null)
            {
                result.AddRange(LocationElement.Validate());
            }
            if (Service != null)
            {
                result.AddRange(Service.Validate());
            }
            if (Context != null)
            {
                result.AddRange(Context.Validate());
            }

            return(result);
        }