Esempio n. 1
0
        public FinalDepartureFormDetails GetDepartureFormDetails(string Instance, string SessionId, string Version, DepartureFormFilterDetails DepartureFormFilterDetails)
        {
            FinalDepartureFormDetails finalDepartureFormDetails = new FinalDepartureFormDetails();

            SICTLogger.WriteInfo(DepartureFormServices.CLASS_NAME, "GetDepartureFormDetails", "Start");
            try
            {
                UserDetailsBusiness userDetailsBusiness = new FactoryBusiness().GetUserDetailsBusiness(BusinessConstants.VERSION_BASE);
                if (userDetailsBusiness.IsSessionIdValid(SessionId, false))
                {
                    DepartureFormBusiness departureFormBusiness = new FactoryBusiness().GetDepartureFormBusiness(Version);
                    finalDepartureFormDetails = departureFormBusiness.GetDepartureFormDetails(Instance, SessionId, DepartureFormFilterDetails);
                }
                else
                {
                    finalDepartureFormDetails.ReturnCode    = 0;
                    finalDepartureFormDetails.ReturnMessage = "Invalid session";
                    SICTLogger.WriteWarning(DepartureFormServices.CLASS_NAME, "GetDepartureFormDetails", "Invalid session ");
                }
            }
            catch (Exception ex)
            {
                finalDepartureFormDetails.ReturnCode    = -1;
                finalDepartureFormDetails.ReturnMessage = "Error in API Execution";
                SICTLogger.WriteException(DepartureFormServices.CLASS_NAME, "GetDepartureFormDetails", ex);
            }
            SICTLogger.WriteInfo(DepartureFormServices.CLASS_NAME, "GetDepartureFormDetails", "End");
            return(finalDepartureFormDetails);
        }
Esempio n. 2
0
        private void InsertFormDataToWorksheet(DataTable DtForm, ref Worksheet DataSheet, ref int DataRow)
        {
            FinalDepartureFormDetails FinalDepartureFormDetails = new FinalDepartureFormDetails();

            SICTLogger.WriteInfo(DownloadBusiness.CLASS_NAME, "InsertFormDataToWorksheet", "Start ");
            try
            {
                foreach (DataRow Dr in DtForm.Rows)
                {
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 0, 12, System.Drawing.Color.White, false, false, 0, false);
                    DataSheet.Cells[DataRow, 0].PutValue(System.Convert.ToInt32(Dr[BusinessConstants.FORM_FORMID].ToString()));
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 1, 12, System.Drawing.Color.White, false, false, 0, false);
                    string AirportName = string.Empty;
                    string AirportCode = string.Empty;
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_AIRPORTNAME].ToString()))
                    {
                        AirportName = Dr[BusinessConstants.FORM_AIRPORTNAME].ToString();
                    }
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.AIRPORTCODE].ToString()))
                    {
                        AirportCode = Dr[BusinessConstants.AIRPORTCODE].ToString();
                    }
                    DataSheet.Cells[DataRow, 1].PutValue(string.Format("{0} ({1})", AirportName, AirportCode));
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 2, 12, System.Drawing.Color.White, false, false, 14, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_DISTRIBUTIONDATE].ToString()))
                    {
                        System.DateTime Date = System.Convert.ToDateTime(Dr[BusinessConstants.FORM_DISTRIBUTIONDATE].ToString()).Date;
                        DataSheet.Cells[DataRow, 2].PutValue(Date);
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 3, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_INTERVIEWERNAME].ToString()))
                    {
                        DataSheet.Cells[DataRow, 3].PutValue(Dr[BusinessConstants.FORM_INTERVIEWERNAME].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 4, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_AIRLINENAME].ToString()))
                    {
                        DataSheet.Cells[DataRow, 4].PutValue(Dr[BusinessConstants.FORM_AIRLINENAME].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 5, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_TYPE].ToString()))
                    {
                        string Type = Dr[BusinessConstants.FORM_TYPE].ToString();
                        if (Type == BusinessConstants.FORM_TYPE_DEPARTURE)
                        {
                            DataSheet.Cells[DataRow, 5].PutValue("Departure");
                        }
                        else
                        {
                            DataSheet.Cells[DataRow, 5].PutValue("Arrival");
                        }
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 6, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_DESTINATIONNAME].ToString()))
                    {
                        DataSheet.Cells[DataRow, 6].PutValue(Dr[BusinessConstants.FORM_DESTINATIONNAME].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 7, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_FLIGHTNUMBER].ToString()))
                    {
                        DataSheet.Cells[DataRow, 7].PutValue(Dr[BusinessConstants.FORM_FLIGHTNUMBER].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 8, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["Language1"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 8].PutValue(Dr["Language1"].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 9, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["StartCode1"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 9].PutValue((double)System.Convert.ToInt64(Dr["StartCode1"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 10, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["EndCode1"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 10].PutValue((double)System.Convert.ToInt64(Dr["EndCode1"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 11, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["Language2"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 11].PutValue(Dr["Language2"].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 12, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["StartCode2"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 12].PutValue((double)System.Convert.ToInt64(Dr["StartCode2"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 13, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["EndCode2"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 13].PutValue((double)System.Convert.ToInt64(Dr["EndCode2"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 14, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["Language3"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 14].PutValue(Dr["Language3"].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 15, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["StartCode3"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 15].PutValue((double)System.Convert.ToInt64(Dr["StartCode3"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 16, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["EndCode3"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 16].PutValue((double)System.Convert.ToInt64(Dr["EndCode3"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 17, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["Language4"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 17].PutValue(Dr["Language4"].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 18, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["StartCode4"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 18].PutValue((double)System.Convert.ToInt64(Dr["StartCode4"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 19, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["EndCode4"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 19].PutValue((double)System.Convert.ToInt64(Dr["EndCode4"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 20, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["Language5"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 20].PutValue(Dr["Language5"].ToString());
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 21, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["StartCode5"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 21].PutValue((double)System.Convert.ToInt64(Dr["StartCode5"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 22, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["EndCode5"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 22].PutValue((double)System.Convert.ToInt64(Dr["EndCode5"].ToString()));
                    }
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 23, 12, System.Drawing.Color.White, false, false, 0, false);
                    if (!string.IsNullOrEmpty(Dr["BusinessCards"].ToString()))
                    {
                        DataSheet.Cells[DataRow, 23].PutValue((double)System.Convert.ToInt64(Dr["BusinessCards"].ToString()));
                    }
                    string DateFormat = ConfigurationManager.AppSettings[BusinessConstants.CONFIG_FORM_DATE_FORMAT].ToString();
                    System.IFormatProvider enUsDateFormat = new System.Globalization.CultureInfo(DateFormat).DateTimeFormat;
                    this.SetExcelCellStyle(ref DataSheet, DataRow, 24, 12, System.Drawing.Color.White, false, false, 22, false);
                    if (!string.IsNullOrEmpty(Dr[BusinessConstants.FORM_LASTUPDATEDTIME].ToString()))
                    {
                        System.DateTime Date = System.Convert.ToDateTime(Dr[BusinessConstants.FORM_LASTUPDATEDTIME].ToString());
                        DataSheet.Cells[DataRow, 24].PutValue(Date);
                    }
                    DataRow++;
                }
            }
            catch (System.Exception Ex)
            {
                SICTLogger.WriteException(DownloadBusiness.CLASS_NAME, "InsertFormDataToWorksheet", Ex);
            }
            SICTLogger.WriteInfo(DownloadBusiness.CLASS_NAME, "InsertFormDataToWorksheet", "End");
        }