public FileLoader(Handler handler, ICommonData commonParams, IAppManagement appManagement, IRelativePositions relativePositions)
        {
            if (handler == Handler.Continent)
            {
                _appname          = Constants.AppName;
                _supportedVersion = Constants.SupportedVersrion;
            }

            if (handler == Handler.RUVN)
            {
                _appname          = Constants.RUVN_AppName;
                _supportedVersion = Constants.RUVNSupportedVersrion;
            }

            if (handler == Handler.RUNN)
            {
                _appname          = Constants.RUNN_AppName;
                _supportedVersion = Constants.RUNNSupportedVersrion;
            }

            _handler           = handler;
            _commonParams      = commonParams;
            _appManagement     = appManagement;
            _relativePositions = relativePositions;


            _serializer = new Serializer();
        }
Example #2
0
        public AndroidApplicationContext(BaseScreen baseActivity, Settings settings, Action loadComplete)
        {
            ApplicationBackground += () => { };
            ApplicationRestore    += () => { };

            GlobalVariables = new Dictionary <string, object>();

            _baseActivity = baseActivity;
            _settings     = settings;
            _loadComplete = loadComplete;

            LocationProvider          = new GpsProvider(_baseActivity);
            LocationTracker           = new GpsTracker(_baseActivity);
            GalleryProvider           = new GalleryProvider(_baseActivity, this);
            CameraProvider            = new CameraProvider(_baseActivity, this);
            DialogProvider            = new DialogProvider(_baseActivity, this);
            DisplayProvider           = new DisplayProvider();
            ClipboardProvider         = new ClipboardProvider(_baseActivity);
            EmailProvider             = new EmailProvider(_settings, _baseActivity);
            JokeProviderInternal      = new JokeProvider(_baseActivity);
            LocalNotificationProvider = new LocalNotificationProvider(_baseActivity);
            WebProvider = new WebProvider(_baseActivity);

            var builder = new SolutionBuilder(this);

            builder.Build();

            _commonData = ValueStackContext.Current.CreateCommonData("Android");
        }
Example #3
0
        public CommonDataController(CommonDataViewModel ViewModel, IMessenger Messenger, ICommonData CommonData)
        {
            viewModel = ViewModel;

            messenger = Messenger;

            commonData = CommonData;
        }
        public ClassesController(ClassesViewModel ViewModel, IMessenger Messenger, IMapper Mapper, ICommonData CommonData)
        {
            viewModel = ViewModel;

            messenger = Messenger;
            mapper    = Mapper;

            commonData = CommonData;
        }
Example #5
0
        void LoadApplication(bool clearCache)
        {
            if (String.IsNullOrEmpty(Settings.UserName) || String.IsNullOrEmpty(Settings.Password))
            {
                Logon(clearCache);
                return;
            }

            try {
                _backgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() => {
                });

                if (this.Dal == null)
                {
                    XmlDocument document = LoadMetadata();
                    Uri         uri      = new Uri(Settings.Url);

                    //to create db here
                    DbContext.Current.InitDatabase(Settings.BaseUrl);
                    IOfflineContext context = SyncContext.Current.CreateOfflineContext(document, uri.Host, uri);

                    var configuration = document.DocumentElement;
                    Settings.ConfigName    = configuration.Attributes ["Name"].Value;
                    Settings.ConfigVersion = configuration.Attributes ["Version"].Value;
                    Settings.WriteSettings();

                    IDictionary <string, string> deviceInfo = GetDeviceInfo();

                    this.Dal = DalContext.Current.CreateDal
                                   (context
                                   , Settings.Application
                                   , Settings.Language
                                   , Settings.UserName
                                   , Settings.Password
                                   , Settings.ConfigName
                                   , Settings.ConfigVersion
                                   , deviceInfo
                                   , UpdateLoadStatus);

                    this._commonData = ValueStackContext.Current.CreateCommonData();

                    this.Settings.ConfigName    = Dal.ConfigName;
                    this.Settings.ConfigVersion = Dal.ConfigVersion;
                }

                LogonComplete(clearCache);
            } catch (CustomException ex) {
                Logon(clearCache, ex.FriendlyMessage);
            } catch (UriFormatException) {
                Logon(clearCache, D.INVALID_ADDRESS);
            }
        }
Example #6
0
 void SelectedProvinceItemTypeChanged(object sender, EventArgs e)
 {
     if (ddlprovince.SelectedValue != string.Empty && int.Parse(ddlprovince.SelectedValue) > 0)
     {
         BindFunctions BindManager = new BindFunctions();
         int           provinceID  = int.Parse(ddlprovince.SelectedValue);
         ICommonData   oCommonData = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData,BusinessProcess.Service");
         DataTable     theDT       = (DataTable)oCommonData.getAllDistrict();
         DataView      theDV       = theDT.DefaultView;
         theDV.RowFilter = "ProvinceID = " + provinceID + "";
         if (theDV != null && theDV.Table.Rows.Count > 0)
         {
             BindManager.BindCombo(ddldistrict, theDV.ToTable(), "Name", "ID");
             theDT.Clear();
         }
     }
 }
Example #7
0
 /// <summary>
 /// Handles the SelectedIndexChanged event of the ddlMainItem control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 /// <exception cref="System.NotImplementedException"></exception>
 void SelectedCountryItemTypeChanged(object sender, EventArgs e)
 {
     if (ddCountry.SelectedValue != string.Empty && int.Parse(ddCountry.SelectedValue) > 0)
     {
         BindFunctions BindManager = new BindFunctions();
         int           countryID   = int.Parse(ddCountry.SelectedValue);
         //if (ddCountry.SelectedItem.ToString() == "Kenya")
         //{
         //    Session["SystemId"] = "1";
         //    var configuration = WebConfigurationManager.OpenWebConfiguration("~");
         //    configuration.AppSettings.Settings["SystemId"].Value = Session["SystemId"].ToString();
         //    configuration.Save();
         //}
         //else if (ddCountry.SelectedItem.ToString() == "Tanzania")
         //{
         //    Session["SystemId"] = "2";
         //    var configuration = WebConfigurationManager.OpenWebConfiguration("~");
         //    configuration.AppSettings.Settings["SystemId"].Value = Session["SystemId"].ToString();
         //    configuration.Save();
         //}
         //else if (ddCountry.SelectedItem.ToString() == "Niger" || ddCountry.SelectedItem.ToString() == "Nigeria")
         //{
         //    Session["SystemId"] = "3";
         //    var configuration = WebConfigurationManager.OpenWebConfiguration("~");
         //    configuration.AppSettings.Settings["SystemId"].Value = Session["SystemId"].ToString();
         //    configuration.Save();
         //}
         //else
         //{
         //    Session["SystemId"] = "1";
         //    var configuration = WebConfigurationManager.OpenWebConfiguration("~");
         //    configuration.AppSettings.Settings["SystemId"].Value = Session["SystemId"].ToString();
         //    configuration.Save();
         //}
         ICommonData oCommonData = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData,BusinessProcess.Service");
         DataTable   theDT       = (DataTable)oCommonData.getAllProvince();
         DataView    theDV       = theDT.DefaultView;
         theDV.RowFilter = "CountryID = " + countryID + "";
         if (theDV != null && theDV.Table.Rows.Count > 0)
         {
             BindManager.BindCombo(ddlprovince, theDV.ToTable(), "Name", "ID");
             theDT.Clear();
         }
     }
 }
Example #8
0
		void LoadApplication (bool clearCache)
		{
			if (String.IsNullOrEmpty (Settings.UserName) || String.IsNullOrEmpty (Settings.Password)) {
				Logon (clearCache);
				return;
			}

			try {
				_backgroundTaskId =	UIApplication.SharedApplication.BeginBackgroundTask (() => {
				});

				if (this.Dal == null) {
					XmlDocument document = LoadMetadata ();
					Uri uri = new Uri (Settings.Url);

					//to create db here
					DbContext.Current.InitDatabase (Settings.BaseUrl);
					IOfflineContext context = SyncContext.Current.CreateOfflineContext (document, uri.Host, uri);

					var configuration = document.DocumentElement;
					Settings.ConfigName = configuration.Attributes ["Name"].Value;
					Settings.ConfigVersion = configuration.Attributes ["Version"].Value;
					Settings.WriteSettings ();

					IDictionary<string, string> deviceInfo = GetDeviceInfo ();

					this.Dal = DalContext.Current.CreateDal
						(context
						, Settings.Application
						, Settings.Language
						, Settings.UserName
						, Settings.Password
						, Settings.ConfigName
						, Settings.ConfigVersion
						, deviceInfo
						, UpdateLoadStatus);

					this._commonData = ValueStackContext.Current.CreateCommonData ();

					this.Settings.ConfigName = Dal.ConfigName;
					this.Settings.ConfigVersion = Dal.ConfigVersion;
				}

				LogonComplete (clearCache);

			} catch (CustomException ex) {
				Logon (clearCache, ex.FriendlyMessage);
			} catch (UriFormatException) {
				Logon (clearCache, D.INVALID_ADDRESS);
			}
		}
        private string GetCIFData(int PatientId)
        {
            string      result   = string.Empty;
            IQCareUtils theUtils = new IQCareUtils();
            ICommonData iComm    = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData, BusinessProcess.Service");

            try
            {
                IHTSClientIntake clientIntake;
                clientIntake = (IHTSClientIntake)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BHTSClientIntake, BusinessProcess.Clinical");
                HTSClientIntake CI = clientIntake.GetClientIntakeFormData(PatientId, 0);

                DataView  theCodeDV = new DataView(iComm.getAllProvinceByCountry(160));
                DataTable theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        States st = new States();
                        st.StateID   = Convert.ToInt32(row["ID"].ToString());
                        st.StateName = row["Name"].ToString();
                        CI.AllStates.Add(st);
                    }
                }

                theCodeDV = new DataView(iComm.getAllDistrict());
                theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        LGAs lg = new LGAs();
                        lg.LgaID   = Convert.ToInt32(row["ID"].ToString());
                        lg.LgaName = row["Name"].ToString();
                        CI.AllLGAs.Add(lg);
                    }
                }

                theCodeDV = new DataView(iComm.getAllEmployees());
                theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        UserDesignation ug = new UserDesignation();
                        ug.UserID   = Convert.ToInt32(row["UserID"].ToString());
                        ug.UserName = row["UserName"].ToString();
                        CI.UserList.Add(ug);
                    }
                }

                result = SerializerUtil.ConverToJson <HTSClientIntake>(CI);
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "GetClientIntakeFormData() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            return(result);
        }
Example #10
0
    private void Init_Form()
    {
        //txtcountryno.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtcountryno.ClientID + "')");
        //txtcountryno.Attributes.Add("onblur", "chkPostiveInteger('" + txtcountryno.ClientID + "')");

        txtLPTF.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtLPTF.ClientID + "')");
        txtLPTF.Attributes.Add("onblur", "chkPostiveInteger('" + txtLPTF.ClientID + "')");

        txtSatelliteID.Attributes.Add("onkeyup", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')");
        txtSatelliteID.Attributes.Add("onblur", "chkPostiveInteger('" + txtSatelliteID.ClientID + "')");
        txtNationalId.Attributes.Add("onKeyup", "chkNumeric('" + txtNationalId.ClientID + "')");



        txtfacilityname.Text = "";
        //txtcountryno.Text = "";
        txtLPTF.Text              = "";
        txtSatelliteID.Text       = "";
        txtGrace.Text             = "";
        txtPEPFAR_Fund.Value      = "";
        cmbCurrency.SelectedValue = "0";
        if (Session["SystemId"].ToString() == "2")
        {
            paperless.Visible = false;
        }
        //BindCombo();
        //ddBackupTime.SelectedValue = "0";


        BindFunctions BindManager = new BindFunctions();
        IQCareUtils   theUtils    = new IQCareUtils();
        DataSet       theDSXML    = new DataSet();

        theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));

        DataView  theDV;
        DataTable theDT = new DataTable();

        //theDV = new DataView(theDSXML.Tables["Mst_District"]);
        ICommonData oCommonData = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData,BusinessProcess.Service");

        theDT = (DataTable)oCommonData.getAllCountries();
        //theDV.RowFilter = "SystemID=" + Session["SystemId"] + "";
        if (theDT != null && theDT.Rows.Count > 0)
        {
            //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddCountry, theDT, "CountryName", "CountryID");
            //theDV.Dispose();
            theDT.Clear();
        }

        theDT = (DataTable)oCommonData.getAllProvince();
        DataView dv = new DataView(theDT);

        dv.RowFilter = "CountryID= " + Session["AppCountryId"] + "";
        DataTable theDTSpecific = (DataTable)theUtils.CreateTableFromDataView(dv);

        if (theDTSpecific.Rows.Count > 0)
        {
            BindManager.BindCombo(ddlprovince, theDTSpecific, "Name", "ID");
        }
        else if (theDT != null && theDT.Rows.Count > 0)
        {
            //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddlprovince, theDT, "Name", "ID");
            //theDV.Dispose();
            theDT.Clear();
        }

        theDT = (DataTable)oCommonData.getAllDistrict();
        // theDV.RowFilter = "SystemID= " + Session["SystemId"] + "";
        if (theDT != null && theDT.Rows.Count > 0)
        {
            //theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
            BindManager.BindCombo(ddldistrict, theDT, "Name", "ID");
            //theDV.Dispose();
            theDT.Clear();
        }



        /////////////////////////////////////////////////
        IFacilitySetup FacilityManager = (IFacilitySetup)ObjectFactory.CreateInstance("BusinessProcess.Administration.BFacility, BusinessProcess.Administration");
        DataSet        theDSFacility   = FacilityManager.GetModuleName();
        DataTable      DT = theDSFacility.Tables[0];

        BindManager.BindCheckedList(cblPMTCT, DT, "modulename", "moduleid");

        // Binding Drug Stores
        DataSet theDSDrugStores = FacilityManager.GetDrugStores();

        BindManager.BindCheckedList(CBL_DrugStore, theDSDrugStores.Tables[0], "Name", "StoreId");
    }
        public AndroidApplicationContext(BaseScreen baseActivity, Settings settings, Action loadComplete)
        {
            ApplicationBackground += () => { };
            ApplicationRestore += () => { };

            GlobalVariables = new Dictionary<string, object>();

            _baseActivity = baseActivity;
            _settings = settings;
            _loadComplete = loadComplete;

            LocationProvider = new GpsProvider(_baseActivity);
            LocationTracker = new GpsTracker(_baseActivity);
            GalleryProvider = new GalleryProvider(_baseActivity, this);
            CameraProvider = new CameraProvider(_baseActivity, this);
            DialogProvider = new DialogProvider(_baseActivity, this);
            DisplayProvider = new DisplayProvider();
            ClipboardProvider = new ClipboardProvider(_baseActivity);
            EmailProvider = new EmailProvider(_settings, _baseActivity);
            JokeProviderInternal = new JokeProvider(_baseActivity);
            LocalNotificationProvider = new LocalNotificationProvider(_baseActivity);
            WebProvider = new WebProvider(_baseActivity);

            var builder = new SolutionBuilder(this);
            builder.Build();

            _commonData = ValueStackContext.Current.CreateCommonData("Android");
        }
Example #12
0
 public HomeController(ICommonData commonData)
 {
     _commonData = commonData;
 }
Example #13
0
 public Person(ICommonData <Person> icommonData)
 {
     _icommonData = icommonData;
 }