Exemplo n.º 1
0
        public StringBuilder GetInwardExcelDataUserBased(string users_Json, string product_Json, string product_type_name, string division_name)
        {
            try
            {
                CreateFileName(product_type_name, division_name);
                string   company_code        = _objCurrentInfo.GetCompanyCode();
                string[] hiddenColumns       = new string[] { };
                string[] editableColumnNames = new string[] { };
                string[] hiddenColumnNames   = new string[] { };
                _objExcelConverter = new ExcelFactory();
                BLMaster objBlMaster       = new BLMaster();
                DataSet  dsInwardExcelData = new DataSet();
                dsInwardExcelData = objBlMaster.GetInwardExcelDataUserBased(company_code, users_Json, product_Json);
                if (dsInwardExcelData.Tables != null && dsInwardExcelData.Tables[0].Rows != null && dsInwardExcelData.Tables[0].Rows.Count > 0)
                {
                    dsInwardExcelData.Tables[0].Columns.Add("Quantity", typeof(string));
                    DataRowCollection    dr = dsInwardExcelData.Tables[0].Rows;
                    DataColumnCollection dc = dsInwardExcelData.Tables[0].Columns;

                    _objExcelConverter.DataSetToExcel(DOWNLOAD_PATH_KEY_NAME, _fileNameString.ToString(), dsInwardExcelData, hiddenColumnNames, hiddenColumns, false, editableColumnNames);
                }
                else
                {
                    StringBuilder str = new StringBuilder("No Data Found.");
                    return(str);
                }
                StringBuilder MasterfilenameStrings = GetInwardLookupValuesExcel();
                return(_fileNameString.Append("^").Append(MasterfilenameStrings));
            }
            catch (Exception ex)
            {
                return(_fileNameString.Append(ex.Message));
            }
        }
Exemplo n.º 2
0
        private string GetProductMasterExcel(DataSet dsProdMaster)
        {
            string company_code = _objCurrentInfo.GetCompanyCode();

            string[] hiddenColumns       = new string[] { };
            string[] editableColumnNames = new string[] { };
            string[] hiddenColumnNames   = new string[] { };
            _objExcelConverter = new ExcelFactory();
            _objExcelConverter.DataSetToExcel(DOWNLOAD_PATH_KEY_NAME, PRODUCT_MASTER_FILE_NAME, dsProdMaster, hiddenColumnNames, hiddenColumns, false, editableColumnNames);
            return(PRODUCT_MASTER_FILE_NAME);
        }
Exemplo n.º 3
0
        private string GetEmployeeMasterExcel(DataSet dsEmployeeMaster)
        {
            string fileNamewithPath = string.Empty;

            try
            {
                string   company_code        = _objCurrentInfo.GetCompanyCode();
                string[] hiddenColumns       = new string[] { };
                string[] editableColumnNames = new string[] { };
                string[] hiddenColumnNames   = new string[] { };
                _objExcelConverter = new ExcelFactory();
                _objExcelConverter.DataSetToExcel(DOWNLOAD_PATH_KEY_NAME, EMPLOYEE_USER_MASTER_FILE_NAME, dsEmployeeMaster, hiddenColumnNames, hiddenColumns, false, editableColumnNames);
                return(EMPLOYEE_USER_MASTER_FILE_NAME);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }