public List <ApprovalDetailsModel> POApprovalDetails(string UserId, ApprovalRoleType roleType, ApprovalType approvalType) { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@userid", UserId), new SqlParameter("@ApprovalRolType", (int)roleType), new SqlParameter("@ApprovalType", (int)approvalType) }; DataTable dt = ExecuteDataTable("BiMob.dbo.sp_POapprovalDetails_mobile", param); List <ApprovalDetailsModel> approvalList = new List <ApprovalDetailsModel>(); ApprovalDetailsModel user = null; foreach (DataRow row in dt.Rows) { string jsonValue = row.Field <string>("JsonValue"); List <ApprovalDataModel> _approvalDataList = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ApprovalDataModel> >(jsonValue); user = new ApprovalDetailsModel { ApprovalDataList = Newtonsoft.Json.JsonConvert.DeserializeObject <List <ApprovalDataModel> >(row.Field <string>("JsonValue")), POID = row.Field <string>("POID"), isApproved = false }; approvalList.Add(user); } return(approvalList); }
public List <ApprovalDetailsModel> GetPOApprovalDetails(string userid, ApprovalRoleType roleType, ApprovalType approvalType) { userid = Cipher.Decrypt(userid); List <ApprovalDetailsModel> approvalList = dbApproval.POApprovalDetails(userid, roleType, approvalType); return(approvalList); }
public int SavePOApprovalDetails(string ApprovalID, string ApproveByID, string ApprovedBy, string ApprovaStatus, ApprovalType approvalType, ApprovalRoleType approvalRoleType, string Remarks) { ApproveByID = Cipher.Decrypt(ApproveByID); int result = dbApproval.ProcessApproval(ApprovalID, ApproveByID, ApprovedBy, ApprovaStatus, approvalType, approvalRoleType, Remarks); //int result = 1; return(result); }
public async Task <int> SavePOApprovalDetails(string ApprovalID, string ApproveByID, string ApprovedBy, string ApprovaStatus, ApprovalType approvalType, ApprovalRoleType approvalRoleType, string Remarks = "") { ApproveByID = Cipher.Encrypt(ApproveByID); string url = RepositorySettings.BaseURl + "Approval?ApprovalID=" + ApprovalID + "&ApproveByID=" + ApproveByID + "&ApprovedBy=" + ApprovedBy + "&ApprovaStatus=" + ApprovaStatus + "&approvalType=" + approvalType + "&approvalRoleType=" + approvalRoleType + "&Remarks=" + Remarks; HttpClient client = new HttpClient(); HttpResponseMessage result = await client.PostAsync(url, null); return(JsonConvert.DeserializeObject <int>(result.Content.ReadAsStringAsync().Result)); }
public int ProcessApproval(string ApprovalID, string ApproveByID, string ApprovedBy, string ApprovaStatus, ApprovalType approvalType, ApprovalRoleType approvalRoleType, string Remarks) { SqlParameter[] param = new SqlParameter[] { new SqlParameter("@ApprovalID", ApprovalID), new SqlParameter("@ApproveByID", ApproveByID), new SqlParameter("@ApprovedBy", ApprovedBy), new SqlParameter("@ApprovaStatus", ApprovaStatus), new SqlParameter("@ApprovalType", (int)approvalType), new SqlParameter("@ApprovalRoleType", (int)approvalRoleType), new SqlParameter("@Remarks", Remarks) }; int result = ExecuteNoResult("BiMob.dbo.sp_ProcessApproval_mobile", param); return(result); }
public async Task <List <ApprovalDetailsModel> > GetPOApprovalDetails(string userid, ApprovalRoleType roleType, ApprovalType approvalType) { userid = Cipher.Encrypt(userid); string url = RepositorySettings.BaseURl + "Approval?userid=" + userid + "&roleType=" + roleType + "&approvalType=" + approvalType; HttpClient client = new HttpClient(); HttpResponseMessage result = await client.GetAsync(url); return(JsonConvert.DeserializeObject <List <ApprovalDetailsModel> >(result.Content.ReadAsStringAsync().Result)); }
protected override void OnCreate(Bundle savedInstanceState) { builder = new Android.App.AlertDialog.Builder(this); builder.SetMessage("Hello, World!"); builder.SetNegativeButton("Cancel", (s, e) => { /* do something on Cancel click */ }); base.OnCreate(savedInstanceState); _approvalList = new ApprovalDetailList(this); _approvalType = (ApprovalType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalType"))); _approvalRoleType = (ApprovalRoleType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalRoleType"))); SupportRequestWindowFeature(WindowCompat.FeatureActionBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetCustomView(Resource.Layout.custom_actionbar); rltitle = FindViewById <RelativeLayout>(Resource.Id.rltitle); SetContentView(Resource.Layout.ApprovalDetailList); lvApprovalDetailList = FindViewById <AnimatedExpandableListView>(Resource.Id.lvApprovalsDetails); _chkApproveAll = FindViewById <CheckBox>(Resource.Id.chkSelectAll); rlMsg = FindViewById <RelativeLayout>(Resource.Id.rlMsg); rlapprovalDetail = FindViewById <RelativeLayout>(Resource.Id.rlapprovalDetail); if (bitopiApplication.ApprovalRoleType == ApprovalRoleType.Recommend) { (FindViewById <Button>(Resource.Id.btnApproveAll)).Text = "RECOMMEND SELECTED"; (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Text = "NOT RECOMMEND SELECTED"; } else { (FindViewById <Button>(Resource.Id.btnApproveAll)).Text = "APPROVE SELECTED"; (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Text = "NOT APPROVE SELECTED"; } (FindViewById <Button>(Resource.Id.btnApproveAll)).Click += (s, e) => { builder.SetMessage("Do you want to " + (bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve ? "Approve" : "Recommend ") + _approvalList.Where(t => t.isApproved == true).Count() + " Approval"); builder.SetPositiveButton("OK", (sender, evnt) => { var progressDialog = ProgressDialog.Show(this, null, "", true); _approvalList.SaveSelected((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve ? "Approved" : "Recommended"), (numberOfSuccessFullOperation) => { progressDialog.Dismiss(); var tempApprovalList = _approvalList.Where(t => t.isDeleted == false).ToList(); _approvalList = new ApprovalDetailList(this); tempApprovalList.ForEach(st => _approvalList.Add(st)); _approvalListAdapter.SetData(_approvalList); _approvalListAdapter.NotifyDataSetChanged(); Toast.MakeText(this, "Total " + numberOfSuccessFullOperation + " Approval has been " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Approved" : "Recommended"), ToastLength.Long).Show(); if (numberOfSuccessFullOperation > 0 && _approvalList.Count == 0) { rlMsg.Visibility = ViewStates.Visible; rlapprovalDetail.Visibility = ViewStates.Gone; } }); /* do something on OK click */ }); builder.Create().Show(); }; (FindViewById <Button>(Resource.Id.btnNotApproveAll)).Click += (s, e) => { builder.SetMessage("Do you want to " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Reject" : "Not Recommend ") + _approvalList.Where(t => t.isApproved == true).Count() + " Approval"); builder.SetPositiveButton("OK", (sender, evnt) => { var progressDialog = ProgressDialog.Show(this, null, "", true); _approvalList.SaveSelected((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Rejected" : "NotRecommend", (numberOfSuccessFullOperation) => { progressDialog.Dismiss(); var tempApprovalList = _approvalList.Where(t => t.isDeleted == false).ToList(); _approvalList = new ApprovalDetailList(this); tempApprovalList.ForEach(st => _approvalList.Add(st)); _approvalListAdapter.SetData(_approvalList); _approvalListAdapter.NotifyDataSetChanged(); Toast.MakeText(this, "Total " + numberOfSuccessFullOperation + " Approval has been " + ((bitopiApplication.ApprovalRoleType == ApprovalRoleType.Approve) ? "Rejected" : "Not Recommended"), ToastLength.Long).Show(); if (numberOfSuccessFullOperation > 0 && _approvalList.Count == 0) { rlMsg.Visibility = ViewStates.Visible; rlapprovalDetail.Visibility = ViewStates.Gone; } }); }); builder.Create().Show(); }; RLleft_drawer = FindViewById <RelativeLayout>(Resource.Id.RLleft_drawer); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Visibility = ViewStates.Visible; FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Click += (s, e) => { if (mDrawerLayout.IsDrawerOpen(RLleft_drawer)) { mDrawerLayout.CloseDrawer(RLleft_drawer); } else { mDrawerLayout.OpenDrawer(RLleft_drawer); } }; //base.LoadDrawerView(); }
protected override void OnCreate(Bundle savedInstanceState) { //bitopiApplication = (BitopiApplication)this.ApplicationContext; builder = new Android.App.AlertDialog.Builder(this); builder.SetMessage("Hello, World!"); builder.SetNegativeButton("Cancel", (s, e) => { /* do something on Cancel click */ }); base.OnCreate(savedInstanceState); _MyTaskList = new MyTaskList(this); _approvalType = (ApprovalType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalType"))); _approvalRoleType = (ApprovalRoleType)(Convert.ToInt16(Intent.GetStringExtra("ApprovalRoleType"))); SupportRequestWindowFeature(WindowCompat.FeatureActionBar); SupportActionBar.SetDisplayShowCustomEnabled(true); SupportActionBar.SetCustomView(Resource.Layout.custom_actionbar); rltitle = FindViewById <RelativeLayout>(Resource.Id.rltitle); tvHeaderName = FindViewById <TextView>(Resource.Id.tvHeaderName); SetContentView(Resource.Layout.TNAMyTaskList); lvMyTask = FindViewById <AnimatedExpandableListView>(Resource.Id.lvMyTask); tvMsg = FindViewById <TextView>(Resource.Id.tvMsg); tvMsg.Visibility = ViewStates.Gone; _chkApproveAll = FindViewById <CheckBox>(Resource.Id.chkSelectAll); rlMsg = FindViewById <RelativeLayout>(Resource.Id.rlMsg); rlapprovalDetail = FindViewById <RelativeLayout>(Resource.Id.rlapprovalDetail); switch (bitopiApplication.MyTaskType) { case MyTaskType.UNSEEN: tvMsg.Text = "You don't have any unseen Task"; tvHeaderName.Text = "My Unseen Task"; break; case MyTaskType.SEEN: tvMsg.Text = "You don't have any seen Task"; tvHeaderName.Text = "My Seen Task"; break; case MyTaskType.COMPLETED: tvMsg.Text = "You don't have any completed Task"; tvHeaderName.Text = "My Completed Task"; break; } RLleft_drawer = FindViewById <RelativeLayout>(Resource.Id.RLleft_drawer); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Visibility = ViewStates.Visible; FindViewById <ImageButton>(Resource.Id.btnDrawermenu).Click += (s, e) => { if (mDrawerLayout.IsDrawerOpen(RLleft_drawer)) { mDrawerLayout.CloseDrawer(RLleft_drawer); } else { mDrawerLayout.OpenDrawer(RLleft_drawer); } }; //LoadDrawerView(); }