public static void SaveRS(ArrayList arOperator, string strUser, string strStation, string strOption) { AccessRange range; if (strUser.Length > 0) { foreach (string text in strUser.Split(new char[] { ',' })) { if (text != "") { range = new AccessRange(); range.AccessRangeType = 0; range.RelationCode = text; range.Operations = strOption; arOperator.Add(range); } } } if (strStation.Length > 0) { foreach (string text2 in strStation.Split(new char[] { ',' })) { if (text2 != "") { range = new AccessRange(); range.AccessRangeType = 1; range.RelationCode = text2; range.Operations = strOption; arOperator.Add(range); } } } }
public static string SetResourceAccessRange(string code, string classCode, string unitCode, ArrayList ar, bool isRefreshRight) { string text3; try { string resourceCode = GetResourceCode(code, classCode); bool flag = resourceCode == ""; EntityData entity = null; if (flag) { resourceCode = SystemManageDAO.GetNewSysCode("ResourceCode"); entity = new EntityData("Standard_Resource"); DataRow newRecord = entity.GetNewRecord(); newRecord["ResourceCode"] = resourceCode; newRecord["ClassCode"] = classCode; newRecord["UnitCode"] = unitCode; newRecord["RelationCode"] = code; entity.AddNewRecord(newRecord); } else { entity = ResourceDAO.GetStandard_ResourceByCode(resourceCode); entity.CurrentRow["unitCode"] = unitCode; } if (isRefreshRight) { entity.DeleteAllTableRow("AccessRange"); } entity.SetCurrentTable("AccessRange"); int count = ar.Count; for (int i = 0; i < count; i++) { AccessRange range = (AccessRange)ar[i]; foreach (string text2 in range.Operations.Split(new char[] { ',' })) { DataRow row = entity.GetNewRecord(); row["AccessRangeCode"] = SystemManageDAO.GetNewSysCode("AccessRangeCode"); row["ResourceCode"] = resourceCode; row["UnitCode"] = unitCode; row["OperationCode"] = text2; row["AccessRangeType"] = range.AccessRangeType; row["RelationCode"] = range.RelationCode; entity.AddNewRecord(row); } } ResourceDAO.SubmitAllStandard_Resource(entity); entity.Dispose(); text3 = resourceCode; } catch (Exception exception) { throw exception; } return(text3); }