示例#1
0
 public static CustomList<SegmentNames> GetAllSegmentNames()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<SegmentNames> SegmentNamesCollection = new CustomList<SegmentNames>();
     IDataReader reader = null;
     const String sql = "select *from SegmentNames";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             SegmentNames newSegmentNames = new SegmentNames();
             newSegmentNames.SetData(reader);
             SegmentNamesCollection.Add(newSegmentNames);
         }
         return SegmentNamesCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
示例#2
0
        public static CustomList <SegmentNames> GetAllSegmentNames()
        {
            ConnectionManager         conManager             = new ConnectionManager(ConnectionName.HR);
            CustomList <SegmentNames> SegmentNamesCollection = new CustomList <SegmentNames>();
            IDataReader  reader = null;
            const String sql    = "select *from SegmentNames";

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SegmentNames newSegmentNames = new SegmentNames();
                    newSegmentNames.SetData(reader);
                    SegmentNamesCollection.Add(newSegmentNames);
                }
                return(SegmentNamesCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
示例#3
0
        public static CustomList <SegmentNames> GetGroupSegmentNames(String itemGroupID)
        {
            ConnectionManager         conManager             = new ConnectionManager(ConnectionName.HR);
            CustomList <SegmentNames> SegmentNamesCollection = new CustomList <SegmentNames>();
            IDataReader reader = null;
            String      sql    = "EXEC spGetGroupWiseSegment " + itemGroupID;

            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    SegmentNames newSegmentNames = new SegmentNames();
                    newSegmentNames.SetData(reader);
                    SegmentNamesCollection.Add(newSegmentNames);
                }
                return(SegmentNamesCollection);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (reader != null && !reader.IsClosed)
                {
                    reader.Close();
                }
            }
        }
示例#4
0
        private void ItemSegment()
        {
            String refSourceString = String.Empty;
            ItemSegmentManager manager = new ItemSegmentManager();
            String segmentNameID = HttpContext.Current.Request.QueryString["SegmentNameID"];
            HttpContext.Current.Session["ItemSegments_SegmentValuesList"] = manager.GetAllSegmentValues(Convert.ToInt32(segmentNameID));

            SegmentNames obj = new SegmentNames();
            CustomList<SegmentNames> segmentNameList = new CustomList<SegmentNames>();
            obj.SegNameID = segmentNameID.ToInt();
            obj.SetModified();
            segmentNameList.Add(obj);
            HttpContext.Current.Session["ItemSegments_SegmentNamesSavedList"] = segmentNameList;

            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ContentType = "text/plain";
            HttpContext.Current.Response.Write(refSourceString);
            HttpContext.Current.Response.Flush();
        }
示例#5
0
 public static CustomList<SegmentNames> GetGroupSegmentNames(String itemGroupID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<SegmentNames> SegmentNamesCollection = new CustomList<SegmentNames>();
     IDataReader reader = null;
     String sql = "EXEC spGetGroupWiseSegment " + itemGroupID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             SegmentNames newSegmentNames = new SegmentNames();
             newSegmentNames.SetData(reader);
             SegmentNamesCollection.Add(newSegmentNames);
         }
         return SegmentNamesCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
示例#6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CustomList<SegmentNames> lstSegmentNames = SegmentNamesSavedList;
                if (lstSegmentNames.Count == 0)
                {
                    SegmentNames newSegmentNames = new SegmentNames();
                    lstSegmentNames.Add(newSegmentNames);
                }
                SetDataFromControlToObj(ref lstSegmentNames);
                CustomList<SegmentValues> lstSegmentValues = (CustomList<SegmentValues>)SegmentValuesList;

                if (!CheckUserAuthentication(lstSegmentNames, lstSegmentValues)) return;
                manager.SaveItemSegment(ref lstSegmentNames, ref lstSegmentValues);
                InitializeCombo();
                ((PageBase)this.Page).SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
            }
            catch (SqlException ex)
            {
                this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
            }
            catch (Exception ex)
            {
                this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }