Ejemplo n.º 1
0
        public void InsertQuickURL(QuickSubmitURLModel myQuckURL)
        {
            using (TransactionScope Trans = new TransactionScope())
            {
                try
                {
                    tbl_User u = myQuckURL.MyUser;
                    u.Password = u.ConfirmPassword = "******";
                    u.Role     = "U";
                    userBs.Insert(u);

                    tbl_Url myUrl = myQuckURL.MyUrl;
                    myUrl.UserId     = u.UserId;
                    myUrl.UrlDesc    = myUrl.UrlTitle;
                    myUrl.IsApproved = "P";
                    urlBs.Insert(myUrl);

                    Trans.Complete();
                }
                catch (Exception E1)
                {
                    throw new Exception(E1.Message);
                }
            }
        }
        public ActionResult Create(QuickSubmitURLModel model)
        {
            try
            {
                ModelState.Remove("MyUser.Password");
                ModelState.Remove("MyUser.ConfirmPassword");
                ModelState.Remove("MyUrl.UrlDesc");

                if (ModelState.IsValid)
                {
                    _commonBLogic.InsertQuickURL(model);
                    TempData["Msg"] = "Created Successfully";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.CategoryId = new SelectList(_commonBLogic.Category.GetALL().ToList(), "CategoryId", "CategoryName");
                    return(View("Index"));
                }
            }
            catch (Exception ex)
            {
                TempData["Msg"] = "Create Failed: " + ex.Message;
                return(RedirectToAction("Index"));
            }
        }
        public ActionResult Create(QuickSubmitURLModel MyQuckURL)
        {
            try
            {
                //MyQuckURL.MyUser.ConfirmPassword//

                tbl_User U = MyQuckURL.MyUser;
                ModelState.Remove("MyUser.Password");
                ModelState.Remove("MyUser.ConfirmPassword");
                ModelState.Remove("MyUrl.UrlDesc");

                if (ModelState.IsValid)
                {
                    objBs.InsertQuickURL(MyQuckURL);
                    TempData["Msg"] = "Created Successfully";
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ViewBag.CategoryId = new SelectList(objBs.categoryBs.GetALL().ToList(), "CategoryId", "CategoryName");
                    return(View("Index"));
                }
            }
            catch (Exception e1)
            {
                TempData["Msg"] = "Create Failed :" + e1.Message;
                return(RedirectToAction("Index"));
            }
        }
Ejemplo n.º 4
0
        public void InsertQuickURL(QuickSubmitURLModel model)
        {
            using (var trans = new TransactionScope())
            {
                try
                {
                    var user = model.MyUser;
                    user.Password = user.ConfirmPassword = "******";
                    user.Role     = "U";
                    User.Insert(user);

                    var url = model.MyUrl;
                    url.AppUserId  = user.AppUserId;
                    url.UrlDesc    = url.UrlTitle;
                    url.IsApproved = "P";
                    Url.Insert(url);

                    trans.Complete();
                }
                catch (Exception ex)
                {
                    throw new Exception(ex.Message);
                }
            }
        }