示例#1
0
 private void GetDocuType()
 {
     try
     {
         ds = _objDocumentBL.GetDocumentType();
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             //ddlDocType.Items.Clear();
             //ddlDocType.Items.Add(new ListItem("-Select-", "-1"));
             //ddlDocType.DataSource = ds.Tables[0];
             //ddlDocType.DataTextField = "DocumentType";
             //ddlDocType.DataValueField = "TypeId";
             //ddlDocType.DataBind();
             allDocType = ds.Tables[0].AsEnumerable().ToDictionary <DataRow, string, string>(row => row.Field <int>(0).ToString(), row => row.Field <string>(1));
         }
     }
     catch
     {
         lblTitle.Text      = "Warning!";
         lblTitle.ForeColor = System.Drawing.Color.Red;
         message.ForeColor  = System.Drawing.Color.Red;
         message.Text       = "Sorry,Something went wrong, please contact administrator";
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal();", true);
     }
 }