Exemplo n.º 1
0
        /// <summary>
        /// Ensures that an object with the specified name exists, while creating other properties are set to their default values
        /// </summary>
        /// <param name="i_sName">Name</param>
        /// <returns>cQuadrant object</returns>
        public static cQuadrant CreateIfRequiredAndGet(string i_sName)
        {
            cQuadrant oObj = cQuadrant.Get_Name(i_sName);

            if (oObj == null)
            {
                oObj       = cQuadrant.Create();
                oObj.sName = i_sName;
                oObj.Save();
            }
            return(oObj);
        }
Exemplo n.º 2
0
        //Added Swpnesh:-

        //public ActionResult AddQuadrants()
        //{
        //    AddQuadrant quadrant = new AddQuadrant();
        //    try
        //    {

        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    return View(quadrant);
        //}

        public JsonResult AddQuadrants(string QuadrantName)
        {
            try
            {
                cQuadrant goal = cQuadrant.Create();
                goal.objEmpLogin.iObjectID = Convert.ToInt32(HttpContext.User.Identity.Name);
                goal.sName     = QuadrantName.ToString();
                goal.bIsActive = true;
                goal.Save();
                return(Json("1"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }