public static List <InternalRegionBO> GetInternalRegion()
        {
            var dbUtil = new DatabaseManager();

            var ir = new List <InternalRegionBO>();

            using (var conn = new SqlConnection(dbUtil.getSQLConnectionString("MainDB")))
            {
                conn.Open();
                using (SqlCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandType    = CommandType.StoredProcedure;
                    cmd.CommandText    = "spGetMasInternalRegion";
                    cmd.CommandTimeout = 180;

                    using (SqlDataReader reader = cmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var irs = new InternalRegionBO
                            {
                                ID                  = ReferenceEquals(reader["ID"], DBNull.Value) ? 0 : Convert.ToInt32(reader["ID"]),
                                strName             = ReferenceEquals(reader["strName"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strName"]),
                                intIDAM             = ReferenceEquals(reader["intIDAM"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intIDAM"]),
                                strAMName           = ReferenceEquals(reader["strAMName"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strAMName"]),
                                intIDOM             = ReferenceEquals(reader["intIDOM"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intIDOM"]),
                                strOMName           = ReferenceEquals(reader["strOMName"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strOMName"]),
                                intIDMasMajorRegion = ReferenceEquals(reader["intIDMasMajorRegion"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intIDMasMajorRegion"]),
                                strMasMajorRegion   = ReferenceEquals(reader["strMasMajorRegion"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strMasMajorRegion"]),
                                intStatus           = ReferenceEquals(reader["intStatus"], DBNull.Value) ? 0 : Convert.ToInt32(reader["intStatus"]),
                                strStatus           = ReferenceEquals(reader["strStatus"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strStatus"]),
                                strRightCode        = ReferenceEquals(reader["strRightCode"], DBNull.Value) ? String.Empty : Convert.ToString(reader["strRightCode"])
                            };

                            ir.Add(irs);
                        }
                        return(ir);
                    }
                }
            }
        }
        public static string ManageInternalRegion(NameValueCollection querystring)
        {
            var         ir             = new InternalRegionBO();
            UserProfile objUserProfile = WebCommon.GetUserProfile();

            int    ID;
            string strMode;


            ir.ID                  = int.TryParse(querystring.Get("intIRID"), out ID) ? ID : 0;
            ir.strName             = querystring.Get("strName");
            ir.intIDAM             = int.TryParse(querystring.Get("intIDAM"), out ID) ? ID : 0;
            ir.intIDOM             = int.TryParse(querystring.Get("intIDOM"), out ID) ? ID : 0;
            ir.intIDMasMajorRegion = int.TryParse(querystring.Get("intIDMasMajorRegion"), out ID) ? ID : 0;
            ir.intStatus           = int.TryParse(querystring.Get("intStatus"), out ID) ? ID : 0;
            ir.strRightCode        = querystring.Get("strRightCode");
            ir.intIDSecUser        = objUserProfile.UserId;

            strMode = querystring.Get("strMode");
            string param = WebCommon.ToXML(ir);

            return(InternalRegionDAL.ManageInternalRegion(param, strMode));
        }