예제 #1
0
        /*******************************************************************************************************************************************************************************
        ****************************************************                               Check Data Function                  ********************************************************
        ****************************************************                                                                    ********************************************************
        *******************************************************************************************************************************************************************************/

        private void _CheckAgent()
        {
            Agents cag = new Agents_Manager().getAgentByIdCard(Agent_idcard_TBx.Text);

            if (cag.Agent_id != null)
            {
                _GetAgent(cag);

                Session["chk_agent"] = cag;

                Alert_Warning_Panel.Visible = false;
                Alert_Success_Panel.Visible = false;
            }
            else
            {
                Session.Remove("chk_agent");

                Alert_Warning_Panel.Visible = true;
                Alert_Success_Panel.Visible = false;
                Alert_Id_Card_Lbl.Text      = "ไม่พบเลขบัตรประชาชน " + Agent_idcard_TBx.Text + " นี้ในระบบข้อมูลนายหน้า";

                Agent_idcard_TBx.Focus();

                _ClearAgent();
            }
        }
예제 #2
0
        /*******************************************************************************************************************************************************************************
        ****************************************************                               Check Data Function                  ********************************************************
        ****************************************************                                                                    ********************************************************
        *******************************************************************************************************************************************************************************/

        private void _CheckAgent()
        {
            Agents cag = new Agents_Manager().getAgentByIdCard(Agent_idcard_TBx.Text);

            Customers ctm = (Customers)Session["Customer_Leasing"];

            if (ctm.Cust_Idcard == Agent_idcard_TBx.Text)
            {
                Session.Remove("chk_agent_leasing");

                Alert_Danger_Panel.Visible   = true;
                alert_header_danger_Lbl.Text = "เลขบัตรประชาชนซ้ำ";
                alert_danger_Lbl.Text        = "เลขบัตรประชาชน " + Agent_idcard_TBx.Text + " ของนายหน้านี้ ไม่สามารถใช้งานได้ เนื่องจากตรงกับผู้ทำสัญญา";

                Agent_Add_Save_Btn.Visible = false;
            }
            else
            {
                Alert_Danger_Panel.Visible = false;
                Agent_Add_Save_Btn.Visible = true;

                if (cag.Agent_id != null)
                {
                    _GetAgent(cag);

                    Session["chk_agent_leasing"] = cag;

                    Alert_Warning_Panel.Visible = false;
                }
                else
                {
                    Session.Remove("chk_agent_leasing");

                    Alert_Danger_Panel.Visible = false;
                    Alert_Id_Card_Lbl.Text     = "ไม่พบเลขบัตรประชาชน " + Agent_idcard_TBx.Text + " นี้ในระบบข้อมูลนายหน้า";

                    Agent_idcard_TBx.Focus();

                    _ClearAgent();
                }
            }
        }