Example #1
0
        public Fltr(int DId, int UId, int HourOffset, DateTime Start, DateTime End, DateRange Range, Grouping YAxis, Grouping SubYAxis, int PriorityID, int ClassID, int ClassLevel, int SubClassLevel, int CreationCategoryID, int LocationID, int LocationTypeID, int SubLocationTypeID, int TechnicianID, int SubmittedByID, int ClosedByID, int AccountID, int AccountLocationId, int accountParentLocationId, int SubmissionCategoryID, int ResolutionCategoryID, int AgeDay, EqualRange AgeRange, int TicketLevelID, int SupportGroupID, TechnicianType technicianType, HandledByCallCenter handledByCallCenter, string asset_filter)
            : this(DId, UId, HourOffset, Start, End, Range, YAxis)
        {
            _subyaxis              = SubYAxis;
            _priority              = PriorityID;
            _class                 = ClassID;
            _classlevel            = ClassLevel;
            _subclasslevel         = SubClassLevel;
            _creationcategory      = CreationCategoryID;
            _submissioncat         = SubmissionCategoryID;
            _resolutioncat         = ResolutionCategoryID;
            _location              = LocationID;
            _locationtype          = LocationTypeID;
            _sublocationtype       = SubLocationTypeID;
            _technician            = TechnicianID;
            _submittedby           = SubmittedByID;
            _closedby              = ClosedByID;
            _account               = AccountID;
            _accountLocation       = AccountLocationId;
            _accountParentLocation = accountParentLocationId;
            _age                     = AgeDay;
            _age_equal               = AgeRange;
            this.technicianType      = technicianType;
            this.handledByCallCenter = handledByCallCenter;
            //tkt #3949: Level Filter added to Ticket Count Report
            _ticket_level = TicketLevelID;
            //tkt #3632: Add Support Groups to Ticket Count Report criteria
            _support_group = SupportGroupID;

            _asset_filter = asset_filter;
        }
 private void AddRandomTreatmentTypes()
 {
     for (var i = 0; i < GetRandom.UInt8(3, 10); i++)
     {
         var d = GetRandom.Object <TechnicianTypeData>();
         var t = new TechnicianType(d);
         _technicianTypes.Add(t).GetAwaiter();
     }
 }
        public void UpdateTechnicianType(TechnicianType obj, string str)
        {
            Database db  = DatabaseFactory.CreateDatabase();
            string   sql =
                string.Format("update technician_type set type_name='{0}',memo='{1}' where technician_type_id={2}",
                              obj.TypeName, obj.Memo, obj.TechnicianTypeID);

            db.ExecuteNonQuery(CommandType.Text, sql);
        }
        public override void TestInitialize()
        {
            base.TestInitialize();
            _technicians     = new TechniciansRepository();
            _technicianTypes = new TechnicianTypesRepository();
            _data            = GetRandom.Object <TechnicianTypeData>();
            var t = new TechnicianType(_data);

            _technicianTypes.Add(t).GetAwaiter();
            AddRandomTreatmentTypes();
            Obj = new TestClass(_technicians, _technicianTypes);
        }
        public void UpdateTechnicianType(TechnicianType obj)
        {
            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_technician_type_U";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_technician_type_id", DbType.Int32, obj.TechnicianTypeID);
            db.AddInParameter(dbCommand, "p_type_name", DbType.String, obj.TypeName);
            db.AddInParameter(dbCommand, "p_memo", DbType.String, obj.Memo);

            db.ExecuteNonQuery(dbCommand);
        }
        public IList <TechnicianType> GetTechnicianTypeByWhereClause(string sql, string str)
        {
            IList <TechnicianType> objList = new List <TechnicianType>();
            Database db     = DatabaseFactory.CreateDatabase();
            string   strSql = string.Format("select * from Technician_Type where {0}", sql);

            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql))
            {
                while (dataReader.Read())
                {
                    TechnicianType obj = CreateModelObject(dataReader);
                    objList.Add(obj);
                }
            }
            return(objList);
        }
        public IList <TechnicianType> GetTechnicianType()
        {
            IList <TechnicianType> objList = dal.GetAllTechnicianType();

            TechnicianType obj = new TechnicianType();

            obj.TechnicianTypeID = 0;
            obj.TypeName         = "--ÇëÑ¡Ôñ--";
            obj.IsDefault        = false;
            obj.Description      = "";
            obj.Memo             = "";

            objList.Insert(0, obj);

            return(objList);
        }
        public IList <TechnicianType> GetAllTechnicianType()
        {
            IList <TechnicianType> objList = new List <TechnicianType>();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_TECHNICIAN_TYPE_G";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    TechnicianType obj = CreateModelObject(dataReader);
                    objList.Add(obj);
                }
            }

            return(objList);
        }
Example #9
0
 public void ResetToDefaults()
 {
     _id                    = 0;
     _name                  = string.Empty;
     _reptype               = ReportType.NotSet;
     _range                 = DateRange.Custom;
     _start                 = DateTime.UtcNow.Date;
     _end                   = DateTime.UtcNow;
     _yaxis                 = Grouping.None;
     _subyaxis              = Grouping.None;
     _age_equal             = EqualRange.Less;
     technicianType         = TechnicianType.All;
     handledByCallCenter    = HandledByCallCenter.All;
     _priority              = 0;
     _class                 = 0;
     _classlevel            = 0;
     _classnull             = false;
     _subclasslevel         = 0;
     _creationcategory      = 0;
     _submissioncat         = 0;
     _resolutioncat         = 0;
     _location              = 0;
     _locationtype          = 0;
     _sublocationtype       = 0;
     _technician            = 0;
     _submittedby           = 0;
     _closedby              = 0;
     _account               = 0;
     _accountLocation       = 0;
     _accountParentLocation = 0;
     _month                 = 0;
     _age                   = -1;
     _ticket_level          = 0;
     _support_group         = 0;
     _asset_filter          = string.Empty;
     _sla_graph_width_id    = 0;
     _sla_graph_view_id     = 0;
     LoadReportDefaults(_did, _uid, true);
     _end   = _end.AddHours(-_houroffset);
     _start = _start.AddMonths(-1).AddHours(-_houroffset);
 }
Example #10
0
        public TechnicianType GetTechnicianTypeByTechnicianTypeID(int technicianTypeID)
        {
            TechnicianType objList = new TechnicianType();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_TECHNICIAN_TYPE_S";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_technician_type_id", DbType.Int32, technicianTypeID);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    objList = CreateModelObject(dataReader);
                }
            }

            return(objList);
        }
Example #11
0
        public IList <TechnicianType> GetTechnicianTypeByWhereClause(string sql)
        {
            IList <TechnicianType> objList = new List <TechnicianType>();

            Database db = DatabaseFactory.CreateDatabase();

            string    sqlCommand = "USP_technician_type_G_Where";
            DbCommand dbCommand  = db.GetStoredProcCommand(sqlCommand);

            db.AddInParameter(dbCommand, "p_sql", DbType.String, sql);

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    TechnicianType obj = CreateModelObject(dataReader);
                    objList.Add(obj);
                }
            }

            return(objList);
        }
Example #12
0
        public Fltr(int DId, int UId, int HourOffset, DateTime Start, DateTime End, DateRange Range, Grouping YAxis, Grouping SubYAxis, int PriorityID, int ClassID, int ClassLevel, int SubClassLevel, int CreationCategoryID, int LocationID, int LocationTypeID, int SubLocationTypeID, int TechnicianID, int SubmittedByID, int ClosedByID, int AccountID, int AccountLocationId, int accountParentLocationId, int SubmissionCategoryID, int ResolutionCategoryID, int AgeDay, EqualRange AgeRange, int TicketLevelID, int SupportGroupID, TechnicianType technicianType, HandledByCallCenter handledByCallCenter, string asset_filter)
            : this(DId, UId, HourOffset, Start, End, Range, YAxis)
        {
            _subyaxis = SubYAxis;
            _priority = PriorityID;
            _class = ClassID;
            _classlevel = ClassLevel;
            _subclasslevel = SubClassLevel;
            _creationcategory = CreationCategoryID;
            _submissioncat = SubmissionCategoryID;
            _resolutioncat = ResolutionCategoryID;
            _location = LocationID;
            _locationtype = LocationTypeID;
            _sublocationtype = SubLocationTypeID;
            _technician = TechnicianID;
            _submittedby = SubmittedByID;
            _closedby = ClosedByID;
            _account = AccountID;
            _accountLocation = AccountLocationId;
            _accountParentLocation = accountParentLocationId;
            _age = AgeDay;
            _age_equal = AgeRange;
            this.technicianType = technicianType;
            this.handledByCallCenter = handledByCallCenter;
            //tkt #3949: Level Filter added to Ticket Count Report
            _ticket_level = TicketLevelID;
            //tkt #3632: Add Support Groups to Ticket Count Report criteria
            _support_group = SupportGroupID;

            _asset_filter = asset_filter;
        }
Example #13
0
        public Fltr(int DId, int UId, int HourOffset)
        {
            _did = DId;
            _uid = UId;

            this.LoadReportDefaults(_did, _uid, false);

            _houroffset = HourOffset;
            _end = _end.AddHours(-_houroffset);
            _start = _start.AddMonths(-1).AddHours(-_houroffset);
            UserSetting _c = UserSetting.GetSettings("RPT");
            if (_c == null) return;

            if (!string.IsNullOrEmpty(_c["FID"])) _id = int.Parse(_c["FID"]);
            if (!string.IsNullOrEmpty(_c["FNAME"])) _name = HttpUtility.UrlDecode(_c["FNAME"]);
            if (!string.IsNullOrEmpty(_c["FTYPE"])) _reptype = (ReportType)Enum.Parse(typeof(ReportType), _c["FTYPE"], true);

            string[] expectedFormats = { "MM/dd/yyyy HH:mm:ss", "MM/dd/yyyyHH:mm:ss", "MM.dd.yyyy HH:mm:ss", "MM.dd.yyyyHH:mm:ss" };
            IFormatProvider culture = new CultureInfo("en-US", false);

            if (!string.IsNullOrEmpty(_c["STDT"]))
            {
                try
                {
                    string _str_start = HttpUtility.UrlDecode(_c["STDT"]);
                    _start = DateTime.ParseExact(_str_start, expectedFormats, culture, DateTimeStyles.None);
                }
                catch { }
            };

            if (!string.IsNullOrEmpty(_c["ENDT"]))
            {
                try
                {
                    string _str_end = HttpUtility.UrlDecode(_c["ENDT"]);
                    _end = DateTime.ParseExact(_str_end, expectedFormats, culture, DateTimeStyles.None);
                }
                catch { }
            };

            if (!string.IsNullOrEmpty(_c["RANGE"])) this.DateRange = ConvertStringToRange(_c["RANGE"]);//(DateRange)Enum.Parse(typeof(DateRange),_c["RANGE"],true);
            if (!string.IsNullOrEmpty(_c["SLAYAX"]))
            {
                if (_c["SLAYAX"].IndexOf(Grouping.AccountLocation.ToString()) >= 0)
                {
                    _yaxis = Grouping.AccountLocation;
                }
                else if (_c["SLAYAX"].IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _yaxis = Grouping.Location;
                    _locationtype = int.Parse(HttpUtility.UrlDecode(_c["SLAYAX"]).Split(',')[1]);
                }
                else if (_c["SLAYAX"].IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _yaxis = Grouping.Class;
                    string[] _arr = HttpUtility.UrlDecode(_c["SLAYAX"]).Split(',');
                    if (_arr.Length > 1) _classlevel = int.Parse(_arr[1]);
                }
                else _yaxis = (Grouping)Enum.Parse(typeof(Grouping), _c["SLAYAX"], true);
            }
            if (!string.IsNullOrEmpty(_c["SLASYAX"]))
            {
                if (_c["SLASYAX"].IndexOf(Grouping.AccountLocation.ToString()) >= 0)
                {
                    _subyaxis = Grouping.AccountLocation;
                }
                else if (_c["SLASYAX"].IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _subyaxis = Grouping.Location;
                    _sublocationtype = int.Parse(HttpUtility.UrlDecode(_c["SLASYAX"]).Split(',')[1]);
                }
                else if (_c["SLASYAX"].IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _subyaxis = Grouping.Class;
                    string[] _arr = HttpUtility.UrlDecode(_c["SLASYAX"]).Split(',');
                    if (_arr.Length > 1) _subclasslevel = int.Parse(_arr[1]);
                }
                else _subyaxis = (Grouping)Enum.Parse(typeof(Grouping), _c["SLASYAX"], true);
            }
            if (!string.IsNullOrEmpty(_c["SLAPRT"])) _priority = int.Parse(_c["SLAPRT"]);
            if (!string.IsNullOrEmpty(_c["SLACLS"])) _class = int.Parse(_c["SLACLS"]);
            if (!string.IsNullOrEmpty(_c["SLACTG"])) _creationcategory = int.Parse(_c["SLACTG"]);
            if (!string.IsNullOrEmpty(_c["SLASTG"])) _submissioncat = int.Parse(_c["SLASTG"]);
            if (!string.IsNullOrEmpty(_c["SLARTG"])) _resolutioncat = int.Parse(_c["SLARTG"]);
            if (!string.IsNullOrEmpty(_c["SLALCT"])) _location = int.Parse(_c["SLALCT"]);
            if (!string.IsNullOrEmpty(_c["SLATCH"])) _technician = int.Parse(_c["SLATCH"]);
            if (!string.IsNullOrEmpty(_c["SLASBY"])) _submittedby = int.Parse(_c["SLASBY"]);
            if (!string.IsNullOrEmpty(_c["SLACBY"])) _closedby = int.Parse(_c["SLACBY"]);
            if (!string.IsNullOrEmpty(_c["SLAACC"])) _account = int.Parse(_c["SLAACC"]);
            if (!string.IsNullOrEmpty(_c["SLAACCL"])) _accountLocation = int.Parse(_c["SLAACCL"]);
            if (!string.IsNullOrEmpty(_c["SLAACCPL"])) _accountParentLocation = int.Parse(_c["SLAACCPL"]);

            if (!string.IsNullOrEmpty(_c["TECHTYPE"])) technicianType = (TechnicianType)Enum.Parse(typeof(TechnicianType), _c["TECHTYPE"], true);
            if (!string.IsNullOrEmpty(_c["CALLCENTER"])) handledByCallCenter = (HandledByCallCenter)Enum.Parse(typeof(HandledByCallCenter), _c["CALLCENTER"], true);

            //tkt #3949: Level Filter added to Ticket Count Report
            if (!string.IsNullOrEmpty(_c["TICKETLEVEL"])) _ticket_level = int.Parse(_c["TICKETLEVEL"]);
            //tkt #3632: Add Support Groups to Ticket Count Report criteria
            if (!string.IsNullOrEmpty(_c["SUPPORTGROUP"])) _support_group = int.Parse(_c["SUPPORTGROUP"]);

            if (!string.IsNullOrEmpty(_c["AGEDAY"])) _age = int.Parse(HttpUtility.UrlDecode(_c["AGEDAY"]));
            if (!string.IsNullOrEmpty(_c["AGERANGE"])) this.AgeRange = (EqualRange)Enum.Parse(typeof(EqualRange), _c["AGERANGE"], true);

            if (!string.IsNullOrEmpty(_c["ASSETFILTER"])) _asset_filter = HttpUtility.UrlDecode(_c["ASSETFILTER"]);

            if (!string.IsNullOrEmpty(_c["SLAGRAPHWIDTH"])) _sla_graph_width_id = int.Parse(_c["SLAGRAPHWIDTH"]);
            if (!string.IsNullOrEmpty(_c["SLAGRAPHVIEW"])) _sla_graph_view_id = int.Parse(_c["SLAGRAPHVIEW"]);
        }
Example #14
0
 public Fltr(int DId, int Id)
 {
     _did = DId;
     _id = Id;
     DataRow _row = SelectFilter(DId, _id);
     _uid = (int)_row["UId"];
     if (_row == null) return;
     _name = _row["Name"].ToString();
     _reptype = (ReportType)(byte)_row["ReportType"];
     string[] _state = _row["FilterState"].ToString().Split('&');
     System.Collections.Specialized.StringDictionary _sd = new System.Collections.Specialized.StringDictionary();
     for (int i = 0; i < _state.Length; i++)
     {
         if (_state[i].Length == 0) continue;
         string[] _item = _state[i].Split('=');
         if (_item.Length > 1) _sd.Add(_item[0], _item[1]);
         else _sd.Add(_item[0], string.Empty);
     }
     string[] expectedFormats = { "MM/dd/yyyy HH:mm:ss", "MM/dd/yyyyHH:mm:ss", "MM.dd.yyyy HH:mm:ss", "MM.dd.yyyyHH:mm:ss" };
     IFormatProvider culture = new CultureInfo("en-US", false);
     if (_sd.ContainsKey("ds") && _sd["ds"].Length > 0) _start = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["ds"]), expectedFormats, culture, DateTimeStyles.None);
     if (_sd.ContainsKey("de") && _sd["de"].Length > 0) _end = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["de"]), expectedFormats, culture, DateTimeStyles.None);
     if (_sd.ContainsKey("dr") && _sd["dr"].Length > 0) this.DateRange = ConvertStringToRange(HttpUtility.UrlDecode(_sd["dr"]));
     if (_sd.ContainsKey("ya") && _sd["ya"].Length > 0)
     {
         string _val = HttpUtility.UrlDecode(_sd["ya"]);
         if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
         {
             _yaxis = Grouping.Location;
             _locationtype = int.Parse(_val.Split(',')[1]);
         }
         else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
         {
             _yaxis = Grouping.Class;
             string[] _arr = _val.Split(',');
             if (_arr.Length > 1) _classlevel = int.Parse(_arr[1]);
         }
         else _yaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
     }
     if (_sd.ContainsKey("sya") && _sd["sya"].Length > 0)
     {
         string _val = HttpUtility.UrlDecode(_sd["sya"]);
         if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
         {
             _subyaxis = Grouping.Location;
             _sublocationtype = int.Parse(_val.Split(',')[1]);
         }
         else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
         {
             _subyaxis = Grouping.Class;
             string[] _arr = _val.Split(',');
             if (_arr.Length > 1) _subclasslevel = int.Parse(_arr[1]);
         }
         else _subyaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
     }
     if (_sd.ContainsKey("prt") && _sd["prt"].Length > 0) _priority = int.Parse(_sd["prt"]);
     if (_sd.ContainsKey("cls") && _sd["cls"].Length > 0) _class = int.Parse(_sd["cls"]);
     if (_sd.ContainsKey("ctg") && _sd["ctg"].Length > 0) _creationcategory = int.Parse(_sd["ctg"]);
     if (_sd.ContainsKey("stg") && _sd["stg"].Length > 0) _submissioncat = int.Parse(_sd["stg"]);
     if (_sd.ContainsKey("rtg") && _sd["rtg"].Length > 0) _resolutioncat = int.Parse(_sd["rtg"]);
     if (_sd.ContainsKey("lct") && _sd["lct"].Length > 0) _location = int.Parse(_sd["lct"]);
     if (_sd.ContainsKey("tch") && _sd["tch"].Length > 0) _technician = int.Parse(_sd["tch"]);
     if (_sd.ContainsKey("sby") && _sd["sby"].Length > 0) _submittedby = int.Parse(_sd["sby"]);
     if (_sd.ContainsKey("cby") && _sd["cby"].Length > 0) _closedby = int.Parse(_sd["cby"]);
     if (_sd.ContainsKey("acc") && _sd["acc"].Length > 0) _account = int.Parse(_sd["acc"]);
     if (_sd.ContainsKey("accl") && _sd["accl"].Length > 0) _accountLocation = int.Parse(_sd["accl"]);
     if (_sd.ContainsKey("accpl") && _sd["accpl"].Length > 0) _accountParentLocation = int.Parse(_sd["accpl"]);
     if (_sd.ContainsKey("tcht") && _sd["tcht"].Length > 0) technicianType = (TechnicianType)Enum.Parse(typeof(TechnicianType), HttpUtility.UrlDecode(_sd["tcht"]), true);
     if (_sd.ContainsKey("hcc") && _sd["hcc"].Length > 0) handledByCallCenter = (HandledByCallCenter)Enum.Parse(typeof(HandledByCallCenter), HttpUtility.UrlDecode(_sd["hcc"]), true);
     if (_sd.ContainsKey("lvl") && _sd["lvl"].Length > 0) _ticket_level = int.Parse(_sd["lvl"]);
     if (_sd.ContainsKey("sg") && _sd["sg"].Length > 0) _support_group = int.Parse(_sd["sg"]);
     if (_sd.ContainsKey("age") && _sd["age"].Length > 0) _age = int.Parse(_sd["age"]);
     if (_sd.ContainsKey("ager") && _sd["ager"].Length > 0) _age_equal = (EqualRange)Enum.Parse(typeof(EqualRange), HttpUtility.UrlDecode(_sd["ager"]), true);
     if (_sd.ContainsKey("ass") && _sd["ass"].Length > 0) _asset_filter = HttpUtility.UrlDecode(_sd["ass"]);
     if (_sd.ContainsKey("slaw") && _sd["slaw"].Length > 0) _sla_graph_width_id = int.Parse(_sd["slaw"]);
     if (_sd.ContainsKey("slag") && _sd["slag"].Length > 0) _sla_graph_view_id = int.Parse(_sd["slag"]);
 }
Example #15
0
 public void UpdateTechnicianType(TechnicianType obj, string str)
 {
     dal.UpdateTechnicianType(obj, str);
 }
Example #16
0
 public void UpdateTechnicianType(TechnicianType obj)
 {
     dal.UpdateTechnicianType(obj);
 }
        /// <summary>
        /// 填充页面
        /// </summary>
        protected void FillPage()
        {
            string value = Request.QueryString["TypeValue"];
            string id    = Request.QueryString["ID"];

            trType.Visible = false;
            trMemo.Visible = true;

            //修改 需要填充
            if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(id))
            {
                if (value == "education_level")
                {
                    EducationLevelBLL objBLL            = new EducationLevelBLL();
                    EducationLevel    objEducationLevel = objBLL.GetEducationLevelByEducationLevelID(Convert.ToInt32(id));
                    txtItemName.Text = objEducationLevel.EducationLevelName;
                    txtMemo.Text     = objEducationLevel.Memo;
                }
                if (value == "political_status")
                {
                    PoliticalStatusBLL objBLL             = new PoliticalStatusBLL();
                    PoliticalStatus    objPoliticalStatus = objBLL.GetPoliticalStatusByPoliticalStatusID(Convert.ToInt32(id));
                    txtItemName.Text = objPoliticalStatus.PoliticalStatusName;
                    txtMemo.Text     = objPoliticalStatus.Memo;
                }
                if (value == "workgroupleader_level")
                {
                    WorkGroupLeaderLevelBLL objBLL = new WorkGroupLeaderLevelBLL();
                    WorkGroupLeaderLevel    objWorkGroupLeaderLevel =
                        objBLL.GetWorkGroupLeaderLevelByWorkGroupLeaderLevelID(Convert.ToInt32(id));
                    txtItemName.Text = objWorkGroupLeaderLevel.LevelName;
                    txtMemo.Text     = objWorkGroupLeaderLevel.Memo;
                }
                if (value == "technician_type")
                {
                    TechnicianTypeBLL objBLL            = new TechnicianTypeBLL();
                    TechnicianType    objTechnicianType = objBLL.GetTechnicianTypeByTechnicianTypeID(Convert.ToInt32(id));
                    txtItemName.Text = objTechnicianType.TypeName;
                    txtMemo.Text     = objTechnicianType.Memo;
                }
                if (value == "technician_title_type")
                {
                    trType.Visible = true;
                    trMemo.Visible = false;
                    TechnicianTitleTypeBLL objBLL = new TechnicianTitleTypeBLL();
                    TechnicianTitleType    objTechnicianTitleType = objBLL.GetTechnicianTitleTypeByTechnicianTitleTypeID(Convert.ToInt32(id));
                    txtItemName.Text      = objTechnicianTitleType.TypeName;
                    ddlType.SelectedValue = objTechnicianTitleType.TypeLevel.ToString();
                    txtMemo.ReadOnly      = true;
                }
                if (value == "education_employee_type")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    EducationEmployeeTypeBLL objBLL = new EducationEmployeeTypeBLL();
                    EducationEmployeeType    obj    = objBLL.GetEducationEmployeeTypeByEducationEmployeeTypeID(Convert.ToInt32(id));
                    txtItemName.Text = obj.TypeName;
                    txtMemo.ReadOnly = true;
                }
                if (value == "committee_head_ship")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    CommitteeHeadShipBLL objBLL = new CommitteeHeadShipBLL();
                    CommitteeHeadShip    obj    = objBLL.GetCommitteeHeadShipByCommitteeHeadShipID(Convert.ToInt32(id));
                    txtItemName.Text = obj.CommitteeHeadShipName;
                    txtMemo.ReadOnly = true;
                }
                if (value == "random_exam_modular_type")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    RandomExamModularTypeBLL objBLL = new RandomExamModularTypeBLL();
                    RandomExamModularType    obj    = objBLL.GetRandomExamModularTypeByTypeID(Convert.ToInt32(id));
                    txtItemName.Text = obj.RandomExamModularTypeName;
                    txtMemo.ReadOnly = true;
                }
                if (value == "trainplan_type")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    OracleAccess oracle = new OracleAccess();
                    DataTable    dt     =
                        oracle.RunSqlDataSet(string.Format(
                                                 "select * from zj_trainplan_type where trainplan_type_id={0}", Convert.ToInt32(id))).Tables[
                            0];
                    txtItemName.Text = dt.Rows[0]["trainplan_type_name"].ToString();
                }

                if (value == "safe_level")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    OracleAccess access = new OracleAccess();
                    DataTable    dt     = access.RunSqlDataSet("select * from zj_safe_level where  safe_level_id =" + id).Tables[0];
                    txtItemName.Text = dt.Rows[0]["safe_level_name"].ToString();
                }
                if (value == "certificate")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    OracleAccess access = new OracleAccess();
                    DataTable    dt     = access.RunSqlDataSet("select * from zj_certificate where  certificate_id =" + id).Tables[0];
                    txtItemName.Text = dt.Rows[0]["certificate_name"].ToString();
                }
                if (value == "certificate_level")
                {
                    trType.Visible = true;
                    trMemo.Visible = false;
                    OracleAccess access = new OracleAccess();
                    DataTable    dt     = access.RunSqlDataSet("select * from zj_certificate_level where  certificate_level_id =" + id).Tables[0];
                    txtItemName.Text       = dt.Rows[0]["certificate_level_name"].ToString();
                    ddlType.DataSource     = access.RunSqlDataSet("select * from zj_certificate order by order_index").Tables[0];
                    ddlType.DataTextField  = "certificate_name";
                    ddlType.DataValueField = "certificate_id";
                    ddlType.DataBind();
                    ddlType.SelectedValue = dt.Rows[0]["certificate_id"].ToString();
                }
                if (value == "certificate_unit")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    OracleAccess access = new OracleAccess();
                    DataTable    dt     = access.RunSqlDataSet("select * from zj_certificate_unit where  certificate_unit_id =" + id).Tables[0];
                    txtItemName.Text = dt.Rows[0]["certificate_unit_name"].ToString();
                }
                if (value == "train_unit")
                {
                    trType.Visible = false;
                    trMemo.Visible = false;
                    OracleAccess access = new OracleAccess();
                    DataTable    dt     = access.RunSqlDataSet("select * from zj_train_unit where  train_unit_id =" + id).Tables[0];
                    txtItemName.Text = dt.Rows[0]["train_unit_name"].ToString();
                }
            }
            else
            {
                if (value == "technician_title_type")
                {
                    trType.Visible = true;
                    trMemo.Visible = false;
                }
                if (value == "education_employee_type")
                {
                    trMemo.Visible = false;
                }
                if (value == "committee_head_ship")
                {
                    trMemo.Visible = false;
                }
                if (value == "random_exam_modular_type")
                {
                    trMemo.Visible = false;
                }
                if (value == "trainplan_type")
                {
                    trMemo.Visible = false;
                }
                if (value == "safe_level")
                {
                    trMemo.Visible = false;
                }
                if (value == "certificate")
                {
                    trMemo.Visible = false;
                }
                if (value == "certificate_level")
                {
                    trMemo.Visible = false;
                    trType.Visible = true;
                    OracleAccess access = new OracleAccess();
                    ddlType.DataSource     = access.RunSqlDataSet("select * from zj_certificate order by order_index").Tables[0];
                    ddlType.DataTextField  = "certificate_name";
                    ddlType.DataValueField = "certificate_id";
                    ddlType.DataBind();
                }
                if (value == "certificate_unit")
                {
                    trMemo.Visible = false;
                }
                if (value == "train_unit")
                {
                    trMemo.Visible = false;
                }
            }
        }
        /// <summary>
        /// 保存数据项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void InsertButton_Click(object sender, EventArgs e)
        {
            string value = Request.QueryString["TypeValue"];
            string id    = Request.QueryString["ID"];
            string mode  = Request.QueryString["Mode"];

            if (value == "education_level" && mode == "Update")
            {
                EducationLevelBLL objBLL = new EducationLevelBLL();
                EducationLevel    obj    = objBLL.GetEducationLevelByEducationLevelID(Convert.ToInt32(id));
                obj.EducationLevelID = Convert.ToInt32(id);
                string educationName = obj.EducationLevelName;

                if (objBLL.GetEducationLevelByWhereClause("Education_Level_ID !=" + id + " and Education_Level_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该文化程度,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                obj.EducationLevelName = txtItemName.Text;
                obj.Memo = txtMemo.Text;
                objBLL.UpdateEducationLevel(obj);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改文化程度:(" + educationName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "political_status" && mode == "Update")
            {
                PoliticalStatusBLL objBLL = new PoliticalStatusBLL();
                PoliticalStatus    obj    = objBLL.GetPoliticalStatusByPoliticalStatusID(Convert.ToInt32(id));
                obj.PoliticalStatusID = Convert.ToInt32(id);
                string politicalStatusName = obj.PoliticalStatusName;

                if (objBLL.GetPoliticalStatusByWhereClause("Political_Status_ID !=" + id + " and Political_Status_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该政治面貌,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                obj.PoliticalStatusName = txtItemName.Text;
                obj.Memo = txtMemo.Text;
                objBLL.UpdatePoliticalStatus(obj);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改政治面貌:(" + politicalStatusName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "workgroupleader_level" && mode == "Update")
            {
                WorkGroupLeaderLevelBLL objBLL = new WorkGroupLeaderLevelBLL();
                WorkGroupLeaderLevel    obj    = objBLL.GetWorkGroupLeaderLevelByWorkGroupLeaderLevelID(Convert.ToInt32(id));
                obj.WorkGroupLeaderLevelID = Convert.ToInt32(id);
                string levelName = obj.LevelName;

                if (objBLL.GetWorkGroupLeaderLevelByWhereClause("WorkGroupLeader_Level_ID !=" + id + " and Level_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该班组长类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                obj.LevelName = txtItemName.Text;
                obj.Memo      = txtMemo.Text;
                objBLL.UpdateWorkGroupLeaderLevel(obj);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改班组长类别:(" + levelName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "technician_type" && mode == "Update")
            {
                TechnicianTypeBLL objBLL = new TechnicianTypeBLL();
                TechnicianType    obj    = objBLL.GetTechnicianTypeByTechnicianTypeID(Convert.ToInt32(id));
                obj.TechnicianTypeID = Convert.ToInt32(id);
                string typeName = obj.TypeName;

                if (objBLL.GetTechnicianTypeByWhereClause("Technician_Type_ID !=" + id + " and Type_Name='" + txtItemName.Text + "'", "").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该工人技能等级,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                obj.TypeName = txtItemName.Text;
                obj.Memo     = txtMemo.Text;
                objBLL.UpdateTechnicianType(obj, "");
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改工人技能等级:(" + typeName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "technician_title_type" && mode == "Update")
            {
                TechnicianTitleTypeBLL objBLL = new TechnicianTitleTypeBLL();
                TechnicianTitleType    obj    = objBLL.GetTechnicianTitleTypeByTechnicianTitleTypeID(Convert.ToInt32(id));
                obj.TechnicianTitleTypeID = Convert.ToInt32(id);
                string typeTitleName = obj.TypeName;

                if (objBLL.GetTechnicianTitleTypeByWhereClause("Technician_Title_Type_ID !=" + id + " and Type_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该干部技术职称,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                obj.TypeName  = txtItemName.Text;
                obj.TypeLevel = Convert.ToInt32(ddlType.SelectedValue);
                objBLL.UpdateTechnicianTitleType(obj);
                txtMemo.ReadOnly = true;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改干部技术职称:(" + typeTitleName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }

            if (value == "education_employee_type" && mode == "Update")
            {
                EducationEmployeeTypeBLL objBLL = new EducationEmployeeTypeBLL();
                EducationEmployeeType    obj    = objBLL.GetEducationEmployeeTypeByEducationEmployeeTypeID(Convert.ToInt32(id));
                obj.EducationEmployeeTypeID = Convert.ToInt32(id);
                string typeTitleName = obj.TypeName;

                if (objBLL.GetAllEducationEmployeeTypeByWhereClause("Education_Employee_Type_ID !=" + id + " and Education_Employee_Type_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该职教人员类型,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                obj.TypeName = txtItemName.Text;
                objBLL.UpdateEducationEmployeeType(obj);
                txtMemo.ReadOnly = true;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改该职教人员类型:(" + typeTitleName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "committee_head_ship" && mode == "Update")
            {
                CommitteeHeadShipBLL objBLL = new CommitteeHeadShipBLL();
                CommitteeHeadShip    obj    = objBLL.GetCommitteeHeadShipByCommitteeHeadShipID(Convert.ToInt32(id));
                obj.CommitteeHeadShipID = Convert.ToInt32(id);
                string ShipName = obj.CommitteeHeadShipName;

                if (objBLL.GetAllCommitteeHeadShipByWhereClause("committee_head_ship_id !=" + id + " and committee_head_ship_name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该职教委员会职务,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                obj.CommitteeHeadShipName = txtItemName.Text;
                objBLL.UpdateCommitteeHeadShip(obj);
                txtMemo.ReadOnly = true;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改职教委员会职务:(" + ShipName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "random_exam_modular_type" && mode == "Update")
            {
                RandomExamModularTypeBLL objBLL = new RandomExamModularTypeBLL();
                RandomExamModularType    obj    = objBLL.GetRandomExamModularTypeByTypeID(Convert.ToInt32(id));
                obj.RandomExamModularTypeID = Convert.ToInt32(id);
                string TpyeName = obj.RandomExamModularTypeName;

                if (objBLL.GetAllRandomExamModularTypeByWhereClause("random_exam_modular_type_id !=" + id + " and random_exam_modular_type_name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该模块考试类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                obj.RandomExamModularTypeName = txtItemName.Text;
                objBLL.UpdateRandomExamModularType(obj);
                txtMemo.ReadOnly = true;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改模块考试类别:(" + TpyeName + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "trainplan_type" && mode == "Update")
            {
                OracleAccess oracle = new OracleAccess();
                DataTable    dt     =
                    oracle.RunSqlDataSet(
                        string.Format(
                            "select * from zj_trainplan_type where trainplan_type_id!={0} and trainplan_type_name='{1}'",
                            Convert.ToInt32(id), txtItemName.Text)).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该培训类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                DataTable dt1 =
                    oracle.RunSqlDataSet(
                        string.Format(
                            "select * from zj_trainplan_type where trainplan_type_id={0}",
                            Convert.ToInt32(id))).Tables[0];
                oracle.ExecuteNonQuery(
                    string.Format("update zj_trainplan_type set trainplan_type_name='{0}' where trainplan_type_id={1}",
                                  txtItemName.Text, (Convert.ToInt32(id))));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改模块考试类别:(" + dt1.Rows[0]["trainplan_type_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }

            if (value == "safe_level" && mode == "Update")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_safe_level where safe_level_id!={0} and safe_level_name='{1}'",
                                  Convert.ToInt32(id), txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该安全等级,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                DataTable dt1 = access.RunSqlDataSet("select * from zj_safe_level where  safe_level_id =" + id).Tables[0];
                access.ExecuteNonQuery(
                    string.Format("update zj_safe_level set safe_level_name='{0}' where safe_level_id={1}", txtItemName.Text.Trim(),
                                  Convert.ToInt32(id)));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改安全等级:(" + dt1.Rows[0]["safe_level_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }

            if (value == "certificate" && mode == "Update")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_certificate where certificate_id!={0} and certificate_name='{1}'",
                                  Convert.ToInt32(id), txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该证书,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                DataTable dt1 = access.RunSqlDataSet("select * from zj_certificate where  certificate_id =" + id).Tables[0];
                access.ExecuteNonQuery(
                    string.Format("update zj_certificate set certificate_name='{0}' where certificate_id={1}", txtItemName.Text.Trim(),
                                  Convert.ToInt32(id)));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改证书:(" + dt1.Rows[0]["certificate_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }

            if (value == "certificate_level" && mode == "Update")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt1    = access.RunSqlDataSet("select * from zj_certificate_level where  certificate_level_id =" + id).Tables[0];
                access.ExecuteNonQuery(
                    string.Format("update zj_certificate_level set certificate_level_name='{0}',certificate_id={2} where certificate_level_id={1}", txtItemName.Text.Trim(),
                                  Convert.ToInt32(id), ddlType.SelectedValue));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改证书等级:(" + dt1.Rows[0]["certificate_level_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "certificate_unit" && mode == "Update")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_certificate_unit where certificate_unit_id!={0} and certificate_unit_name='{1}'",
                                  Convert.ToInt32(id), txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该发证单位,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                DataTable dt1 = access.RunSqlDataSet("select * from zj_certificate_unit where  certificate_unit_id =" + id).Tables[0];
                access.ExecuteNonQuery(
                    string.Format("update zj_certificate_unit set certificate_unit_name='{0}' where certificate_unit_id={1}", txtItemName.Text.Trim(),
                                  Convert.ToInt32(id)));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改发证单位:(" + dt1.Rows[0]["certificate_unit_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "train_unit" && mode == "Update")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_train_unit where train_unit_id!={0} and train_unit_name='{1}'",
                                  Convert.ToInt32(id), txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该培训单位,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                DataTable dt1 = access.RunSqlDataSet("select * from zj_train_unit where  train_unit_id =" + id).Tables[0];
                access.ExecuteNonQuery(
                    string.Format("update zj_train_unit set train_unit_name='{0}' where train_unit_id={1}", txtItemName.Text.Trim(),
                                  Convert.ToInt32(id)));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("修改培训单位:(" + dt1.Rows[0]["train_unit_name"] + ")为(" + txtItemName.Text + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }



            if (value == "education_level" && mode == "Insert")
            {
                EducationLevelBLL objBLL = new EducationLevelBLL();
                if (objBLL.GetEducationLevelByWhereClause("Education_Level_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该文化程度,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                objBLL.InsertEducationLevel(txtItemName.Text, txtMemo.Text);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增文化程度:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "political_status" && mode == "Insert")
            {
                PoliticalStatusBLL objBLL = new PoliticalStatusBLL();
                if (objBLL.GetPoliticalStatusByWhereClause("Political_Status_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该政治面貌,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                objBLL.InsertPoliticalStatus(txtItemName.Text, txtMemo.Text);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增政治面貌:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "workgroupleader_level" && mode == "Insert")
            {
                WorkGroupLeaderLevelBLL objBLL = new WorkGroupLeaderLevelBLL();
                if (objBLL.GetWorkGroupLeaderLevelByWhereClause("Level_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该班组长类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                objBLL.InsertWorkGroupLeaderLevel(txtItemName.Text, txtMemo.Text);
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增班组长类别:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "technician_type" && mode == "Insert")
            {
                TechnicianTypeBLL objBLL = new TechnicianTypeBLL();
                if (objBLL.GetTechnicianTypeByWhereClause("Type_Name='" + txtItemName.Text + "'", "").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该工人技能等级,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                objBLL.InsertTechnicianType(txtItemName.Text, txtMemo.Text, "");
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增工人技能等级:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "technician_title_type" && mode == "Insert")
            {
                TechnicianTitleTypeBLL objBLL = new TechnicianTitleTypeBLL();
                if (objBLL.GetTechnicianTitleTypeByWhereClause("Type_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该干部技术职称,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                TechnicianTitleType obj = new TechnicianTitleType();
                obj.TypeName  = txtItemName.Text;
                obj.TypeLevel = Convert.ToInt32(ddlType.SelectedValue);
                objBLL.InsertTechnicianTitleType(obj);
                txtMemo.ReadOnly = true;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增干部技术职称:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "education_employee_type" && mode == "Insert")
            {
                EducationEmployeeTypeBLL objBLL = new EducationEmployeeTypeBLL();
                if (objBLL.GetAllEducationEmployeeTypeByWhereClause("Education_Employee_Type_Name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该干部技术职称,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                EducationEmployeeType obj = new EducationEmployeeType();
                obj.TypeName = txtItemName.Text;
                objBLL.InsertEducationEmployeeType(obj);
                txtMemo.Visible = false;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增职教人员类型:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "committee_head_ship" && mode == "Insert")
            {
                CommitteeHeadShipBLL objBLL = new CommitteeHeadShipBLL();
                if (objBLL.GetAllCommitteeHeadShipByWhereClause("committee_head_ship_name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该职教委员会职务,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                CommitteeHeadShip obj = new CommitteeHeadShip();
                obj.CommitteeHeadShipName = txtItemName.Text;
                objBLL.InsertCommitteeHeadShip(obj);
                txtMemo.Visible = false;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增职教委员会职务:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "random_exam_modular_type" && mode == "Insert")
            {
                RandomExamModularTypeBLL objBLL = new RandomExamModularTypeBLL();
                if (objBLL.GetAllRandomExamModularTypeByWhereClause("random_exam_modular_type_name='" + txtItemName.Text + "'").Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该模块考试类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }
                RandomExamModularType obj = new RandomExamModularType();
                obj.RandomExamModularTypeName = txtItemName.Text;
                objBLL.InsertRandomExamModularType(obj);
                txtMemo.Visible = false;
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增模块考试类别:" + txtItemName.Text);
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "trainplan_type" && mode == "Insert")
            {
                OracleAccess oracle = new OracleAccess();
                DataTable    dt     =
                    oracle.RunSqlDataSet(
                        string.Format(
                            "select * from zj_trainplan_type where  trainplan_type_name='{0}'",
                            txtItemName.Text)).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该培训类别,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                oracle.ExecuteNonQuery(
                    string.Format(
                        "insert into zj_trainplan_type values(TRAIN_PLAN_TYPE_SEQ.Nextval,'{0}')",
                        txtItemName.Text.Trim()));
                SystemLogBLL objLogBll = new SystemLogBLL();
                objLogBll.WriteLog("新增模块考试类别:(" + txtItemName.Text.Trim() + ")");
                Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
            }
            if (value == "safe_level" && mode == "Insert")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_safe_level where safe_level_name='{0}'", txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该安全等级,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                try
                {
                    DataTable dtcount  = access.RunSqlDataSet("select count(1) from zj_safe_level").Tables[0];
                    string    strIndex = "(select max(order_index)+1 from zj_safe_level)";
                    if (Convert.ToInt32(dtcount.Rows[0][0]) == 0)
                    {
                        strIndex = "1";
                    }
                    string sql =
                        string.Format(
                            "insert into zj_safe_level values(safe_level_seq.nextval,'{0}',{1})",
                            txtItemName.Text.Trim(), strIndex);
                    access.ExecuteNonQuery(sql);
                    SystemLogBLL objLogBll = new SystemLogBLL();
                    objLogBll.WriteLog("新增安全等级:(" + txtItemName.Text.Trim() + ")");
                    Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
                }
                catch
                {
                    SessionSet.PageMessage = "数据新增失败!";
                }
            }
            if (value == "certificate" && mode == "Insert")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_certificate where certificate_name='{0}'", txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该证书,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                try
                {
                    DataTable dtcount  = access.RunSqlDataSet("select count(1) from zj_certificate").Tables[0];
                    string    strIndex = "(select max(order_index)+1 from zj_certificate)";
                    if (Convert.ToInt32(dtcount.Rows[0][0]) == 0)
                    {
                        strIndex = "1";
                    }
                    string sql =
                        string.Format(
                            "insert into zj_certificate values(zj_certificate_seq.nextval,'{0}',{1})",
                            txtItemName.Text.Trim(), strIndex);
                    access.ExecuteNonQuery(sql);
                    SystemLogBLL objLogBll = new SystemLogBLL();
                    objLogBll.WriteLog("新增证书:(" + txtItemName.Text.Trim() + ")");
                    Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
                }
                catch
                {
                    SessionSet.PageMessage = "数据新增失败!";
                }
            }
            if (value == "certificate_level" && mode == "Insert")
            {
                OracleAccess access = new OracleAccess();
                try
                {
                    DataTable dtcount  = access.RunSqlDataSet("select count(1) from zj_certificate_level").Tables[0];
                    string    strIndex = "(select max(order_index)+1 from zj_certificate_level)";
                    if (Convert.ToInt32(dtcount.Rows[0][0]) == 0)
                    {
                        strIndex = "1";
                    }
                    string sql =
                        string.Format(
                            "insert into zj_certificate_level values(zj_certificate_level_seq.nextval,'{0}','{1}',{2})",
                            Convert.ToInt32(ddlType.SelectedValue), txtItemName.Text.Trim(), strIndex);
                    access.ExecuteNonQuery(sql);
                    SystemLogBLL objLogBll = new SystemLogBLL();
                    objLogBll.WriteLog("新增证书级别:(" + txtItemName.Text.Trim() + ")");
                    Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
                }
                catch
                {
                    SessionSet.PageMessage = "数据新增失败!";
                }
            }
            if (value == "certificate_unit" && mode == "Insert")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_certificate_unit where certificate_unit_name='{0}'", txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该发证单位,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                try
                {
                    DataTable dtcount  = access.RunSqlDataSet("select count(1) from zj_certificate_unit").Tables[0];
                    string    strIndex = "(select max(order_index)+1 from zj_certificate_unit)";
                    if (Convert.ToInt32(dtcount.Rows[0][0]) == 0)
                    {
                        strIndex = "1";
                    }
                    string sql =
                        string.Format(
                            "insert into zj_certificate_unit values(zj_certificate_unit_seq.nextval,'{0}',{1})",
                            txtItemName.Text.Trim(), strIndex);
                    access.ExecuteNonQuery(sql);
                    SystemLogBLL objLogBll = new SystemLogBLL();
                    objLogBll.WriteLog("新增发证单位:(" + txtItemName.Text.Trim() + ")");
                    Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
                }
                catch
                {
                    SessionSet.PageMessage = "数据新增失败!";
                }
            }
            if (value == "train_unit" && mode == "Insert")
            {
                OracleAccess access = new OracleAccess();
                DataTable    dt     = access.RunSqlDataSet(
                    string.Format("select count(1) from zj_train_unit where train_unit_name='{0}'", txtItemName.Text.Trim())).Tables[0];
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    SessionSet.PageMessage = "系统中已存在该培训单位,请重新输入!";
                    txtItemName.Focus();
                    return;
                }

                try
                {
                    DataTable dtcount  = access.RunSqlDataSet("select count(1) from zj_train_unit").Tables[0];
                    string    strIndex = "(select max(order_index)+1 from zj_train_unit)";
                    if (Convert.ToInt32(dtcount.Rows[0][0]) == 0)
                    {
                        strIndex = "1";
                    }
                    string sql =
                        string.Format(
                            "insert into zj_train_unit values(zj_train_unit_seq.nextval,'{0}',{1})",
                            txtItemName.Text.Trim(), strIndex);
                    access.ExecuteNonQuery(sql);
                    SystemLogBLL objLogBll = new SystemLogBLL();
                    objLogBll.WriteLog("新增培训单位:(" + txtItemName.Text.Trim() + ")");
                    Response.Write("<script>window.opener.gridCallBack.callback('');window.close();</script>");
                }
                catch
                {
                    SessionSet.PageMessage = "数据新增失败!";
                }
            }
        }
Example #19
0
 public Fltr(int DId, int UId, int HourOffset, DateTime Start, DateTime End, DateRange Range, Grouping YAxis, Grouping SubYAxis, int PriorityID, int ClassID, int ClassLevel, int SubClassLevel, int CreationCategoryID, int LocationID, int LocationTypeID, int SubLocationTypeID, int TechnicianID, int SubmittedByID, int ClosedByID, int AccountID, int AccountLocationId, int accountParentLocationId, int SubmissionCategoryID, int ResolutionCategoryID, int AgeDay, EqualRange AgeRange, int TicketLevelID, int SupportGroupID, TechnicianType technicianType, HandledByCallCenter handledByCallCenter, string asset_filter, int sla_graph_width_id, int sla_graph_view_id)
     : this(DId, UId, HourOffset, Start, End, Range, YAxis, SubYAxis, PriorityID, ClassID, ClassLevel, SubClassLevel, CreationCategoryID, LocationID, LocationTypeID, SubLocationTypeID, TechnicianID, SubmittedByID, ClosedByID, AccountID, AccountLocationId, accountParentLocationId, SubmissionCategoryID, ResolutionCategoryID, AgeDay, AgeRange, TicketLevelID, SupportGroupID, technicianType, handledByCallCenter, asset_filter)
 {
     _sla_graph_width_id = sla_graph_width_id;
     _sla_graph_view_id = sla_graph_view_id;
 }
Example #20
0
        public Fltr(int DId, int UId, int HourOffset)
        {
            _did = DId;
            _uid = UId;

            this.LoadReportDefaults(_did, _uid, false);

            _houroffset = HourOffset;
            _end        = _end.AddHours(-_houroffset);
            _start      = _start.AddMonths(-1).AddHours(-_houroffset);
            UserSetting _c = UserSetting.GetSettings("RPT");

            if (_c == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(_c["FID"]))
            {
                _id = int.Parse(_c["FID"]);
            }
            if (!string.IsNullOrEmpty(_c["FNAME"]))
            {
                _name = HttpUtility.UrlDecode(_c["FNAME"]);
            }
            if (!string.IsNullOrEmpty(_c["FTYPE"]))
            {
                _reptype = (ReportType)Enum.Parse(typeof(ReportType), _c["FTYPE"], true);
            }

            string[]        expectedFormats = { "MM/dd/yyyy HH:mm:ss", "MM/dd/yyyyHH:mm:ss", "MM.dd.yyyy HH:mm:ss", "MM.dd.yyyyHH:mm:ss" };
            IFormatProvider culture         = new CultureInfo("en-US", false);

            if (!string.IsNullOrEmpty(_c["STDT"]))
            {
                try
                {
                    string _str_start = HttpUtility.UrlDecode(_c["STDT"]);
                    _start = DateTime.ParseExact(_str_start, expectedFormats, culture, DateTimeStyles.None);
                }
                catch { }
            }
            ;

            if (!string.IsNullOrEmpty(_c["ENDT"]))
            {
                try
                {
                    string _str_end = HttpUtility.UrlDecode(_c["ENDT"]);
                    _end = DateTime.ParseExact(_str_end, expectedFormats, culture, DateTimeStyles.None);
                }
                catch { }
            }
            ;

            if (!string.IsNullOrEmpty(_c["RANGE"]))
            {
                this.DateRange = ConvertStringToRange(_c["RANGE"]);                                    //(DateRange)Enum.Parse(typeof(DateRange),_c["RANGE"],true);
            }
            if (!string.IsNullOrEmpty(_c["SLAYAX"]))
            {
                if (_c["SLAYAX"].IndexOf(Grouping.AccountLocation.ToString()) >= 0)
                {
                    _yaxis = Grouping.AccountLocation;
                }
                else if (_c["SLAYAX"].IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _yaxis        = Grouping.Location;
                    _locationtype = int.Parse(HttpUtility.UrlDecode(_c["SLAYAX"]).Split(',')[1]);
                }
                else if (_c["SLAYAX"].IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _yaxis = Grouping.Class;
                    string[] _arr = HttpUtility.UrlDecode(_c["SLAYAX"]).Split(',');
                    if (_arr.Length > 1)
                    {
                        _classlevel = int.Parse(_arr[1]);
                    }
                }
                else
                {
                    _yaxis = (Grouping)Enum.Parse(typeof(Grouping), _c["SLAYAX"], true);
                }
            }
            if (!string.IsNullOrEmpty(_c["SLASYAX"]))
            {
                if (_c["SLASYAX"].IndexOf(Grouping.AccountLocation.ToString()) >= 0)
                {
                    _subyaxis = Grouping.AccountLocation;
                }
                else if (_c["SLASYAX"].IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _subyaxis        = Grouping.Location;
                    _sublocationtype = int.Parse(HttpUtility.UrlDecode(_c["SLASYAX"]).Split(',')[1]);
                }
                else if (_c["SLASYAX"].IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _subyaxis = Grouping.Class;
                    string[] _arr = HttpUtility.UrlDecode(_c["SLASYAX"]).Split(',');
                    if (_arr.Length > 1)
                    {
                        _subclasslevel = int.Parse(_arr[1]);
                    }
                }
                else
                {
                    _subyaxis = (Grouping)Enum.Parse(typeof(Grouping), _c["SLASYAX"], true);
                }
            }
            if (!string.IsNullOrEmpty(_c["SLAPRT"]))
            {
                _priority = int.Parse(_c["SLAPRT"]);
            }
            if (!string.IsNullOrEmpty(_c["SLACLS"]))
            {
                _class = int.Parse(_c["SLACLS"]);
            }
            if (!string.IsNullOrEmpty(_c["SLACTG"]))
            {
                _creationcategory = int.Parse(_c["SLACTG"]);
            }
            if (!string.IsNullOrEmpty(_c["SLASTG"]))
            {
                _submissioncat = int.Parse(_c["SLASTG"]);
            }
            if (!string.IsNullOrEmpty(_c["SLARTG"]))
            {
                _resolutioncat = int.Parse(_c["SLARTG"]);
            }
            if (!string.IsNullOrEmpty(_c["SLALCT"]))
            {
                _location = int.Parse(_c["SLALCT"]);
            }
            if (!string.IsNullOrEmpty(_c["SLATCH"]))
            {
                _technician = int.Parse(_c["SLATCH"]);
            }
            if (!string.IsNullOrEmpty(_c["SLASBY"]))
            {
                _submittedby = int.Parse(_c["SLASBY"]);
            }
            if (!string.IsNullOrEmpty(_c["SLACBY"]))
            {
                _closedby = int.Parse(_c["SLACBY"]);
            }
            if (!string.IsNullOrEmpty(_c["SLAACC"]))
            {
                _account = int.Parse(_c["SLAACC"]);
            }
            if (!string.IsNullOrEmpty(_c["SLAACCL"]))
            {
                _accountLocation = int.Parse(_c["SLAACCL"]);
            }
            if (!string.IsNullOrEmpty(_c["SLAACCPL"]))
            {
                _accountParentLocation = int.Parse(_c["SLAACCPL"]);
            }

            if (!string.IsNullOrEmpty(_c["TECHTYPE"]))
            {
                technicianType = (TechnicianType)Enum.Parse(typeof(TechnicianType), _c["TECHTYPE"], true);
            }
            if (!string.IsNullOrEmpty(_c["CALLCENTER"]))
            {
                handledByCallCenter = (HandledByCallCenter)Enum.Parse(typeof(HandledByCallCenter), _c["CALLCENTER"], true);
            }

            //tkt #3949: Level Filter added to Ticket Count Report
            if (!string.IsNullOrEmpty(_c["TICKETLEVEL"]))
            {
                _ticket_level = int.Parse(_c["TICKETLEVEL"]);
            }
            //tkt #3632: Add Support Groups to Ticket Count Report criteria
            if (!string.IsNullOrEmpty(_c["SUPPORTGROUP"]))
            {
                _support_group = int.Parse(_c["SUPPORTGROUP"]);
            }

            if (!string.IsNullOrEmpty(_c["AGEDAY"]))
            {
                _age = int.Parse(HttpUtility.UrlDecode(_c["AGEDAY"]));
            }
            if (!string.IsNullOrEmpty(_c["AGERANGE"]))
            {
                this.AgeRange = (EqualRange)Enum.Parse(typeof(EqualRange), _c["AGERANGE"], true);
            }

            if (!string.IsNullOrEmpty(_c["ASSETFILTER"]))
            {
                _asset_filter = HttpUtility.UrlDecode(_c["ASSETFILTER"]);
            }

            if (!string.IsNullOrEmpty(_c["SLAGRAPHWIDTH"]))
            {
                _sla_graph_width_id = int.Parse(_c["SLAGRAPHWIDTH"]);
            }
            if (!string.IsNullOrEmpty(_c["SLAGRAPHVIEW"]))
            {
                _sla_graph_view_id = int.Parse(_c["SLAGRAPHVIEW"]);
            }
        }
Example #21
0
        public Fltr(int DId, int Id)
        {
            _did = DId;
            _id  = Id;
            DataRow _row = SelectFilter(DId, _id);

            _uid = (int)_row["UId"];
            if (_row == null)
            {
                return;
            }
            _name    = _row["Name"].ToString();
            _reptype = (ReportType)(byte)_row["ReportType"];
            string[] _state = _row["FilterState"].ToString().Split('&');
            System.Collections.Specialized.StringDictionary _sd = new System.Collections.Specialized.StringDictionary();
            for (int i = 0; i < _state.Length; i++)
            {
                if (_state[i].Length == 0)
                {
                    continue;
                }
                string[] _item = _state[i].Split('=');
                if (_item.Length > 1)
                {
                    _sd.Add(_item[0], _item[1]);
                }
                else
                {
                    _sd.Add(_item[0], string.Empty);
                }
            }
            string[]        expectedFormats = { "MM/dd/yyyy HH:mm:ss", "MM/dd/yyyyHH:mm:ss", "MM.dd.yyyy HH:mm:ss", "MM.dd.yyyyHH:mm:ss" };
            IFormatProvider culture         = new CultureInfo("en-US", false);

            if (_sd.ContainsKey("ds") && _sd["ds"].Length > 0)
            {
                _start = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["ds"]), expectedFormats, culture, DateTimeStyles.None);
            }
            if (_sd.ContainsKey("de") && _sd["de"].Length > 0)
            {
                _end = DateTime.ParseExact(HttpUtility.UrlDecode(_sd["de"]), expectedFormats, culture, DateTimeStyles.None);
            }
            if (_sd.ContainsKey("dr") && _sd["dr"].Length > 0)
            {
                this.DateRange = ConvertStringToRange(HttpUtility.UrlDecode(_sd["dr"]));
            }
            if (_sd.ContainsKey("ya") && _sd["ya"].Length > 0)
            {
                string _val = HttpUtility.UrlDecode(_sd["ya"]);
                if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _yaxis        = Grouping.Location;
                    _locationtype = int.Parse(_val.Split(',')[1]);
                }
                else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _yaxis = Grouping.Class;
                    string[] _arr = _val.Split(',');
                    if (_arr.Length > 1)
                    {
                        _classlevel = int.Parse(_arr[1]);
                    }
                }
                else
                {
                    _yaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
                }
            }
            if (_sd.ContainsKey("sya") && _sd["sya"].Length > 0)
            {
                string _val = HttpUtility.UrlDecode(_sd["sya"]);
                if (_val.IndexOf(Grouping.Location.ToString()) >= 0)
                {
                    _subyaxis        = Grouping.Location;
                    _sublocationtype = int.Parse(_val.Split(',')[1]);
                }
                else if (_val.IndexOf(Grouping.Class.ToString()) >= 0)
                {
                    _subyaxis = Grouping.Class;
                    string[] _arr = _val.Split(',');
                    if (_arr.Length > 1)
                    {
                        _subclasslevel = int.Parse(_arr[1]);
                    }
                }
                else
                {
                    _subyaxis = (Grouping)Enum.Parse(typeof(Grouping), _val, true);
                }
            }
            if (_sd.ContainsKey("prt") && _sd["prt"].Length > 0)
            {
                _priority = int.Parse(_sd["prt"]);
            }
            if (_sd.ContainsKey("cls") && _sd["cls"].Length > 0)
            {
                _class = int.Parse(_sd["cls"]);
            }
            if (_sd.ContainsKey("ctg") && _sd["ctg"].Length > 0)
            {
                _creationcategory = int.Parse(_sd["ctg"]);
            }
            if (_sd.ContainsKey("stg") && _sd["stg"].Length > 0)
            {
                _submissioncat = int.Parse(_sd["stg"]);
            }
            if (_sd.ContainsKey("rtg") && _sd["rtg"].Length > 0)
            {
                _resolutioncat = int.Parse(_sd["rtg"]);
            }
            if (_sd.ContainsKey("lct") && _sd["lct"].Length > 0)
            {
                _location = int.Parse(_sd["lct"]);
            }
            if (_sd.ContainsKey("tch") && _sd["tch"].Length > 0)
            {
                _technician = int.Parse(_sd["tch"]);
            }
            if (_sd.ContainsKey("sby") && _sd["sby"].Length > 0)
            {
                _submittedby = int.Parse(_sd["sby"]);
            }
            if (_sd.ContainsKey("cby") && _sd["cby"].Length > 0)
            {
                _closedby = int.Parse(_sd["cby"]);
            }
            if (_sd.ContainsKey("acc") && _sd["acc"].Length > 0)
            {
                _account = int.Parse(_sd["acc"]);
            }
            if (_sd.ContainsKey("accl") && _sd["accl"].Length > 0)
            {
                _accountLocation = int.Parse(_sd["accl"]);
            }
            if (_sd.ContainsKey("accpl") && _sd["accpl"].Length > 0)
            {
                _accountParentLocation = int.Parse(_sd["accpl"]);
            }
            if (_sd.ContainsKey("tcht") && _sd["tcht"].Length > 0)
            {
                technicianType = (TechnicianType)Enum.Parse(typeof(TechnicianType), HttpUtility.UrlDecode(_sd["tcht"]), true);
            }
            if (_sd.ContainsKey("hcc") && _sd["hcc"].Length > 0)
            {
                handledByCallCenter = (HandledByCallCenter)Enum.Parse(typeof(HandledByCallCenter), HttpUtility.UrlDecode(_sd["hcc"]), true);
            }
            if (_sd.ContainsKey("lvl") && _sd["lvl"].Length > 0)
            {
                _ticket_level = int.Parse(_sd["lvl"]);
            }
            if (_sd.ContainsKey("sg") && _sd["sg"].Length > 0)
            {
                _support_group = int.Parse(_sd["sg"]);
            }
            if (_sd.ContainsKey("age") && _sd["age"].Length > 0)
            {
                _age = int.Parse(_sd["age"]);
            }
            if (_sd.ContainsKey("ager") && _sd["ager"].Length > 0)
            {
                _age_equal = (EqualRange)Enum.Parse(typeof(EqualRange), HttpUtility.UrlDecode(_sd["ager"]), true);
            }
            if (_sd.ContainsKey("ass") && _sd["ass"].Length > 0)
            {
                _asset_filter = HttpUtility.UrlDecode(_sd["ass"]);
            }
            if (_sd.ContainsKey("slaw") && _sd["slaw"].Length > 0)
            {
                _sla_graph_width_id = int.Parse(_sd["slaw"]);
            }
            if (_sd.ContainsKey("slag") && _sd["slag"].Length > 0)
            {
                _sla_graph_view_id = int.Parse(_sd["slag"]);
            }
        }
Example #22
0
 public void ResetToDefaults()
 {
     _id = 0;
     _name = string.Empty;
     _reptype = ReportType.NotSet;
     _range = DateRange.Custom;
     _start = DateTime.UtcNow.Date;
     _end = DateTime.UtcNow;
     _yaxis = Grouping.None;
     _subyaxis = Grouping.None;
     _age_equal = EqualRange.Less;
     technicianType = TechnicianType.All;
     handledByCallCenter = HandledByCallCenter.All;
     _priority = 0;
     _class = 0;
     _classlevel = 0;
     _classnull = false;
     _subclasslevel = 0;
     _creationcategory = 0;
     _submissioncat = 0;
     _resolutioncat = 0;
     _location = 0;
     _locationtype = 0;
     _sublocationtype = 0;
     _technician = 0;
     _submittedby = 0;
     _closedby = 0;
     _account = 0;
     _accountLocation = 0;
     _accountParentLocation = 0;
     _month = 0;
     _age = -1;
     _ticket_level = 0;
     _support_group = 0;
     _asset_filter = string.Empty;
     _sla_graph_width_id = 0;
     _sla_graph_view_id = 0;
     LoadReportDefaults(_did, _uid, true);
     _end = _end.AddHours(-_houroffset);
     _start = _start.AddMonths(-1).AddHours(-_houroffset);
 }
Example #23
0
 public Fltr(int DId, int UId, int HourOffset, DateTime Start, DateTime End, DateRange Range, Grouping YAxis, Grouping SubYAxis, int PriorityID, int ClassID, int ClassLevel, int SubClassLevel, int CreationCategoryID, int LocationID, int LocationTypeID, int SubLocationTypeID, int TechnicianID, int SubmittedByID, int ClosedByID, int AccountID, int AccountLocationId, int accountParentLocationId, int SubmissionCategoryID, int ResolutionCategoryID, int AgeDay, EqualRange AgeRange, int TicketLevelID, int SupportGroupID, TechnicianType technicianType, HandledByCallCenter handledByCallCenter, string asset_filter, int sla_graph_width_id, int sla_graph_view_id)
     : this(DId, UId, HourOffset, Start, End, Range, YAxis, SubYAxis, PriorityID, ClassID, ClassLevel, SubClassLevel, CreationCategoryID, LocationID, LocationTypeID, SubLocationTypeID, TechnicianID, SubmittedByID, ClosedByID, AccountID, AccountLocationId, accountParentLocationId, SubmissionCategoryID, ResolutionCategoryID, AgeDay, AgeRange, TicketLevelID, SupportGroupID, technicianType, handledByCallCenter, asset_filter)
 {
     _sla_graph_width_id = sla_graph_width_id;
     _sla_graph_view_id  = sla_graph_view_id;
 }