示例#1
0
        public async void GetAllDepartmentEmployeeName()
        {
            try
            {
                string     Url        = StatusModel.Url + "GetAllDepartmentEmployeeName";
                WebHelpper _objHelper = new WebHelpper();
                GetAllDepartmentEmployeeNameModel _objGetAllDepartmentEmployeeNameModel = new GetAllDepartmentEmployeeNameModel();


                var request = await _objHelper.MakeGetRequest(Url);

                ResultGetAllDepartmentEmployeeNameModel = JsonConvert.DeserializeObject <List <GetAllDepartmentEmployeeNameModel> >(request);

                AllDepartmentEmployeeName = new string[ResultGetAllDepartmentEmployeeNameModel.Count + 1];

                int i = 1;
                AllDepartmentEmployeeName[0] = "--Select Department Employee Name--";
                foreach (var item in ResultGetAllDepartmentEmployeeNameModel)
                {
                    AllDepartmentEmployeeName[i] = item.EmployeeName;
                    i++;
                }

                ArrayAdapter _adapterAllDepartmentEmployeeName = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, AllDepartmentEmployeeName);
                txt_EmployeeName.Adapter = _adapterAllDepartmentEmployeeName;
            }
            catch (Exception e)
            {
                string ErrorMsg = e.ToString();
                Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show();
            }
        }
示例#2
0
        public async void GetAllDesignation()
        {
            try
            {
                string                Url                   = StatusModel.Url + "GetDesignationMaster";
                WebHelpper            _objHelper            = new WebHelpper();
                tbl_DesignationMaster _objDesignationMaster = new tbl_DesignationMaster();


                var request = await _objHelper.MakeGetRequest(Url);

                ResultAllDesignationMaster = JsonConvert.DeserializeObject <List <tbl_DesignationMaster> >(request);

                Designation = new string[ResultAllDesignationMaster.Count + 1];

                int i = 1;
                Designation[0] = "--Select Designation--";
                foreach (var item in ResultAllDesignationMaster)
                {
                    Designation[i] = item.DesignationName;
                    i++;
                }


                ArrayAdapter _adapterDesignation = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, Designation);

                txt_EmployeeDesignationID.Adapter = _adapterDesignation;
            }
            catch (Exception e)
            {
                string ErrorMsg = e.ToString();
                Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show();
            }
        }
示例#3
0
        public async void GetAllContractor()
        {
            try
            {
                string                Url                  = StatusModel.Url + "GetContractorMaster";
                WebHelpper            _objHelper           = new WebHelpper();
                ContractorMasterModel _objContractorMaster = new ContractorMasterModel();


                var request = await _objHelper.MakeGetRequest(Url);

                ResultAllContractorMaster = JsonConvert.DeserializeObject <List <ContractorMasterModel> >(request);

                Contractor = new string[ResultAllContractorMaster.Count + 1];

                int i = 1;
                Contractor[0] = "--Select Contractor--";
                foreach (var item in ResultAllContractorMaster)
                {
                    Contractor[i] = item.ContractorName;
                    i++;
                }

                ArrayAdapter _adapterContractor = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, Contractor);
                txt_VendorContractorName.Adapter = _adapterContractor;
            }
            catch (Exception e)
            {
                string ErrorMsg = e.ToString();
                Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show();
            }
        }
示例#4
0
        public async void GetAllDepartment()
        {
            try
            {
                string               Url                  = StatusModel.Url + "GetDepartmentMaster";
                WebHelpper           _objHelper           = new WebHelpper();
                tbl_DepartmentMaster _objDepartmentMaster = new tbl_DepartmentMaster();


                //using (var client = new WebClient())
                //{
                //    client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
                //    var responce = client.UploadString(new Uri(Url), "GET");
                //    ResultAllDepartmentMaster = JsonConvert.DeserializeObject < List<tbl_DepartmentMaster>>(responce);

                //}

                var request = await _objHelper.MakeGetRequest(Url);

                ResultAllDepartmentMaster = JsonConvert.DeserializeObject <List <tbl_DepartmentMaster> >(request);

                Department = new string[ResultAllDepartmentMaster.Count + 1];

                int i = 1;
                Department[0] = "--Select Department--";
                foreach (var item in ResultAllDepartmentMaster)
                {
                    Department[i] = item.DepartmentName;
                    i++;
                }

                ArrayAdapter _adapterDepartment = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, Department);
                txt_EmployeeDepartmentID.Adapter = _adapterDepartment;
            }
            catch (Exception e)
            {
                string ErrorMsg = e.ToString();
                Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show();
            }
        }
示例#5
0
        public async void GetVendorUserMaxSrNo()
        {
            try
            {
                WebHelpper _objHelper = new WebHelpper();

                string Url = StatusModel.Url + "GetVendorUserMaxSrNo";

                progressDialog = ProgressDialog.Show(this, Android.Text.Html.FromHtml("<font color='#EC407A'> Please wait...</font>"), Android.Text.Html.FromHtml("<font color='#EC407A'> Data Checking...</font>"), true);

                var request = await _objHelper.MakeGetRequest(Url);

                var _objVendorUserRegistrationModel = JsonConvert.DeserializeObject <VendorUserRegistrationModel>(request);

                txt_VendorUserID.Text = "M&M" + _objVendorUserRegistrationModel.VendorSrNo;
                progressDialog.Hide();
            }
            catch (Exception e)
            {
                progressDialog.Hide();
                string ErrorMsg = e.ToString();
                Toast.MakeText(this, ErrorMsg, ToastLength.Long).Show();
            }
        }