Пример #1
0
        public List <shared.Models.AgentCommon> GetUserList(string AgentId)
        {
            var    Dis   = new List <shared.Models.AgentCommon>();
            string sql   = "sproc_user_detail @flag ='v',@agent_id= " + DAO.FilterString(AgentId);
            var    dUser = DAO.ExecuteDataTable(sql);

            if (dUser != null)
            {
                foreach (DataRow dr in dUser.Rows)
                {
                    shared.Models.AgentCommon Distri = new shared.Models.AgentCommon();
                    Distri.AgentID      = dr["agent_id"].ToString();
                    Distri.UserId       = dr["user_id"].ToString();
                    Distri.UserFullName = dr["full_name"].ToString();
                    Distri.UserEmail    = dr["user_email"].ToString();
                    Distri.UserMobileNo = dr["user_mobile_no"].ToString();
                    Distri.UserName     = dr["user_name"].ToString();
                    //Distri.UserPassword = dr["password"].ToString();
                    Distri.UserType   = dr["usr_type"].ToString();
                    Distri.isPrimary  = dr["is_primary"].ToString();
                    Distri.UserStatus = dr["status"].ToString();
                    Dis.Add(Distri);
                }
            }


            return(Dis);
        }
Пример #2
0
        public List <shared.Models.AgentCommon> GetAgentList(string ParentId = "")
        {
            var    Dis   = new List <shared.Models.AgentCommon>();
            string sql   = "sproc_agent_detail @flag ='s',@action_user= "******"superadmin") + ",@agent_type='Agent',@parent_id=" + DAO.FilterString(ParentId);
            var    dUser = DAO.ExecuteDataTable(sql);

            if (dUser != null)
            {
                foreach (DataRow item in dUser.Rows)
                {
                    shared.Models.AgentCommon Distri = new shared.Models.AgentCommon()
                    {
                        AgentID            = item["agent_id"].ToString(),
                        ParentId           = item["parent_id"].ToString(),
                        AgentName          = item["agent_name"].ToString(),
                        AgentOperationType = item["agent_operation_type"].ToString(),
                        AgentStatus        = item["agent_status"].ToString(),
                        AgentMobileNumber  = item["agent_mobile_no"].ToString(),
                        kycstatus          = item["kyc_status"].ToString(),
                    };

                    Dis.Add(Distri);
                }
            }
            return(Dis);
        }
Пример #3
0
        public ActionResult Manage(string ParentId = "", string AgentId = "", string UserName = "")
        {
            shared.Models.AgentCommon Agentmodel = new shared.Models.AgentCommon();

            Agentmodel.ParentId = ParentId.DecryptParameter();

            Agentmodel.AgentID = AgentId.DecryptParameter();

            if (!string.IsNullOrEmpty(ParentId))
            {
                if (string.IsNullOrEmpty(Agentmodel.ParentId))
                {
                    return(RedirectToAction("Index", "Distributor"));
                }
            }
            if (string.IsNullOrEmpty(AgentId) == false)
            {
                if (string.IsNullOrEmpty(Agentmodel.AgentID))
                {
                    return(RedirectToAction("Index", new { ParentId = Agentmodel.ParentId.EncryptParameter() }));
                }
            }
            // Agentmodel.UserName = UserName;
            if (!String.IsNullOrEmpty(Agentmodel.AgentID))
            {
                Agentmodel = _Agent.GetAgentById(Agentmodel.AgentID, Agentmodel.ParentId, Session["Username"].ToString());
                //Agentmodel.AgentId = Agentmodel.AgentId.EncryptParameter();
                Agentmodel.AgentID = Agentmodel.AgentID.EncryptParameter();
            }
            LoadDropDownList(Agentmodel);
            return(View(Agentmodel));
        }
Пример #4
0
        public shared.Models.AgentCommon GetUserById(string AgentId, string UserId = "")
        {
            var    Dis = new shared.Models.AgentCommon();
            string sql = "sproc_user_detail @flag ='v', @user_id= " + (String.IsNullOrEmpty(UserId) ? "' '" : DAO.FilterString(UserId)) + ",@agent_id = " + DAO.FilterString(AgentId);
            var    dr  = DAO.ExecuteDataRow(sql);

            if (dr != null)
            {
                Dis.UserFullName = dr["full_name"].ToString();
                Dis.UserEmail    = dr["user_email"].ToString();
                Dis.UserMobileNo = dr["user_mobile_no"].ToString();
                Dis.UserName     = dr["user_name"].ToString();
                Dis.UserType     = dr["usr_type"].ToString();
                Dis.isPrimary    = dr["is_primary"].ToString();
                Dis.UserStatus   = dr["status"].ToString();
            }
            return(Dis);
        }
Пример #5
0
        // GET: Admin/Agent/User/Id
        public ActionResult ManageAgentUsers(string AgentId, string UserId = "")
        {
            shared.Models.AgentCommon Agentmodel = new shared.Models.AgentCommon();
            var Agent_id = AgentId.DecryptParameter();
            var user_id  = UserId.DecryptParameter();

            if (string.IsNullOrEmpty(Agent_id))
            {
                return(RedirectToAction("Index"));
            }
            if (!string.IsNullOrEmpty(UserId))
            {
                if (string.IsNullOrEmpty(user_id))
                {
                    return(RedirectToAction("ViewAgentUser", new { AgentId = Agent_id.EncryptParameter() }));
                }
                Agentmodel        = _Agent.GetUserById(Agent_id, user_id);
                Agentmodel.UserId = user_id.EncryptParameter();
            }
            Agentmodel.AgentID = Agent_id.EncryptParameter();
            LoadDropDownList(Agentmodel);
            return(View(Agentmodel));
        }
Пример #6
0
        public shared.Models.AgentCommon GetAgentById(string AgentId, string ParentId = "", string username = "")
        {
            var    Dis = new shared.Models.AgentCommon();
            string sql = "sproc_agent_detail @flag ='s',@action_user= "******",@agent_id = " + DAO.FilterString(AgentId) + ",@agent_type='Agent'";
            var    dt  = DAO.ExecuteDataRow(sql);

            if (dt != null)
            {
                //Agent Information
                Dis.AgentType                    = dt["agent_type"].ToString();
                Dis.AgentID                      = dt["agent_id"].ToString();
                Dis.ParentId                     = dt["parent_id"].ToString();
                Dis.AgentOperationType           = dt["agent_operation_type"].ToString();
                Dis.isautocommission             = string.IsNullOrEmpty(dt["is_auto_commission"].ToString()) ? false : Convert.ToBoolean(dt["is_auto_commission"]);
                Dis.AgentName                    = dt["agent_name"].ToString();
                Dis.AgentMobileNumber            = dt["agent_mobile_no"].ToString();
                Dis.AgentEmail                   = dt["agent_email_address"].ToString();
                Dis.AgentWebUrl                  = dt["web_url"].ToString();
                Dis.AgentRegistrationNumber      = dt["agent_registration_no"].ToString();
                Dis.AgentPanNo                   = dt["agent_pan_no"].ToString();
                Dis.AgentContractDate            = dt["agent_contract_local_date"].ToString(); //remain
                Dis.AgentAddress                 = dt["permanent_address"].ToString();         ///yo k garne
                Dis.AgentLatitude                = dt["latitude"].ToString();
                Dis.AgentLongitude               = dt["longitude"].ToString();
                Dis.AgentCreditLimit             = (float)Convert.ToDouble(dt["agent_credit_limit"]);
                Dis.AgentBalance                 = (float)Convert.ToDouble(dt["available_balance"]);
                Dis.AgentLogo                    = dt["agent_logo_img"].ToString();
                Dis.AgentRegistrationCertificate = dt["agent_document_img_back"].ToString();
                Dis.AgentPanCertificate          = dt["agent_document_img_front"].ToString();

                //   Dis.UserId = dt[""];
                //  Dis.UserName = dt[""];
                //  Dis.Password = dt[""];

                Dis.FirstName                = dt["first_name"].ToString();
                Dis.MiddleName               = dt["middle_name"].ToString();
                Dis.LastName                 = dt["last_name"].ToString();
                Dis.DOB_AD                   = dt["date_of_birth_eng"].ToString();
                Dis.DOB_BS                   = dt["date_of_birth_nep"].ToString();
                Dis.Gender                   = dt["gender"].ToString();
                Dis.Occupation               = dt["occupation"].ToString();
                Dis.Nationality              = dt["agent_nationality"].ToString();
                Dis.PermanentCountry         = dt["agent_country"].ToString();
                Dis.PermanentProvince        = dt["permanent_province"].ToString();
                Dis.PermanentDistrict        = dt["permanent_district"].ToString();
                Dis.PermanentVDC_Muncipality = dt["permanent_localbody"].ToString();
                Dis.PermanentWardNo          = dt["permanent_wardno"].ToString();
                Dis.PermanentStreet          = dt["permanent_address"].ToString();
                // Dis.TemporaryCountry = dt[""];
                Dis.TemporaryProvince           = dt["temporary_province"].ToString();
                Dis.TemporaryDistrict           = dt["temporary_district"].ToString();
                Dis.TemporaryVDC_Muncipality    = dt["temporary_localbody"].ToString();
                Dis.TemporaryWardNo             = dt["temporary_wardno"].ToString();
                Dis.TemporaryStreet             = dt["temporary_address"].ToString();
                Dis.ContactPersonName           = dt["contact_person_name"].ToString();
                Dis.ContactPersonAddress        = dt["contact_person_address"].ToString();
                Dis.ContactPersonNumber         = dt["contact_person_mobile_no"].ToString();
                Dis.ContactPersonIDtype         = dt["contact_person_id_type"].ToString();
                Dis.ContactPersonIDNumber       = dt["contact_person_id_no"].ToString();
                Dis.ContactPersonIDIssueDate    = dt["contact_id_issue_local_date"].ToString();
                Dis.ContactPersonIDIssueDate_BS = dt["contact_id_issued_bs_date"].ToString();
                //Dis.ContactPersonIDExpiryDate = dt[""];
                //Dis.ContactPersonIDExpiryDate_BS = dt[""];
                Dis.ContactPersonIDIssueDistrict = dt["contact_id_issued_district"].ToString();
                //   Dis.ContactPersonIDIssueCountry = dt[""];
                Dis.kycstatus   = dt["kyc_status"].ToString();
                Dis.AgentStatus = dt["agent_status"].ToString();
            }
            return(Dis);
        }