コード例 #1
0
        /// <summary>
        /// Returns Inward lookup values file names.
        /// </summary>
        /// <returns></returns>
        public StringBuilder GetInwardLookupValuesExcel()
        {
            try
            {
                string company_Code           = _objCurrentInfo.GetCompanyCode();
                string empMasterExcelFileName = string.Empty;
                string prdMasterExcelFileName = string.Empty;

                // Retrieve
                DataSet dsInwardLookupValues = _objSPData.GetInwardBulkUploadLookupValues(company_Code);

                // Employee Master.
                if (dsInwardLookupValues != null && dsInwardLookupValues.Tables != null && dsInwardLookupValues.Tables.Count > 0 &&
                    dsInwardLookupValues.Tables[0].Rows != null && dsInwardLookupValues.Tables[0].Rows.Count > 0)
                {
                    DataSet   dsEmpMaster = new DataSet();
                    DataTable dt          = dsInwardLookupValues.Tables[0].Copy();
                    dsEmpMaster.Tables.Add(dt);
                    empMasterExcelFileName = GetEmployeeMasterExcel(dsEmpMaster);
                }

                // Product Master.
                if (dsInwardLookupValues != null && dsInwardLookupValues.Tables != null && dsInwardLookupValues.Tables.Count > 1 &&
                    dsInwardLookupValues.Tables[1].Rows != null && dsInwardLookupValues.Tables[1].Rows.Count > 0)
                {
                    DataSet   dsProdMaster = new DataSet();
                    DataTable dt           = dsInwardLookupValues.Tables[1].Copy();
                    dsProdMaster.Tables.Add(dt);
                    prdMasterExcelFileName = GetProductMasterExcel(dsProdMaster);
                }
                StringBuilder fileNameStrings = new StringBuilder();
                fileNameStrings.Append(empMasterExcelFileName).Append("^").Append(prdMasterExcelFileName);
                return(fileNameStrings);
            }
            catch (Exception ex)
            {
                StringBuilder strMessage = new StringBuilder();
                return(strMessage.Append(ex.Message));
            }
        }