Esempio n. 1
0
 public void DoInsert(tsecrole role, List<tsecrolefunction> lstRoleFunctions, List<tsecrolestep> lstRoleSteps, List<tsecroleeqpgroup> lstRoleEqpGroups)
 {
     try
     {
         dbInstance.BeginTransaction();
         baseDal.DoInsert(role, string.Empty);
         foreach (tsecrolefunction obj in lstRoleFunctions)
         {
             roleFunctionDal.DoInsert(obj, string.Empty);
         }
         foreach (tsecrolestep obj in lstRoleSteps)
         {
             roleStepDal.DoInsert(obj, string.Empty);
         }
         foreach (tsecroleeqpgroup obj in lstRoleEqpGroups)
         {
             roleEqpGroupDal.DoInsert(obj, string.Empty);
         }
         dbInstance.Commit();
     }
     catch (Exception ex)
     {
         dbInstance.Rollback();
         throw ex;
     }
     finally
     {
         dbInstance.CloseConnection();
     }
 }
Esempio n. 2
0
 public void DoInsertRole(ContextInfo contextInfo, tsecrole role, List<tsecrolefunction> lstRoleFunctions, List<tsecrolestep> lstRoleSteps, List<tsecroleeqpgroup> lstRoleEqpGroups)
 {
     contextInfo.Action = MES_ActionType.Insert ;
     RoleBll bll = new RoleBll(contextInfo);
     bll.CallAccessControl();
     bll.DoInsert(role, lstRoleFunctions, lstRoleSteps,lstRoleEqpGroups);
     GC.Collect();
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new tsecrole object.
 /// </summary>
 /// <param name="roleid">Initial value of the roleid property.</param>
 /// <param name="lastmodifiedtime">Initial value of the lastmodifiedtime property.</param>
 /// <param name="lastmodifieduser">Initial value of the lastmodifieduser property.</param>
 public static tsecrole Createtsecrole(global::System.String roleid, global::System.DateTime lastmodifiedtime, global::System.String lastmodifieduser)
 {
     tsecrole tsecrole = new tsecrole();
     tsecrole.roleid = roleid;
     tsecrole.lastmodifiedtime = lastmodifiedtime;
     tsecrole.lastmodifieduser = lastmodifieduser;
     return tsecrole;
 }
Esempio n. 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tsecrole EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotsecrole(tsecrole tsecrole)
 {
     base.AddObject("tsecrole", tsecrole);
 }
Esempio n. 5
0
 public void DoUpdate(tsecrole role, List<tsecrolefunction> lstRoleFunctions, List<tsecrolestep> lstRoleSteps, List<tsecroleeqpgroup> lstRoleEqpGroups)
 {
     try
     {
         dbInstance.BeginTransaction();
         baseDal.DoUpdate(role, string.Empty);
         List<MESParameterInfo> lstParameters = new List<MESParameterInfo>();
         lstParameters.Add(new MESParameterInfo()
         {
             ParamName = "roleid",
             ParamValue = role.roleid,
             ParamType = "string"
         });
         roleFunctionDal.DoDelete<tsecrolefunction>(lstParameters);
         roleStepDal.DoDelete<tsecrolestep>(lstParameters);
         roleEqpGroupDal.DoDelete<tsecroleeqpgroup>(lstParameters);
         foreach (tsecrolefunction obj in lstRoleFunctions)
         {
             roleFunctionDal.DoInsert(obj, string.Empty);
         }
         foreach (tsecrolestep obj in lstRoleSteps)
         {
             roleStepDal.DoInsert(obj, string.Empty);
         }
         foreach (tsecroleeqpgroup obj in lstRoleEqpGroups)
         {
             roleEqpGroupDal.DoInsert(obj, string.Empty);
         }
         dbInstance.Commit();
     }
     catch (Exception ex)
     {
         dbInstance.Rollback();
         throw ex;
     }
     finally
     {
         dbInstance.CloseConnection();
     }
 }
Esempio n. 6
0
 private void UpdateRole(tsecrole role, List<tsecrolefunction> lstRoleFunctions, List<tsecrolestep> lstRoleSteps, List<tsecroleeqpgroup> lstRoleEqpGroups)
 {
     wsSEC.IwsSECClient client = new wsSEC.IwsSECClient();
     try
     {
         client.DoUpdateRole(baseForm.CurrentContextInfo, role, lstRoleFunctions.ToArray<tsecrolefunction>(), lstRoleSteps.ToArray<tsecrolestep>(),lstRoleEqpGroups.ToArray<tsecroleeqpgroup>());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         baseForm.CloseWCF(client);
     }
 }
Esempio n. 7
0
        private void DoSave()
        {
            try
            {
                baseForm.SetCursor();
                baseForm.ValidateData(this);

                tsecrole role = new tsecrole();
                if (UpdateMode == Public_UpdateMode.Update)
                {
                    role = baseForm.OriginalObject as tsecrole;
                }
                baseForm.CreateSingleObject<tsecrole>(role, this, UpdateMode);

                List<tsecrolefunction> lstRoleFunctions = GetRoleFunctions(role.roleid);
                List<tsecrolestep> lstRoleSteps = new List<tsecrolestep>() { };//GetRoleSteps(role.roleid);
                List<tsecroleeqpgroup> lstRoleEqpGroups = new List<tsecroleeqpgroup>() { };// GetRoleEqpGroups(role.roleid);

                if (UpdateMode == Public_UpdateMode.Insert)
                {
                    InsertRole(role, lstRoleFunctions, lstRoleSteps, lstRoleEqpGroups);
                }
                else
                {
                    UpdateRole(role, lstRoleFunctions, lstRoleSteps, lstRoleEqpGroups);
                }

                if (UpdateMode == Public_UpdateMode.Insert)
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00001"));
                else if (UpdateMode == Public_UpdateMode.Update)
                    baseForm.CreateMessageBox(Public_MessageBox.Information, MessageBoxButtons.OK, null, UtilCulture.GetString("Msg.R00002"));

                this.Dispose();
            }
            catch (Exception ex)
            {
                MESMsgBox.ShowError(ExceptionParser.Parse(ex));
            }
            finally
            {
                baseForm.ResetCursor();
            }
        }