Exemplo n.º 1
0
        protected void btnCreatePH_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var ctlMember = new MEMBERS_BC();

                string codeId = Singleton <BITCurrentSession> .Inst.SessionMember.CodeId;

                // check xem goi dang ky da het han chua
                if (ctlPack.IsPackageExpire(codeId))
                {
                    // check quota
                    if (ctlPH.GetNumberPH(codeId) < 1)
                    {
                        // tao lenh PH
                        // check transaction pass co dung ko
                        string passPIN = txtTransPass.Text;
                        if (ctlMember.CheckPasswordPIN(codeId, passPIN))
                        {
                            var oPH = GetPH();
                            // Insert PH
                            try
                            {
                                ctlPH.InsertItem(oPH);

                                TNotify.Toastr.Success("Create PH successfull", "Create PH", TNotify.NotifyPositions.toast_top_full_width, true);

                                // reload list PH
                                this.LoadListPH();
                            }
                            catch (Exception ex)
                            {
                                TNotify.Alerts.Danger(ex.ToString(), true);
                            }
                            Response.Redirect("CreatePHCommunity.aspx");
                        }
                        else
                        {
                            // thong bao password pin ko dung
                            TNotify.Alerts.Warning("Password PIN is not valid", true);
                        }
                    }
                    else
                    {
                        // thong bao het quota PH trong ngay
                        TNotify.Alerts.Warning("Only have PH once perday", true);
                    }
                }
                else
                {
                    // thong bao het han hoac chua dang ky goi
                    TNotify.Alerts.Warning("Package is not register or account is expired", true);
                }
            }
        }
Exemplo n.º 2
0
        protected void btnConfirmGH_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var ctlMember = new MEMBERS_BC();

                string codeId = Singleton <BITCurrentSession> .Inst.SessionMember.CodeId;

                string passPIN = txtPasswordPIN.Text;
                if (ctlMember.CheckPasswordPIN(codeId, passPIN))
                {
                    var ctlCommandDetail = new COMMAND_DETAIL_BC();
                    try
                    {
                        var cmdDetail = ctlCommandDetail.SelectItem(Convert.ToInt32(hidID.Value));
                        cmdDetail.ConfirmGH     = true;
                        cmdDetail.DateConfirmGH = DateTime.Now;
                        cmdDetail.Status        = (int)Constants.COMMAND_STATUS.Success;
                        //ctlCommandDetail.ConfirmGH(new COMMAND_DETAIL { ID = Convert.ToInt32(hidID.Value), ConfirmGH = true, DateConfirmGH = DateTime.Now, Status = (int)Constants.COMMAND_STATUS.Success });


                        ctlCommandDetail.GH_CONFIRM(cmdDetail);
                        //TUNGND: GUI MAIL CHO SENDER
                        SendMailToSENDER(cmdDetail);
                        TNotify.Toastr.Success("Confirm GH successfull", "Confirm GH", TNotify.NotifyPositions.toast_top_full_width, true);

                        Response.Redirect("GH_DETAIL.aspx");
                    }
                    catch (System.Threading.ThreadAbortException ex)
                    {
                        // C2: catch exception nay khi redirect
                    }
                    catch (Exception ex)
                    {
                        TNotify.Alerts.Danger(ex.ToString(), true);
                    }
                }
                else
                {
                    // thong bao password pin ko dung
                    TNotify.Alerts.Warning("Password PIN is not valid", true);
                }
            }
        }
Exemplo n.º 3
0
        protected void btnConfirmPH_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                var ctlMember = new MEMBERS_BC();

                string codeId = Singleton <BITCurrentSession> .Inst.SessionMember.CodeId;

                string passPIN = txtPasswordPIN.Text;
                if (ctlMember.CheckPasswordPIN(codeId, passPIN))
                {
                    var            ctlCommandDetail = new COMMAND_DETAIL_BC();
                    COMMAND_DETAIL obj = ctlCommandDetail.SelectItem(COMMAND_DETAIL_ID);
                    try
                    {
                        COMMAND_DETAIL CMD = new COMMAND_DETAIL {
                            ID = COMMAND_DETAIL_ID, TransactionId = txtTransaction.Text, ConfirmPH = true, DateConfirmPH = DateTime.Now, Status = (int)Constants.COMMAND_STATUS.PH_Success, CodeId_From = obj.CodeId_From, CodeId_To = obj.CodeId_To
                        };
                        ctlCommandDetail.ConfirmPH(CMD);

                        TNotify.Toastr.Success("Confirm PH successfull", "Confirm PH", TNotify.NotifyPositions.toast_top_full_width, true);

                        SendMailToRECEIVER(CMD);
                        Response.Redirect("PH_DETAIL.aspx");
                    }
                    catch (System.Threading.ThreadAbortException ex)
                    {
                        // C2: catch exception nay khi redirect
                    }
                    catch (Exception ex)
                    {
                        TNotify.Alerts.Danger(ex.ToString(), true);
                    }
                }
                else
                {
                    // thong bao password pin ko dung
                    TNotify.Alerts.Warning("Password PIN is not valid", true);
                }
            }
        }