/// <summary>
        /// 根据文档类型,查询文档的扩展属性
        /// </summary>
        /// <returns></returns>
        public document_type getDocumentProperty(document doc)
        {
            document_type doctype = new document_type();
            List<doc_attached_property> docProList = new List<doc_attached_property>();
            doc_attached_property dp1 = new doc_attached_property();
            dp1.en_name = "Docdep";
            dp1.cn_name = "文档部门";
            dp1.is_user_define = "";
            dp1.is_display = true;
            dp1.display_width = "100";
            dp1.input_type = "";
            dp1.data_type = "字符型";
            dp1.default_value = "测试001";
            dp1.data_length = "100";
            dp1.order = "1";
            docProList.Add(dp1);
            doc_attached_property dp2 = new doc_attached_property();
            dp2.en_name = "wordsize";
            dp2.cn_name = "文档大小";
            dp2.is_user_define = "";
            dp2.is_display = false;
            dp2.display_width = "100";
            dp2.data_type = "数值型";
            dp2.default_value = "测试002";
            dp2.data_length = "80";
            dp2.order = "2";
            docProList.Add(dp2);
            doc_attached_property dp3 = new doc_attached_property();
            dp3.en_name = "wordsize";
            dp3.cn_name = "文档大小";
            dp3.is_user_define = "";
            dp3.is_display = true;
            dp3.display_width = "100";
            dp3.data_type = "数值型";
            dp3.default_value = "测试002";
            dp3.data_length = "80";
            dp3.order = "2";
            docProList.Add(dp3);
            doc_attached_property dp4 = new doc_attached_property();
            dp4.en_name = "column4";
            dp4.cn_name = "文档扩展属性1";
            dp4.is_user_define = "是";
            dp4.is_display = true;
            dp4.display_width = "100";
            dp4.order = "4";
            dp4.input_type = "SEL";

            List<doc_combobox_value> selectvlaue = new List<doc_combobox_value>();
            doc_combobox_value v1 = new doc_combobox_value();
            v1.value = "1000";
            doc_combobox_value v2 = new doc_combobox_value();
            v2.value = "2000";
            selectvlaue.Add(v1);
            selectvlaue.Add(v2);
            dp4.ComboxValue = selectvlaue;
            docProList.Add(dp4);
            doctype.DocProperty = docProList;
            return doctype;
        }
        /// <summary>
        /// 根据文档属性来查询文档属性
        /// </summary>
        /// <param name="docType"></param>
        /// <returns></returns>
        public document_type getDocumentColumnByType(document_type docType)
        {
            //根据文档类型,查找文档的属性
            document_type type = new document_type();
            doc_attached_property p1 = new doc_attached_property();
            p1.cn_name = "";
            p1.en_name = "";

            return type;
        }
Exemple #3
0
 /// <summary>
 /// 自定义构造函数
 /// </summary>
 /// <param name="docp"></param>
 public AddDocProperty(doc_attached_property docp)
 {
     InitializeComponent();
     this.docProperty = docp;
 }
Exemple #4
0
 /// <summary>
 ///  保存事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, EventArgs e)
 {
     doc_attached_property docp = new doc_attached_property();
     docp.cn_name = this.txtCnName.Text;
     docp.data_length = this.txtWidth.Text;
     docp.data_type = this.cmbDataType.Text;
     docp.default_value = this.txtDefaultValue.Text;
     docp.en_name = this.txtEnName.Text;
     docp.required = this.chkRequired.Checked ? "Y" : "N";
     if (this.rgInputType.SelectedIndex == 0)
     {
         docp.input_type = "TXT";
     }
     else
     {
         docp.input_type = "SEL";
         List<doc_combobox_value> list = new List<doc_combobox_value>();
         // 循环获取下拉框值,是选中列表框
         for (int i = 0; i < this.lbSelectValue.ItemCount; i++)
         {
             doc_combobox_value v = new doc_combobox_value();
             v.value = this.lbSelectValue.Items[i].ToString();
             list.Add(v);
         }
         docp.ComboxValue = list;
     }
     /// 设置默认值
     docp.is_display = true;
     docp.display_width = "100";
     docp.is_user_define = "是";
     this.docProperty = docp;
     MessageBox.Show("录入成功");
     this.DialogResult = DialogResult.OK;
     this.Close();
 }