コード例 #1
0
ファイル: Memo.cs プロジェクト: kimykunjun/test
        public DataTable ViewRecipient(int nMemoID, ReceipientType aReceipientType)
        {
            SqlConnection con = new SqlConnection(SqlHelperUtils.connectionString);
            DataSet       ds  = new DataSet();

            try
            {
                con.Open();
                if (aReceipientType == ReceipientType.BranchGroup)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByBranchGroup",
                                                  new SqlParameter("@inMemoID", nMemoID));
                }
                else if (aReceipientType == ReceipientType.DepartmentGroup)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByDepartmentGroup",
                                                  new SqlParameter("@inMemoID", nMemoID));
                }
                else if (aReceipientType == ReceipientType.Employee)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByEmployee",
                                                  new SqlParameter("@inMemoID", nMemoID));
                }
                else
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByPersonalGroup",
                                                  new SqlParameter("@inMemoID", nMemoID));
                }
            }
            catch            //(Exception ex)
            {
                throw;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }

            return(ds.Tables[0]);
        }
コード例 #2
0
ファイル: Memo.cs プロジェクト: kimykunjun/test
        public DataTable ViewRecipient(int nMemoID, ReceipientType aReceipientType)
        {
            SqlConnection con = new SqlConnection(SqlHelperUtils.connectionString);
            DataSet ds = new DataSet();

            try
            {
                con.Open();
                if (aReceipientType == ReceipientType.BranchGroup)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByBranchGroup",
                        new SqlParameter("@inMemoID", nMemoID));
                }
                else if (aReceipientType == ReceipientType.DepartmentGroup)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByDepartmentGroup",
                        new SqlParameter("@inMemoID", nMemoID));
                }
                else if (aReceipientType == ReceipientType.Employee)
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByEmployee",
                        new SqlParameter("@inMemoID", nMemoID));
                }
                else
                {
                    ds = SqlHelper.ExecuteDataset(con, "pr_tblMemo_SelectReceipientByPersonalGroup",
                        new SqlParameter("@inMemoID", nMemoID));
                }
            }
            catch//(Exception ex)
            {
                throw;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }

            return ds.Tables[0];
        }