예제 #1
0
        // GET: Admin/Distributor/User/Id
        public ActionResult ManagemerchantUsers(string merchantid, string UserId = "")
        {
            var    UserType    = Session["UserType"].ToString();
            string merchant_id = "";

            merchant_id = merchantid.DecryptParameter();
            MerchantUserCommon DMC = new MerchantUserCommon();
            var user_id            = UserId.DecryptParameter();

            if (string.IsNullOrEmpty(merchant_id))
            {
                return(RedirectToAction("Index"));
            }
            if (!string.IsNullOrEmpty(UserId))
            {
                if (string.IsNullOrEmpty(user_id))
                {
                    return(RedirectToAction("ViewMerchantUser", new { merchantid = merchantid.EncryptParameter() }));
                }
                string username = ApplicationUtilities.GetSessionValue("username").ToString();
                DMC        = _merchant.GetUserById(merchant_id, user_id, username);
                DMC.UserId = user_id.EncryptParameter();
            }
            DMC.MerchantId = merchant_id.EncryptParameter();
            MerchantUserModel DMM = DMC.MapObject <MerchantUserModel>();

            //LoadDropDownList(DMM);
            return(View(DMM));
        }
예제 #2
0
        public List <MerchantUserCommon> GetUserList(string merchantid, string username, string UserId = "")
        {
            var    common = new List <MerchantUserCommon>();
            string sql    = "sproc_merchant_detail @flag ='su',@agent_id= " + DAO.FilterString(merchantid) + ",@action_user="******",@user_id=" + DAO.FilterString(UserId);
            var    MUser  = DAO.ExecuteDataTable(sql);

            if (MUser != null)
            {
                foreach (DataRow dr in MUser.Rows)
                {
                    MerchantUserCommon Mcommon = new MerchantUserCommon();
                    Mcommon.MerchantId       = dr["agent_id"].ToString();
                    Mcommon.UserId           = dr["user_id"].ToString();
                    Mcommon.FullName         = dr["full_name"].ToString();
                    Mcommon.UserEmail        = dr["user_email"].ToString();
                    Mcommon.UserMobileNumber = dr["user_mobile_no"].ToString();
                    Mcommon.UserName         = dr["user_name"].ToString();

                    Mcommon.IsPrimary  = dr["is_primary"].ToString();
                    Mcommon.UserStatus = dr["status"].ToString();
                    common.Add(Mcommon);
                }
            }
            return(common);
        }
예제 #3
0
        public ActionResult ManagemerchantUsers(MerchantUserModel DMM)
        {
            MerchantUserCommon DMC = new MerchantUserCommon();

            DMC = DMM.MapObject <MerchantUserCommon>();
            if (!string.IsNullOrEmpty(DMC.UserId))
            {
                ModelState.Remove("Password");
                ModelState.Remove("ConfirmPassword");
                ModelState.Remove("username");
            }
            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(DMC.UserId))
                {
                    DMC.UserId = DMC.UserId.DecryptParameter();
                }
                if (!string.IsNullOrEmpty(DMC.MerchantId))
                {
                    DMC.MerchantId = DMC.MerchantId.DecryptParameter();
                }
                DMC.ActionUser = ApplicationUtilities.GetSessionValue("username").ToString();
                DMC.IpAddress  = ApplicationUtilities.GetIP();
                CommonDbResponse dbresp = _merchant.ManageUser(DMC);
                if (dbresp.Code == shared.Models.ResponseCode.Success)
                {
                    this.ShowPopup(0, "Save Succesfully");
                    return(RedirectToAction("ViewMerchantUser", new { merchantid = DMC.MerchantId.EncryptParameter() }));
                }
                DMC.Msg = dbresp.Message;
            }
            this.ShowPopup(1, "Save unsuccessful!" + DMC.Msg);
            return(View(DMM));
        }
예제 #4
0
        public CommonDbResponse Disable_EnableMerchantUser(MerchantUserCommon DMC)
        {
            string sql = "sproc_merchant_detail ";

            sql += " @flag='edu'";
            sql += ",@agent_id=" + DAO.FilterString(DMC.MerchantId);
            sql += ",@user_id=" + DAO.FilterString(DMC.UserId);
            sql += ",@action_user="******",@user_status=" + DAO.FilterString(DMC.UserStatus);

            return(DAO.ParseCommonDbResponse(sql));
        }
예제 #5
0
        public JsonResult UnBlockUser(string userid, string merchantid)
        {
            var  data  = new CommonDbResponse();
            bool valid = true;

            if (!String.IsNullOrEmpty(userid))
            {
                userid = userid.DecryptParameter();
                if (string.IsNullOrEmpty(userid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }

            if (!String.IsNullOrEmpty(merchantid))
            {
                merchantid = merchantid.DecryptParameter();
                if (string.IsNullOrEmpty(merchantid))
                {
                    data = new CommonDbResponse {
                        ErrorCode = 1, Message = "Invalid User."
                    };
                    valid = false;
                }
            }
            if (valid)
            {
                MerchantUserCommon DMC = new MerchantUserCommon()
                {
                    UserId     = userid,
                    MerchantId = merchantid,
                    UserStatus = "Y",
                    ActionUser = ApplicationUtilities.GetSessionValue("username").ToString(),
                    IpAddress  = ApplicationUtilities.GetIP()
                };
                data = _merchant.Disable_EnableMerchantUser(DMC);
                if (data.ErrorCode == 0)
                {
                    data.Message = "Successfully Blocked User";
                }
            }

            data.SetMessageInTempData(this);
            return(Json(data));
        }
예제 #6
0
        public ActionResult Profile()
        {
            #region FileLocation

            string FileLocation;
            string username   = Session["UserName"].ToString();
            string merchantid = Session["AgentId"].ToString();

            FileLocation = "/Content/userupload/Merchant/kyc/";

            #endregion
            string             UserId     = Session["UserId"].ToString();
            MerchantUserCommon walletUser = _merchant.GetUserById(merchantid, UserId, username);
            walletUser.MerchantId = merchantid.EncryptParameter();
            return(View(walletUser));
        }
예제 #7
0
        public MerchantUserCommon GetUserById(string merchantid, string UserId, string username)
        {
            var    Dis = new MerchantUserCommon();
            string sql = "sproc_merchant_detail @flag ='su', @user_id= " + DAO.FilterString(UserId) + ",@agent_id = " + DAO.FilterString(merchantid) + ",@action_user="******"full_name"].ToString();
                Dis.UserEmail        = dr["user_email"].ToString();
                Dis.UserMobileNumber = dr["user_mobile_no"].ToString();
                Dis.UserName         = dr["user_name"].ToString();
                //Dis.type = dr["usr_type"].ToString();
                Dis.IsPrimary  = dr["is_primary"].ToString();
                Dis.UserStatus = dr["status"].ToString();
                Dis.MerchantQr = dr["agent_qr_image"].ToString();
            }
            return(Dis);
        }
예제 #8
0
        public CommonDbResponse ManageUser(MerchantUserCommon discomm)
        {
            string sql = "sproc_merchant_detail ";

            sql += "@flag ='" + (string.IsNullOrEmpty(discomm.UserId) ? "iu" : "uu") + "' ";
            sql += ",@user_id =" + DAO.FilterString(discomm.UserId);
            sql += ",@agent_id =" + DAO.FilterString(discomm.MerchantId);
            sql += ",@full_name =" + DAO.FilterString(discomm.FullName);
            sql += ",@password  ="******",@action_user ="******",@action_ip =" + DAO.FilterString(discomm.IpAddress);
            sql += " ,@role_id='12'";
            if (string.IsNullOrEmpty(discomm.UserId))
            {
                sql += ",@is_primary ='N'";
                sql += ",@user_status ='Y'";
                sql += ",@usr_type_id ='12'";
                sql += ",@usr_type ='Merchant'";// + dao.FilterString(discomm.UserType);
                sql += ",@user_mobile_number   =" + DAO.FilterString(discomm.UserMobileNumber);
                sql += ",@user_name = " + DAO.FilterString(discomm.UserName);
                sql += ",@user_email  =" + DAO.FilterString(discomm.UserEmail);
            }
            return(DAO.ParseCommonDbResponse(sql));
        }
예제 #9
0
 public CommonDbResponse Disable_EnableMerchantUser(MerchantUserCommon DMC)
 {
     return(_repo.Disable_EnableMerchantUser(DMC));
 }
예제 #10
0
 public CommonDbResponse ManageUser(MerchantUserCommon discomm)
 {
     return(_repo.ManageUser(discomm));
 }