private void BindGrid()
        {
            using (Medappz2_LiveEntities context = new Medappz2_LiveEntities())
            {
                var Sections = (from
                                    //vComt in context.L_SECU_MNU_OP_MAP join
                                    //vSecu in context.L_SECU_SECTION_OPERATION_MAP on vComt.FK_OPERATION_MAP_ID equals
                                    //vSecu.PK_ID join
                                    vMethod in context.L_SECU_ALL_METHODS
                                    join vComparator in context.L_SECU_METHOD_ARG_COMPARATOR  on vMethod.PK_ID equals
                                    vComparator.FK_METHOD_ID join vVal in context.L_SECU_COMPARATOR_VALUE on vComparator.PK_ID equals
                                    vVal.FK_COMPARATOR_ID
                                //join k in l.L_SECU_ALL_METHODS on v.PK_ID equals k.FK_CONFIG_ID
                                where vMethod.PK_ID == this.methodId
                                && vVal.FK_MENU_MAP_ID == this.MenuMapId
                                select new
                                {
                                    vComparator.PARAM_KEY,
                                    vComparator.PARAM_INDEX,
                                    vVal.PARAM_VALUE

                                }).Distinct();
                //lstComparatorValue.DataSource = Sections;
                //lstComparatorValue.DataBind();

            }
        }
Esempio n. 2
0
        protected void btnAddMethod_Click(object sender, EventArgs e)
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {

                var MethodName = txtMethodName.Text.Trim();
                long pkID = -1;
                var className = txtClassName.Text.Trim();
                if (btnAddMethod.Text == "Update Method")
                {

                    var SelectedId= Convert.ToInt64(grdMethods.SelectedDataKey.Value);
                    var ObjMethod = (from vObj in l.L_SECU_ALL_METHODS where vObj.PK_ID == SelectedId select vObj).FirstOrDefault();

                  ///  var ObjMethod = getMethodObj(SelectedId);
                    if(ObjMethod != null)
                    {
                        pkID = ObjMethod.PK_ID;
                        ObjMethod.CLASS_NAME = className;
                        ObjMethod.METHOD_NAME = MethodName;
                    }
                    l.SaveChanges();
                }
                else
                {
                    var ObjMethod = (from vObj in l.L_SECU_ALL_METHODS where vObj.METHOD_NAME == MethodName  select vObj).FirstOrDefault();
                    if (ObjMethod == null)
                    {
                        var objNewMethod = new L_SECU_ALL_METHODS()
                        {
                            //  FK_CONFIG_ID = sectionId,
                            ROW_STATUS = 1,
                            METHOD_NAME = MethodName,
                            CLASS_NAME = className
                        };
                        l.L_SECU_ALL_METHODS.AddObject(objNewMethod);
                        l.SaveChanges();
                        pkID = objNewMethod.PK_ID;
                    }
                    else
                    {
                        lblErrorMessage.Text = "Method already exists";
                    }
                }
                txtMethodName.Text = "";
                txtClassName.Text = "";
                if (pkID > 0)
                {
                    ucMethodArgumentComparator1.SaveComparator(pkID);
                }
            }
            ucMethodArgumentComparator1.resetComparator();
            ucMethodArgumentComparator1.bindComparator(-1);
            BindGrid();
            grdMethods.SelectedIndex = -1;
        }
Esempio n. 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                if (btnSave.Text == "Save")
                {
                    var objName = txtName.Text.Trim();
                    var objType = Convert.ToInt64(hdnType.Value);
                    var objParentId = Convert.ToInt64(hdnParentId.Value);
                    var isExists = (from vConfig in l.L_SECU_CONFIG where vConfig.FK_SCE_CONFIG_TYPE == objType
                                    && vConfig.NAME == objName && vConfig.FK_PK_PARENT_ID == objParentId select vConfig).Count() > 0 ;
                    if (!isExists)
                    {

                        l.L_SECU_CONFIG.AddObject(new L_SECU_CONFIG()
                        {
                            CREATION_DATE = DateTime.Now,
                            DESCRIPTION = txtName.Text,
                            FK_PERMISSION_LEVEL_ID = Convert.ToInt64(ddlPermLevel.SelectedValue),
                            FK_PK_PARENT_ID = objParentId,
                            NAME = objName,
                            REFERANCE = "",
                            FK_SCE_CONFIG_TYPE = objType,
                            ROW_STATUS = 1

                        });
                    }
                    else
                    {
                        lblErrorMsg.Text = "Already exists";
                    }
                }
                else if (btnSave.Text == "Update")
                {
                    var PkID = Convert.ToInt64(GridView1.SelectedDataKey.Value);
                    var obj = (from verSec in l.L_SECU_CONFIG
                               where verSec.PK_ID == PkID
                               select verSec).FirstOrDefault();

                    if (obj != null)
                    {
                        obj.NAME = txtName.Text.Trim();
                        obj.FK_PERMISSION_LEVEL_ID = Convert.ToInt64(ddlPermLevel.SelectedValue);
                    }
                    GridView1.SelectedIndex = -1;
                }
                l.SaveChanges();
                bindGrid();
                txtName.Text = "";
                btnSave.Text = "Save";
            }
        }
Esempio n. 4
0
 private List<L_V_UTILITY_MENU> hasChild(long ParentID)
 {
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var Op = (from v in l.L_V_UTILITY_MENU where v.FK_PARENT_ID == ParentID select v).ToList();
         if (Op.Count == 0)
             return null;
         else
         {
             Op.Insert(0, new L_V_UTILITY_MENU() { PK_MENU_ID = -200, MENU_NAME = "---select----" });
             return Op;
         }
     }
 }
Esempio n. 5
0
 private void BindGrid()
 {
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var selectMenu = Convert.ToInt64(hdnMenuID.Value);
         var Items = (from vMap in l.L_SECU_MNU_OP_MAP
                      join
                      vSec in l.L_SECU_SECTION_OPERATION_MAP
                      on vMap.FK_OPERATION_MAP_ID equals vSec.PK_ID
                      where vMap.REFERANCE == selectMenu
                      select vSec.FK_METHOD_ID).Distinct().ToList();
         DataList1.DataSource = Items;
         DataList1.DataBind();
     }
 }
Esempio n. 6
0
 protected void btnAddMethod_Click(object sender, EventArgs e)
 {
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var sectionId = Convert.ToInt64(this.Section);
         var MethodName = txtMethodName.Text;
         l.L_SECU_ALL_METHODS.AddObject(new L_SECU_ALL_METHODS()
         {
            // FK_CONFIG_ID = sectionId,
             ROW_STATUS = 1,
             METHOD_NAME = MethodName
         });
         l.SaveChanges();
         txtMethodName.Text = "";
         if (methodAdded != null)
         {
             methodAdded(this, new EventArgs());
         }
     }
 }
        protected void btnReset_Click(object sender, EventArgs e)
        {
            Session["TempGrid"] = null;
            if (Session["TempGrid"] == null)
                using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
                {

                    _tempObj = (from v in l.L_SECU_MNU_OP_MAP
                                select new TempeltMap()
                                {
                                    menuID = v.REFERANCE,
                                    OperationMapID = v.FK_OPERATION_MAP_ID,
                                    OperationMode = (int)v.OPERATION_MODE

                                }).ToList();
                    Session["TempGrid"] = _tempObj;

                }
               // ((List<TempeltMap>)Session["TempGrid"]).Clear();
            BindGrid();
        }
 public void bindComparator(long pkId)
 {
     // resetComparator();
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var objComparators = (from v in l.L_SECU_METHOD_ARG_COMPARATOR
                               // join k in l.L_SECU_MNU_OP_MAP on v.FK_MENU_OP_MAP_ID equals k.PK_ID
                               where v.FK_METHOD_ID == pkId  // k.REFERANCE == selecteScreenn && k.OPERATION_MODE == OpMode
                               select v).Distinct();
         foreach (L_SECU_METHOD_ARG_COMPARATOR comPobj in objComparators)
         {
             addComparatorToSession(comPobj.PARAM_KEY, comPobj.PARAM_INDEX, comPobj.TYPE);
         }
         var comparator = getCurrentTempletMap();
         if (comparator != null)
         {
             dtListCopm.DataSource = comparator;
             dtListCopm.DataBind();
         }
     }
 }
Esempio n. 9
0
        public void BindGrid()
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {

                var ObjMethod = (from vObj in l.L_SECU_ALL_METHODS
                              //   join vIn in l.L_SECU_METHOD_ARG_COMPARATOR.DefaultIfEmpty() on vObj.PK_ID equals vIn.FK_METHOD_ID

                                 orderby vObj.METHOD_NAME

                                 select new
                                 {
                                     vObj.PK_ID,
                                     vObj.METHOD_NAME,
                                     vObj.ROW_STATUS,
                                     vObj.CLASS_NAME,
                                     Comparator_Count = (from vIn in l.L_SECU_METHOD_ARG_COMPARATOR where vIn.FK_METHOD_ID == vObj.PK_ID select vIn.PK_ID).Count()
                                 });
                grdMethods.DataSource = ObjMethod;
                grdMethods.DataBind();
            }
        }
Esempio n. 10
0
        public void bindGrid()
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var ConParentID = Convert.ToInt64(hdnParentId.Value);
                var gridSrc = from vcnf in l.L_SECU_CONFIG
                              join vcnTp in l.L_SECU_CONFIG_TYPE
                              on vcnf.FK_SCE_CONFIG_TYPE equals vcnTp.PK_ID
                              join vplvl in l.L_SECU_PERMISSION_LEVEL on
                              vcnf.FK_PERMISSION_LEVEL_ID equals vplvl.PK_ID
                              where vcnf.FK_PK_PARENT_ID == ConParentID
                              select new {
                                  vcnf.PK_ID,
                               Name=vcnf.NAME,
                               ConfigType = vcnTp.NAME,
                               PerMissionLevel=vplvl.NAME
                              };

                GridView1.DataSource = gridSrc;
                GridView1.DataBind();

            }
        }
 public void SaveComparator(long PkID)
 {
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         foreach (Comparator cmprObjs in getCurrentTempletMap())
         {
             var objCount = (from vCpObj in l.L_SECU_METHOD_ARG_COMPARATOR
                             where vCpObj.FK_METHOD_ID == PkID
                                 && vCpObj.PARAM_KEY == cmprObjs.ParamKey && vCpObj.PARAM_INDEX == cmprObjs.ParamIndex
                             select vCpObj).ToArray().Count();
             if (objCount == 0)
             {
                 l.AddToL_SECU_METHOD_ARG_COMPARATOR(new L_SECU_METHOD_ARG_COMPARATOR()
                 {
                     FK_METHOD_ID = PkID,
                     PARAM_INDEX = cmprObjs.ParamIndex,
                     PARAM_KEY = cmprObjs.ParamKey,
                     TYPE = cmprObjs.ParamType
                 });
             }
         }
         l.SaveChanges();
     }
 }
Esempio n. 12
0
        private void addComparatorToSession(long ID, string value)
        {
            var OperationMenuMap = getCurrentTempletMap();

            //if (Session["TempGrid"] != null)
            //{
            //_tempObj = (List<TempeltMap>)Session["TempGrid"];
            //var OpMode = Convert.ToInt64(RadioButtonList2.SelectedValue);
            //var selectedMenu = string.IsNullOrWhiteSpace(hdnMenuID.Value) ? -1 : Convert.ToInt64(hdnMenuID.Value);
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {

                //var OperationMenuMap = (from v in _tempObj where v.menuID == selectedMenu && v.OperationMode == OpMode select v).FirstOrDefault();
                if (OperationMenuMap != null)
                {

                    var isExist = (from vObj in OperationMenuMap.comparator
                                   where vObj.ComparatorID == ID
                                       && vObj.ParamValue == value
                                   select vObj).FirstOrDefault();
                    if (isExist == null)
                    {
                        OperationMenuMap.comparator.Add(new ComparatorValue()
                        {
                            ComparatorID = ID,
                            ParamValue = value

                        });
                    }
                }
            }
        }
Esempio n. 13
0
        protected void Menu_selected(object sender, EventArgs e)
        {
            // hdnLevel.Value = "-100";
            var selectedValu = ((DropDownList)sender);
            //  var select = string.IsNullOrWhiteSpace(selectedValu) ? -1 : Convert.ToInt64(selectedValu);

            if (selectedValu.ID == "ddlMenu")
            {
                hdnMenuID.Value = ddlMenu.SelectedValue;
                ddlMenu_1.Items.Clear();

                PopulateChiled(Convert.ToInt64(ddlMenu.SelectedValue), 2);
            }
            else if (selectedValu.ID == "ddlMenu_1")
            {
                hdnMenuID.Value = ddlMenu_1.SelectedValue;
                ddlMenu_2.Items.Clear();
                PopulateChiled(Convert.ToInt64(ddlMenu_1.SelectedValue), 3);
            }
            else if (selectedValu.ID == "ddlMenu_2")
            {
                hdnMenuID.Value = ddlMenu_2.SelectedValue;
                // PopulateChiled(Convert.ToInt64(ddlMenu_2.SelectedValue), 4);
            }

            //if (select > 0)
            //    PopulateChiled(select);
            if (Session["TempGrid"] == null)
                using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
                {

                    _tempObj = (from v in l.L_SECU_MNU_OP_MAP
                                select new TempeltMap()
                                {
                                    menuID = v.REFERANCE,
                                    OperationMapID = v.FK_OPERATION_MAP_ID,
                                    OperationMode = (int)v.OPERATION_MODE

                                }).ToList();
                    Session["TempGrid"] = _tempObj;

                }
            BindGrid();
            bindComparator();
        }
Esempio n. 14
0
        protected void LinkButton2_Click(object sender, EventArgs e)
        {
            if (Session["TempGrid"] != null)
            {
                _tempObj = (List<TempeltMap>)Session["TempGrid"];
                using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
                {
                    long pk_id;

                    var AddObj = (from vObj in _tempObj
                                  select new L_SECU_MNU_OP_MAP()
                                  {
                                      REFERANCE = vObj.menuID,
                                      FK_OPERATION_MAP_ID = vObj.OperationMapID,
                                      OPERATION_MODE = Convert.ToInt32(vObj.OperationMode)

                                  });
                    foreach (TempeltMap itm in _tempObj)
                    {
                        var IsExist = (from v in l.L_SECU_MNU_OP_MAP
                                       where
                                           v.OPERATION_MODE == itm.OperationMode &&
                                           v.FK_OPERATION_MAP_ID == itm.OperationMapID &&
                                           v.REFERANCE == itm.menuID
                                       select v

                                          ).FirstOrDefault();
                        if (IsExist == null)
                        {
                            L_SECU_MNU_OP_MAP objAddMap = new L_SECU_MNU_OP_MAP()
                            {
                                REFERANCE = itm.menuID,
                                FK_OPERATION_MAP_ID = itm.OperationMapID,
                                OPERATION_MODE = Convert.ToInt32(itm.OperationMode)
                            };
                            l.AddToL_SECU_MNU_OP_MAP(objAddMap);
                            l.SaveChanges();
                            pk_id = objAddMap.PK_ID;
                        }
                        else
                        {
                            pk_id = IsExist.PK_ID;
                        }
                        foreach (ComparatorValue cmprObjs in itm.comparator)//DataListItem dataItem in dtListCopm.Items)
                        {
                            //var hdPkID = Convert.ToInt64(((HiddenField)dataItem.FindControl("hdnComparatorID")).Value);
                            //TextBox txtVal = (TextBox)dataItem.FindControl("txtComparatorValue");
                            var HasItem = (from vCompVal in l.L_SECU_COMPARATOR_VALUE
                                           where
                                               vCompVal.PARAM_VALUE == cmprObjs.ParamValue && vCompVal.FK_COMPARATOR_ID == cmprObjs.ComparatorID
                                               && vCompVal.FK_MENU_MAP_ID == pk_id
                                           select vCompVal).FirstOrDefault();
                            if (HasItem == null&& !string.IsNullOrWhiteSpace(cmprObjs.ParamValue))
                            {
                                l.AddToL_SECU_COMPARATOR_VALUE(new L_SECU_COMPARATOR_VALUE()
                                {
                                    FK_COMPARATOR_ID = cmprObjs.ComparatorID,
                                    FK_MENU_MAP_ID = pk_id,
                                    PARAM_VALUE = cmprObjs.ParamValue
                                });
                            }
                        }
                        //foreach (Comparator cmprObjs in itm.comparator)
                        //{
                        //    l.AddToL_SECU_MENU_MAP_COMPARATOR(new L_SECU_MENU_MAP_COMPARATOR()
                        //    {
                        //        FK_MENU_OP_MAP_ID = pk_id,
                        //        PARAM_INDEX = cmprObjs.ParamIndex,
                        //        PARAM_KEY = cmprObjs.ParamKey,
                        //        PARAM_VALUE = cmprObjs.ParamValue,
                        //        TYPE = cmprObjs.ParamType
                        //    });
                        //}
                    }
                    l.SaveChanges();
                    Session["TempGrid"] = null;
                }
            }
            BindGrid();
        }
        private void addComparatorToSession(string Key, int? index, int type)
        {
            var comparator = getCurrentTempletMap();

            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {

                //var OperationMenuMap = (from v in _tempObj where v.menuID == selectedMenu && v.OperationMode == OpMode select v).FirstOrDefault();
                if (comparator != null)
                {

                    var isExist = (from vObj in comparator
                                   where vObj.ParamKey == Key
                                       && vObj.ParamIndex == index
                                   select vObj).FirstOrDefault();
                    if (isExist == null)
                    {
                        comparator.Add(new Comparator()
                        {
                            ParamIndex = index,
                            ParamKey = Key,
                            ParamType = type

                        });
                    }
                }
            }
            //}
        }
Esempio n. 16
0
        private void BindGrid()
        {
            if (Session["TempGrid"] != null)
            {
                _tempObj = (List<TempeltMap>)Session["TempGrid"];
                var selectedMenu = string.IsNullOrWhiteSpace(hdnMenuID.Value) ? -1 : Convert.ToInt64(hdnMenuID.Value);
                using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
                {
                    var menuName = (from v in _tempObj where v.menuID == selectedMenu select new { v.menuID, v.OperationMode}).Distinct();

                    var vMenu = new List<GridL>();
                    foreach (var menu in menuName)
                    {
                        var Items = (from s in _tempObj
                                     join vk in l.L_SECU_SECTION_OPERATION_MAP
                                     on s.OperationMapID equals vk.PK_ID
                                     join kl in l.L_SECU_CONFIG on vk.FK_SCE_CONFIG_ID equals kl.PK_ID
                                     join ac in l.l_SECU_OPERATION_ACTION on vk.FK_ACTION_ID equals ac.PK_ID

                                     where s.menuID == menu.menuID && s.OperationMode == menu.OperationMode
                                     select
                                         kl.NAME +"("+vk.OPERATION_NAME+")"
                                    ).ToArray();
                        // var CommaSaperatedString =Items.Aggregate((a,b)=> a+","+b);
                        vMenu.Add(new GridL()
                        {
                            MenuName = (from vx in l.L_V_UTILITY_MENU where vx.PK_MENU_ID == menu.menuID select vx.MENU_NAME).FirstOrDefault(),
                            AssignedAction = Items.Aggregate((a, b) => a + ", " + b) ,
                            OperationMode = Enum.GetName(typeof(Mode), menu.OperationMode)

                        });
                    }
                    grvTemplet.DataSource = vMenu;
                    grvTemplet.DataBind();
                }
            }
        }
Esempio n. 17
0
        private void bindSections()
        {
            var selecteScreenn = string.IsNullOrWhiteSpace(ddlScreen.SelectedValue) ? -1 : Convert.ToInt64(ddlScreen.SelectedValue);

            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var Sections = (from v in l.L_SECU_CONFIG
                                //join k in l.L_SECU_ALL_METHODS on v.PK_ID equals k.FK_CONFIG_ID
                                where v.ROW_STATUS == 1 &&
                                     v.FK_SCE_CONFIG_TYPE == 4 &&
                                     (from x in l.L_SECU_SECTION_OPERATION_MAP
                                      where x.FK_SCE_CONFIG_ID != v.PK_ID
                                      // //&& x.OPERATION_NAME == k.METHOD_NAME
                                      select x).Count() > 0 &&
                                    v.FK_PK_PARENT_ID == selecteScreenn
                                select new
                                {
                                    v.PK_ID,
                                    v.NAME
                                }).Distinct();
                ddlSection.DataTextField = "NAME";
                ddlSection.DataValueField = "PK_ID";
                ddlSection.DataSource = Sections;
                ddlSection.DataBind();
            }
        }
        /// <summary>
        /// event handller to save OpAction mapping
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OpMapSave(object sender, EventArgs e)
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var selectedAction = Convert.ToInt64(RadioButtonList1.SelectedValue);
                var selectedSection = Convert.ToInt64(ddlSection.SelectedValue);
                var selectedMethod = Convert.ToInt64(ddlMethods.SelectedValue);

                    if (btnSave.Text == "Update")
                    {
                        var selectPk = Convert.ToInt64(grdOpAcMap.SelectedDataKey.Value);
                        var IsExistMap = (from vMap in l.L_SECU_SECTION_OPERATION_MAP
                                          where vMap.FK_ACTION_ID == selectedAction
                                          && vMap.FK_METHOD_ID == selectedMethod
                                          && vMap.FK_SCE_CONFIG_ID == selectedSection && vMap.PK_ID != selectPk
                                          select vMap).Count() > 0;
                        if (!IsExistMap)
                        {
                            var objSecuMap = (from vMap in l.L_SECU_SECTION_OPERATION_MAP where vMap.PK_ID == selectPk select vMap).FirstOrDefault();
                            objSecuMap.FK_ACTION_ID = selectedAction;
                            objSecuMap.FK_METHOD_ID = selectedMethod;
                            objSecuMap.OPERATION_NAME = ddlMethods.SelectedItem.Text;
                            objSecuMap.FK_SCE_CONFIG_ID = selectedSection;
                        }

                    }
                    else
                    {
                        var IsExistMap = (from vMap in l.L_SECU_SECTION_OPERATION_MAP
                                          where vMap.FK_ACTION_ID == selectedAction
                                          && vMap.FK_METHOD_ID == selectedMethod
                                          && vMap.FK_SCE_CONFIG_ID == selectedSection
                                          select vMap).Count() > 0;
                        if (!IsExistMap)
                        {
                            var objSectionActionMap = new L_SECU_SECTION_OPERATION_MAP()
                            {
                                CREATION_DATE = DateTime.Now,
                                FK_ACTION_ID = selectedAction,
                                ROW_STATUS = 1,
                                OPERATION_NAME = ddlMethods.SelectedItem.Text,
                                FK_METHOD_ID = selectedMethod,
                                FK_SCE_CONFIG_ID = selectedSection

                            };

                            l.L_SECU_SECTION_OPERATION_MAP.AddObject(objSectionActionMap);
                        }
                    }

                l.SaveChanges();

                bindSections();
                bindGrid();
                grdOpAcMap.SelectedIndex = -1;
            }
        }
Esempio n. 19
0
        protected void configSelected(object sender, EventArgs e)
        {
            var PkID = Convert.ToInt64(GridView1.SelectedDataKey.Value);

            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var obj = (from verSec in l.L_SECU_CONFIG
                           where verSec.PK_ID == PkID
                           select verSec).FirstOrDefault();

                txtName.Text = obj.NAME;
                ddlPermLevel.SelectedValue = obj.FK_PERMISSION_LEVEL_ID.ToString();
                btnSave.Text = "Update";
            }
        }
Esempio n. 20
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     var PkID = Convert.ToInt64(e.Keys[0]);
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var obj = (from verSec in l.L_SECU_CONFIG
                    where verSec.PK_ID == PkID
                    select verSec).FirstOrDefault();
         l.L_SECU_CONFIG.DeleteObject(obj);
         l.SaveChanges();
         bindGrid();
         txtName.Text = "";
     }
 }
Esempio n. 21
0
        private L_SECU_ALL_METHODS getMethodObj(long SelectedID)
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {

                var ObjMethod = (from vObj in l.L_SECU_ALL_METHODS where vObj.PK_ID == SelectedID select vObj).FirstOrDefault();
                return ObjMethod;
            }
        }
Esempio n. 22
0
 private void BindActionMap()
 {
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var selectedSection = string.IsNullOrWhiteSpace(ddlSection.SelectedValue) ? -1 : Convert.ToInt64(ddlSection.SelectedValue);
         var Sections = (from v in l.L_SECU_SECTION_OPERATION_MAP
                         join vMap in l.L_SECU_ALL_METHODS on v.FK_METHOD_ID equals vMap.PK_ID
                         join
                             ac in l.l_SECU_OPERATION_ACTION on v.FK_ACTION_ID equals ac.PK_ID
                         where v.FK_SCE_CONFIG_ID == selectedSection
                         select new
                         {
                             v.PK_ID,
                          ACTION_NAME=   ac.ACTION_NAME +"("+ vMap.METHOD_NAME+")"
                         });
         rdbAction.DataTextField = "ACTION_NAME";
         rdbAction.DataValueField = "PK_ID";
         rdbAction.DataSource = Sections;
         rdbAction.DataBind();
     }
 }
Esempio n. 23
0
 private void bindComparator()
 {
     var selecteScreenn = string.IsNullOrWhiteSpace(rdbAction.SelectedValue) ? -1 : Convert.ToInt64(rdbAction.SelectedValue);
     //var OpMode = Convert.ToInt64(RadioButtonList2.SelectedValue);
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var objComparators = (from v in l.L_SECU_METHOD_ARG_COMPARATOR
                                join k in l.L_SECU_ALL_METHODS on v.FK_METHOD_ID equals k.PK_ID
                                join objSecMethod in l.L_SECU_SECTION_OPERATION_MAP on k.METHOD_NAME equals objSecMethod.OPERATION_NAME
                               where objSecMethod.PK_ID == selecteScreenn //&& k.OPERATION_MODE == OpMode
                               select v).Distinct();
         foreach (L_SECU_METHOD_ARG_COMPARATOR comPobj in objComparators)
         {
             addComparatorToSession(comPobj.PK_ID, string.Empty);
         }
         var OperationMenuMap = getCurrentTempletMap();
         //if (OperationMenuMap != null)
         //{
         dtListCopm.DataSource = objComparators;
         dtListCopm.DataBind();
         // }
     }
 }
        private void DeleteMapping(long ID)
        {
            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                try
                {
                    var DependentPermission = from vPer in l.l_SECU_MP_OPERATION_PERMISSION
                                              where vPer.FK_OPERATION_MAP_ID == ID
                                              select vPer;
                    foreach (l_SECU_MP_OPERATION_PERMISSION c in DependentPermission)
                    {
                        l.DeleteObject(c);
                    }
                    var DependendOp = from vOp in l.L_SECU_MNU_OP_MAP where vOp.FK_OPERATION_MAP_ID == ID select vOp;

                    foreach (L_SECU_MNU_OP_MAP c in DependendOp)
                    {
                        l.DeleteObject(c);
                    }

                    l.DeleteObject((from vObj in l.L_SECU_SECTION_OPERATION_MAP where vObj.PK_ID == ID select vObj).FirstOrDefault());
                    l.SaveChanges();
                }
                catch (Exception Eobj)
                {
                    System.Diagnostics.Debug.WriteLine(Eobj.Message);
                }
            }
        }
        /// <summary>
        /// method to bind opAction mapping grid
        /// </summary>
        private void bindGrid()
        {
            var selecteScreenn = string.IsNullOrWhiteSpace(ddlSection.SelectedValue) ? -1 : Convert.ToInt64(ddlSection.SelectedValue);

            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var Operations = from x in l.L_SECU_SECTION_OPERATION_MAP
                                 join y in l.L_SECU_CONFIG on x.FK_SCE_CONFIG_ID equals y.PK_ID
                                  join z in l.l_SECU_OPERATION_ACTION on x.FK_ACTION_ID  equals z.PK_ID
                                  join vMethod in l.L_SECU_ALL_METHODS on x.FK_METHOD_ID equals vMethod.PK_ID
                                 where x.ROW_STATUS == 1 && y.ROW_STATUS == 1 && x.FK_SCE_CONFIG_ID == selecteScreenn
                                 select new {
                                     x.PK_ID,
                                   SectionName = y.NAME,
                                     OperationName = vMethod.METHOD_NAME,
                                   ActionAssociated = z.ACTION_NAME

                                 };
                                 //   where  x.OPERATION_NAME == v.METHOD_NAME
                grdOpAcMap.DataSource = Operations;
                grdOpAcMap.DataBind();
            }
        }
 protected void OpActionMapSelected(object sender, EventArgs e)
 {
     var selectPk = Convert.ToInt64(grdOpAcMap.SelectedDataKey.Value);
     using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
     {
         var objMethodMap = (from vMap in l.L_SECU_SECTION_OPERATION_MAP
                          where vMap.PK_ID == selectPk
                          select
                              new
                              {
                                  vMap.FK_METHOD_ID,
                                  vMap.FK_ACTION_ID
                              }).FirstOrDefault();
         if (objMethodMap != null)
         {
             btnSave.Text = "Update";
             ddlMethods.SelectedValue = objMethodMap.FK_METHOD_ID.ToString();
             RadioButtonList1.SelectedValue = objMethodMap.FK_ACTION_ID.ToString();
         }
     }
 }
Esempio n. 27
0
        private TempeltMap getCurrentTempletMap()
        {
            if (Session["TempGrid"] != null)
            {
                _tempObj = (List<TempeltMap>)Session["TempGrid"];
                var OpMode = Convert.ToInt64(RadioButtonList2.SelectedValue);
                var selectedMenu = string.IsNullOrWhiteSpace(hdnMenuID.Value) ? -1 : Convert.ToInt64(hdnMenuID.Value);
                using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
                {

                    var OperationMenuMap = (from v in _tempObj
                                            where v.menuID == selectedMenu && v.OperationMode == OpMode
                                            select v).FirstOrDefault();
                    return OperationMenuMap;
                }
            }
            else
            {
                return null;
            }
        }
        /// <summary>
        /// Bind Methods to ddl from database
        /// </summary>
        private void bindMethods()
        {
            var selecteScreenn = string.IsNullOrWhiteSpace(ddlSection.SelectedValue) ? -1 : Convert.ToInt64(ddlSection.SelectedValue);

            using (Medappz2_LiveEntities l = new Medappz2_LiveEntities())
            {
                var Sections = (from v in l.L_SECU_ALL_METHODS
                                where v.ROW_STATUS == 1
                                orderby v.METHOD_NAME
                                //&&

                                  //   (from x in l.L_SECU_SECTION_OPERATION_MAP
                                    //  where  x.OPERATION_NAME == v.METHOD_NAME
                                      //select x).Count() < 1
                                      ///&&  v.FK_CONFIG_ID == selecteScreenn
                                select new
                                {
                                   NAME= v.METHOD_NAME,
                                   PK_ID= v.PK_ID
                                }).Distinct();
                ddlMethods.DataTextField = "NAME";
                ddlMethods.DataValueField = "PK_ID";
                ddlMethods.DataSource = Sections;
                ddlMethods.DataBind();
            }
        }